Skip to content

Commit b0c451f

Browse files
committed
Update
[ghstack-poisoned]
1 parent a9a32f3 commit b0c451f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

torch/csrc/distributed/c10d/symm_mem/nccl_devcomm_manager.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,16 @@ class NCCLDevCommManager {
6363
}
6464
c10::cuda::CUDAGuard guard(device_);
6565
ncclDevComm devComm;
66+
67+
// Initializer available from NCCL 2.29
68+
#ifdef NCCL_DEV_COMM_REQUIREMENTS_INITIALIZER
69+
ncclDevCommRequirements reqs = NCCL_DEV_COMM_REQUIREMENTS_INITIALIZER;
70+
#else
71+
// In 2.28, we can set it to zero
6672
ncclDevCommRequirements reqs;
67-
// See example in
68-
// https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/usage/deviceapi.html#simple-lsa-kernel
6973
memset(&reqs, 0, sizeof(ncclDevCommRequirements));
74+
#endif
75+
7076
// Specifies the number of memory barriers to allocate.
7177
reqs.lsaBarrierCount = NCCL_LSA_BARRIER_COUNT;
7278
// TODO (kwen2501): Add network barrier count.

0 commit comments

Comments
 (0)