TorchConfig#
- class ray.train.torch.TorchConfig(backend: str | None = None, init_method: str = 'env', timeout_s: int = 1800)[source]#
Bases:
BackendConfigConfiguration for torch process group setup.
See https://docs.pytorch.org/docs/stable/distributed.html for more info.
- Parameters:
backend (str | None) – The backend to use for training. See
torch.distributed.init_process_groupfor more info and valid values. If set to None, nccl will be used if GPUs are requested, else gloo will be used.init_method (str) – The initialization method to use. Either “env” for environment variable initialization or “tcp” for TCP initialization. Defaults to “env”.
timeout_s (int) – Seconds for process group operations to timeout.
Methods
Attributes
The
Backendclass that sets up this framework on the workers.The training framework this config sets up.
The context manager class wrapping each worker's training function.