# tensorplay.distributed.launcher API Source: https://www.tensorplay.cn/docs/api/tensorplay.distributed.launcher.html ## Functions 1 [#](#api-tensorplay.distributed.launcher.launch_agent) ### launch_agent function[Full reference ↗](/docs/generated/tensorplay.distributed.launcher.launch_agent.html) ```python tensorplay.distributed.launcher.launch_agent(config: LaunchConfig, entrypoint: Callable | str | None, args: list[Any]) → Any ``` Start the local agent for entrypoint and run it to completion. Raises ChildFailedError when any worker fails after exhausting the restart budget. ## Classes 2 [#](#api-tensorplay.distributed.launcher.elastic_launch) ### elastic_launch class[Full reference ↗](/docs/generated/tensorplay.distributed.launcher.elastic_launch.html) ```python class tensorplay.distributed.launcher.elastic_launch(config: LaunchConfig, entrypoint: Callable | str | None) ``` Callable wrapper around [launch_agent()](/docs/generated/tensorplay.distributed.launcher.launch_agent.html#tensorplay.distributed.launcher.launch_agent). Usage: ``` elastic_launch(config=LaunchConfig(...), entrypoint="train.py")("--epoch", "10") ``` [#](#api-tensorplay.distributed.launcher.LaunchConfig) ### LaunchConfig class[Full reference ↗](/docs/generated/tensorplay.distributed.launcher.LaunchConfig.html) ```python class tensorplay.distributed.launcher.LaunchConfig(min_nodes: int = 1, max_nodes: int = 1, nproc_per_node: int = 1, run_id: str = '', role: str = 'default_role', rdzv_endpoint: str = '', rdzv_backend: str = 'static', rdzv_configs: dict[str, ~typing.Any]=, rdzv_timeout: int = -1, max_restarts: int = 0, monitor_interval: float = 0.1, start_method: str = 'spawn', log_dir: str | None = None, redirects: Any = None, tee: Any = None, metrics_cfg: dict[str, str]=, local_addr: str | None = None, node_rank: int = 0, master_addr: str | None = None, master_port: int | None = None) ``` Elastic launch settings for one job. min_nodes/max_nodes bound the job size; when they differ the job is elastic and nodes may join or leave within those bounds. rdzv_* fields select and configure the rendezvous backend.