[Misc]allow disable pynccl (#25421)

Signed-off-by: Lu Fang <fanglu@fb.com>
Co-authored-by: Lucia (Lu) Fang <fanglu@meta.com>
This commit is contained in:
Lucia Fang
2025-10-01 06:04:13 +00:00
committed by GitHub
co-authored by Lucia Fang
parent 2a69ab4899
commit f48b6a03ba
3 changed files with 12 additions and 1 deletions
@@ -147,6 +147,10 @@ class CudaCommunicator(DeviceCommunicatorBase):
assert out is not None
return out
pynccl_comm = self.pynccl_comm
if pynccl_comm is None or pynccl_comm.disabled:
out = input_.clone()
torch.distributed.all_reduce(out, group=self.device_group)
return out
assert pynccl_comm is not None
out = pynccl_comm.all_reduce(input_)
if out is None: