nvflare.app_common.executors.client_api_launcher_executor module

class ClientAPILauncherExecutor(pipe_id: str, launcher_id: str | None = None, launch_timeout: float | None = None, task_wait_timeout: float | None = None, last_result_transfer_timeout: float = 300.0, external_pre_init_timeout: float = 60.0, peer_read_timeout: float | None = 60.0, monitor_interval: float = 0.01, read_interval: float = 0.5, heartbeat_interval: float = 5.0, heartbeat_timeout: float = 60.0, workers: int = 4, train_with_evaluation: bool = True, train_task_name: str = 'train', evaluate_task_name: str = 'evaluate', submit_model_task_name: str = 'submit_model', from_nvflare_converter_id: str | None = None, to_nvflare_converter_id: str | None = None, params_exchange_format: str = 'numpy', params_transfer_type: str = 'FULL', config_file_name: str = 'client_api_config.json')[source]

Bases: LauncherExecutor

Initializes the ClientAPILauncherExecutor.

Parameters:
  • pipe_id (str) – Identifier for obtaining the Pipe from NVFlare components.

  • launcher_id (Optional[str]) – Identifier for obtaining the Launcher from NVFlare components.

  • launch_timeout (Optional[float]) – Timeout for the Launcher’s “launch_task” method to complete (None for no timeout).

  • task_wait_timeout (Optional[float]) – Timeout for retrieving the task result (None for no timeout).

  • last_result_transfer_timeout (float) – Timeout for transmitting the last result from an external process. This value should be greater than the time needed for sending the whole result.

  • external_pre_init_timeout (float) – Time to wait for external process before it calls flare.init().

  • peer_read_timeout (float, optional) – time to wait for peer to accept sent message.

  • monitor_interval (float) – Interval for monitoring the launcher.

  • read_interval (float) – Interval for reading from the pipe.

  • heartbeat_interval (float) – Interval for sending heartbeat to the peer.

  • heartbeat_timeout (float) – Timeout for waiting for a heartbeat from the peer.

  • workers (int) – Number of worker threads needed.

  • train_with_evaluation (bool) – Whether to run training with global model evaluation.

  • train_task_name (str) – Task name of train mode.

  • evaluate_task_name (str) – Task name of evaluate mode.

  • submit_model_task_name (str) – Task name of submit_model mode.

  • from_nvflare_converter_id (Optional[str]) – Identifier used to get the ParamsConverter from NVFlare components. This ParamsConverter will be called when model is sent from nvflare controller side to executor side.

  • to_nvflare_converter_id (Optional[str]) – Identifier used to get the ParamsConverter from NVFlare components. This ParamsConverter will be called when model is sent from nvflare executor side to controller side.

  • params_exchange_format (str) – What format to exchange the parameters.

  • params_transfer_type (str) – How to transfer the parameters. FULL means the whole model parameters are sent. DIFF means that only the difference is sent.

  • config_file_name (str) – The config file name to write attributes into, the client api will read in this file.

initialize(fl_ctx: FLContext) None[source]
prepare_config_for_launch(fl_ctx: FLContext)[source]