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_execution_wait: float = 5.0, peer_read_timeout: float | None = None, monitor_interval: float = 0.01, read_interval: float = 0.5, heartbeat_interval: float = 5.0, heartbeat_timeout: float = 30.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 (Optional[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 (default: 5.0). This value should be greater than the time needed for sending the whole result.
peer_read_timeout (Optional[float]) – Timeout for waiting the task to be read by the peer from the pipe (None for no timeout).
monitor_interval (float) – Interval for monitoring the launcher (default: 0.01).
read_interval (float) – Interval for reading from the pipe (default: 0.5).
heartbeat_interval (float) – Interval for sending heartbeat to the peer (default: 5.0).
heartbeat_timeout (float) – Timeout for waiting for a heartbeat from the peer (default: 30.0).
workers (int) – Number of worker threads needed (default: 4).
train_with_evaluation (bool) – Whether to run training with global model evaluation (default: True).
train_task_name (str) – Task name of train mode (default: train).
evaluate_task_name (str) – Task name of evaluate mode (default: evaluate).
submit_model_task_name (str) – Task name of submit_model mode (default: submit_model).
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.