openfl.component.straggler_handling_functions
- class openfl.component.straggler_handling_functions.CutoffTimeBasedStragglerHandling(round_start_time=None, straggler_cutoff_time=inf, minimum_reporting=1, **kwargs)
Cutoff time based Straggler Handling function.
- 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.
- class openfl.component.straggler_handling_functions.PercentageBasedStragglerHandling(percent_collaborators_needed=1.0, minimum_reporting=1, **kwargs)
Percentage based Straggler Handling function.
- reset_policy_for_round() None
Not required in PercentageBasedStragglerHandling.
- start_policy(**kwargs) None
Not required in PercentageBasedStragglerHandling.
- straggler_cutoff_check(num_collaborators_done: int, num_all_collaborators: int) bool
If percent_collaborators_needed and minimum_reporting collaborators have reported results, then it is time to end round early.
- Parameters:
num_collaborators_done (int) – The number of collaborators that have reported.
all_collaborators (list) – All the collaborators.
- Returns:
bool – True if the straggler cutoff conditions are met, False otherwise.
- class openfl.component.straggler_handling_functions.StragglerHandlingPolicy
Federated Learning straggler handling interface.
- abstract reset_policy_for_round() None
Reset policy variable for the next round.
- Parameters:
None
- Returns:
None
- abstract start_policy(**kwargs) None
Start straggler handling policy for collaborator for a particular round. NOTE: Refer CutoffTimeBasedStragglerHandling for reference.
- Parameters:
**kwargs
- Returns:
None
- abstract straggler_cutoff_check(num_collaborators_done: int, num_all_collaborators: int, **kwargs) bool
Determines whether it is time to end the round early.
- Parameters:
num_collaborators_done – int Number of collaborators finished.
num_all_collaborators – int Total number of collaborators.
- Returns:
bool – True if it is time to end the round early, False otherwise.
- Raises:
NotImplementedError – This method must be implemented by a subclass.
|
Cutoff time based Straggler Handling function. |
|
Percentage based Straggler Handling function. |
|
Straggler handling module. |