get_distributed_backend¶
- torchtune.training.get_distributed_backend(device_type: str, offload_ops_to_cpu: bool = False) str [source]¶
根据设备类型获取 PyTorch 分布式后端。
- 参数:
示例
>>> get_distributed_backend("cuda") 'nccl' >>> get_distributed_backend("cpu") 'gloo' >>> get_distributed_backend("cuda", offload_ops_to_cpu=True) 'cuda:nccl,cpu:gloo'
- 返回:
用于
torch.distributed.init_process_group
中的分布式后端。- 返回类型: