nvflare.app_common.ccwf.cyclic_client_ctl module¶
- class CyclicClientController(task_name_prefix='cyclic', learn_task_name='train', persistor_id='persistor', shareable_generator_id='shareable_generator', learn_task_check_interval=1.0, learn_task_abort_timeout=5.0, learn_task_ack_timeout=10, final_result_ack_timeout=10)[source]¶
Bases:
ClientSideController
Constructor of a ClientSideController object.
- Parameters:
task_name_prefix – prefix of task names. All CCWF task names are prefixed with this.
learn_task_name – name for the Learning Task (LT)
persistor_id – ID of the persistor component
shareable_generator_id – ID of the shareable generator component
learn_task_check_interval – interval for checking incoming Learning Task (LT)
learn_task_ack_timeout – timeout for sending the LT to other client(s)
final_result_ack_timeout – timeout for sending final result to participating clients
learn_task_abort_timeout – time to wait for the LT to become stopped after aborting it
allow_busy_task – whether a new learn task is allowed when working on current learn task
- do_learn_task(name: str, data: Shareable, fl_ctx: FLContext, abort_signal: Signal)[source]¶
This is called to do a Learn Task. Subclass must implement this method.
- Parameters:
name – task name
data – task data
fl_ctx – FL context of the task
abort_signal – abort signal for the task execution
Returns:
- start_workflow(shareable: Shareable, fl_ctx: FLContext, abort_signal: Signal) Shareable [source]¶
This is called for the subclass to start the workflow. This only happens on the starting_client.
- Parameters:
shareable – the initial task data (e.g. initial model weights)
fl_ctx – FL context
abort_signal – abort signal for task execution
Returns: