ray.train.torch.TorchConfig#

class ray.train.torch.TorchConfig(backend: str | None = None, init_method: str = 'env', timeout_s: int = 1800)[source]#

Bases: BackendConfig

Configuration for torch process group setup.

See https://pytorch.org/docs/stable/distributed.html for more info.

Parameters:
  • backend – The backend to use for training. See torch.distributed.init_process_group for more info and valid values. If set to None, nccl will be used if GPUs are requested, else gloo will be used.

  • init_method – The initialization method to use. Either “env” for environment variable initialization or “tcp” for TCP initialization. Defaults to “env”.

  • timeout_s – Seconds for process group operations to timeout.

Methods

Attributes

backend

backend_cls

init_method

timeout_s

train_func_context