nvflare.app_common.executors.ham module¶
- class HierarchicalAggregationManager(learner_id: str, aggregator_id: str, aggr_timeout: float, min_responses: int, wait_time_after_min_resps_received: float)[source]¶
Bases:
ExecutorInit FLComponent.
The FLComponent is the base class of all FL Components. (executors, controllers, responders, filters, aggregators, and widgets are all FLComponents)
FLComponents have the capability to handle and fire events and contain various methods for logging.
- execute(task_name: str, shareable: Shareable, fl_ctx: FLContext, abort_signal: Signal) Shareable[source]¶
Execute the assigned task. If we are a leaf node in client hierarchy, we’ll execute the task by using the configured executor for the task name “exec_<task_name>”. This way different tasks can be handled by different executors.
If we are not leaf node, we’ll wait for results from child clients and then aggregate their results using the configured aggregator.
- Parameters:
task_name – name of the assigned task
shareable – task data
fl_ctx – FLContext object
abort_signal – signal to notify abort
Returns: task result