Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes lint
  • Loading branch information
syed-ahmed committed May 15, 2023
commit 5536c357ea3e39be2007d01bb9b78aa5e41a8cc2
9 changes: 4 additions & 5 deletions torch/nn/parallel/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,12 +749,11 @@ def __init__(
else:
self.process_group = process_group

if (
dist.get_backend(self.process_group) == "nccl"
and torch.cuda.nccl.version() >= (2, 17)
):
if dist.get_backend(
self.process_group
) == "nccl" and torch.cuda.nccl.version() >= (2, 17):
# Note: NVIDIA recommends using CGA Cluster Size of 2 when using DDP.
default_cga = dist.ProcessGroupNCCL.Options().config.cga_cluster_size # type: ignore[attr-defined]
default_cga = dist.ProcessGroupNCCL.Options().config.cga_cluster_size # type: ignore[attr-defined]
default_pg_nccl = self.process_group._get_backend(torch.device("cuda"))
current_cga = default_pg_nccl.options.config.cga_cluster_size
if current_cga == default_cga:
Expand Down