ray.train.torch.TorchConfig#

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

基类:BackendConfig

torch 进程组设置的配置。

更多信息请参见 https://pytorch.org/docs/stable/distributed.html

参数:
  • backend – 用于训练的后端。更多信息和有效值请参见 torch.distributed.init_process_group。如果设置为 None,则在请求 GPU 时将使用 nccl,否则将使用 gloo。

  • init_method – 要使用的初始化方法。可以是“env”用于环境变量初始化,或“tcp”用于TCP初始化。默认为“env”。

  • timeout_s – 进程组操作的超时秒数。

方法

属性

backend

backend_cls

init_method

timeout_s

train_func_context