nvflare.app_opt.job_launcher.slurm.launcher module

Public NVFlare integration surface for the Slurm job launcher.

class ClientSlurmJobLauncher(*, workspace_path: str, sandbox: str, python_path: str, executables: dict, image: str | None = None, internal_port: int = 8102, sbatch_directives: dict | None = None, setup: str = '', forward_env: list | None = None, parent_host: str | None = None, poll_interval: float = 10.0, pending_timeout: float = 600.0)[source]

Bases: SlurmJobLauncher

Init 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.

EXE_MODULE: str | None = 'nvflare.private.fed.app.client.worker_process'
get_module_args(job_args: dict) tuple[source]

Select and structure the worker arguments for this launcher type.

class ServerSlurmJobLauncher(*, workspace_path: str, sandbox: str, python_path: str, executables: dict, image: str | None = None, internal_port: int = 8102, sbatch_directives: dict | None = None, setup: str = '', forward_env: list | None = None, parent_host: str | None = None, poll_interval: float = 10.0, pending_timeout: float = 600.0)[source]

Bases: SlurmJobLauncher

Init 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.

EXE_MODULE: str | None = 'nvflare.private.fed.app.server.runner_process'
get_module_args(job_args: dict) tuple[source]

Select and structure the worker arguments for this launcher type.

class SlurmJobLauncher(*, workspace_path: str, sandbox: str, python_path: str, executables: dict, image: str | None = None, internal_port: int = 8102, sbatch_directives: dict | None = None, setup: str = '', forward_env: list | None = None, parent_host: str | None = None, poll_interval: float = 10.0, pending_timeout: float = 600.0)[source]

Bases: JobLauncherSpec

Common lifecycle and launch-plan construction for client and server jobs.

Init 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.

EXE_MODULE: str | None = None
abstract get_module_args(job_args: dict) tuple[source]

Select and structure the worker arguments for this launcher type.

handle_event(event_type: str, fl_ctx: FLContext)[source]

Handles events.

Parameters:
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

launch_job(job_meta: dict, fl_ctx: FLContext) JobHandleSpec[source]

To launch a job run.

Parameters:
  • job_meta – job metadata

  • fl_ctx – FLContext

Returns: a JobHandle instance.