nvflare.app_common.tie.executor module¶
- class TieExecutor(configure_task_name='config', start_task_name='start')[source]¶
Bases:
Executor
Constructor
- Parameters:
configure_task_name – name of the config task
start_task_name – name of the start task
- configure(config: dict, fl_ctx: FLContext)[source]¶
Called by the TieExecutor to configure the executor based on the config params received from the server. A subclass of TieExecutor should implement this method.
- Parameters:
config – the config data
fl_ctx – FL context
Returns: None
- execute(task_name: str, shareable: Shareable, fl_ctx: FLContext, abort_signal: Signal) Shareable [source]¶
Executes a task.
- Parameters:
task_name (str) – task name.
shareable (Shareable) – input shareable.
fl_ctx (FLContext) – fl context.
abort_signal (Signal) – signal to check during execution to determine whether this task is aborted.
- Returns:
An output shareable.
- abstract get_applet(fl_ctx: FLContext) Applet [source]¶
Called by the TieExecutor to get the Applet to be used by this executor. A subclass of TieExecutor must implement this method.
- Parameters:
fl_ctx – the FL context
Returns: an Applet object
- abstract get_connector(fl_ctx: FLContext) Connector [source]¶
Called by the TieExecutor to get the Connector to be used by this executor. A subclass of TieExecutor must implement this method.
- Parameters:
fl_ctx – the FL context
Returns: a Connector object
- get_connector_config(fl_ctx: FLContext) dict [source]¶
Called by the TieExecutor to get config params for the connector. A subclass of TieExecutor should implement this method. Note that this method is always called after the “configure” method, hence it’s possible to dynamically determine the connector’s config based on the config params in the “configure” step.
- Parameters:
fl_ctx – the FL context
Returns: a dict of config params