openfl.component.straggler_handling_functions.cutoff_time_based_straggler_handling.CutoffTimeBasedStragglerHandling

class openfl.component.straggler_handling_functions.cutoff_time_based_straggler_handling.CutoffTimeBasedStragglerHandling(round_start_time=None, straggler_cutoff_time=inf, minimum_reporting=1, **kwargs)

Bases: StragglerHandlingPolicy

Cutoff time based Straggler Handling function.

Methods

reset_policy_for_round

Reset timer for the next round.

start_policy

Start time-based straggler handling policy for collaborator for a particular round.

straggler_cutoff_check

If minimum_reporting collaborators have reported results within straggler_cutoff_time then return True, otherwise False.

reset_policy_for_round() None

Reset timer for the next round.

start_policy(callback: Callable) None

Start time-based straggler handling policy for collaborator for a particular round.

Parameters:

callback – Callable Callback function for when straggler_cutoff_time elapses

Returns:

None

straggler_cutoff_check(num_collaborators_done: int, num_all_collaborators: int) bool

If minimum_reporting collaborators have reported results within straggler_cutoff_time then return True, otherwise False.

Parameters:
  • num_collaborators_done – int Number of collaborators finished.

  • num_all_collaborators – int Total number of collaborators.

Returns:

bool – True if the straggler cutoff conditions are met, False otherwise.