external_launcher_executor ¶
In-process executor for externally launched SPMD inference.
Unlike :class:MultiprocExecutor, which starts local subprocesses, this executor turns each process started by torchrun or srun into one inline worker. The launcher owns RANK, WORLD_SIZE, LOCAL_RANK, MASTER_ADDR, and MASTER_PORT; FastVideo initializes through the env:// rendezvous.
Every rank must call generation collectively with the same requests in the same order. World rank 0 owns saved media and returned frames; other ranks still execute the full pipeline so sequence-parallel collectives stay uniform.
Classes¶
fastvideo.worker.external_launcher_executor.ExternalLauncherEnv dataclass ¶
ExternalLauncherEnv(rank: int, local_rank: int, world_size: int, local_world_size: int | None, master_addr: str, master_port: int)
Distributed identity assigned to this process by its launcher.
fastvideo.worker.external_launcher_executor.ExternalLauncherExecutor ¶
ExternalLauncherExecutor(fastvideo_args: FastVideoArgs, *, log_queue=None)
Bases: Executor
Run this externally launched process's single worker inline.
Source code in fastvideo/worker/executor.py
Methods:¶
fastvideo.worker.external_launcher_executor.ExternalLauncherExecutor.broadcast_from_output_rank ¶
Broadcast a small control-plane value from global rank zero.
fastvideo.worker.external_launcher_executor.ExternalLauncherExecutor.collective_rpc ¶
collective_rpc(method: str | Callable, timeout: float | None = None, args: tuple = (), kwargs: dict | None = None) -> list[Any]
Execute a control call locally and return rank-ordered world results.
Every launcher process must enter this method with the same call. A local exception is gathered before any rank raises, so ordinary control-plane failures are reported consistently instead of leaving a successful peer behind. Per-call timeouts are unsupported; the process-group timeout and launcher failure policy bound hard failures.
Source code in fastvideo/worker/external_launcher_executor.py
Functions:¶
fastvideo.worker.external_launcher_executor.read_external_launcher_environ ¶
Return the launcher variables that :func:resolve_external_launcher_env reads.
Each name is read explicitly rather than handing over the whole process environment (docs/contributing/env_vars.md): torchrun's identity variables and Slurm's per-task SLURM_* identity for native srun launches.
Source code in fastvideo/worker/external_launcher_executor.py
fastvideo.worker.external_launcher_executor.resolve_external_launcher_env ¶
resolve_external_launcher_env(environ: Mapping[str, str]) -> ExternalLauncherEnv
Parse and validate a torchrun/srun distributed environment.