Skip to content

Commit f6c6d45

Browse files
authored
mscclpp compatibility check for ubr (#1573)
1 parent 59c5584 commit f6c6d45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/register.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ ncclResult_t ncclCommRegister_impl(const ncclComm_t comm, void* buff, size_t siz
161161
NCCLCHECK(CommCheck(comm, "ncclCommRegister", "comm"));
162162
if (comm->checkPointers) NCCLCHECK(CudaPtrCheck(buff, comm, "buff", "ncclCommRegister"));
163163
#ifdef ENABLE_MSCCLPP
164+
if (comm->mscclppCompatible) {
164165
if (comm->mscclCompatible && size > 0){
165166
bool isManagedBuffer = false;
166167
CUDACHECK(hipPointerGetAttribute(&isManagedBuffer, HIP_POINTER_ATTRIBUTE_IS_MANAGED, const_cast<void*>(buff)));
@@ -173,6 +174,7 @@ ncclResult_t ncclCommRegister_impl(const ncclComm_t comm, void* buff, size_t siz
173174
WARN("MSCCL++: Cannot register user-buffers on managed memory. RCCL user-buffer registration will occur.");
174175
}
175176
}
177+
}
176178
#endif
177179
INFO(NCCL_INIT, "RCCL: ncclCommRegister");
178180
NCCLCHECK(ncclRegister(comm, buff, size, handle));
@@ -183,11 +185,13 @@ NCCL_API(ncclResult_t, ncclCommDeregister, const ncclComm_t comm, void* handle);
183185
ncclResult_t ncclCommDeregister_impl(const ncclComm_t comm, void* handle) {
184186

185187
#ifdef ENABLE_MSCCLPP
188+
if (comm->mscclppCompatible) {
186189
const size_t size = mscclpp_BufferSize(comm->mscclpp_comm, handle);
187190
if (comm->mscclCompatible && size > 0) {
188191
NCCLCHECK(mscclpp_ncclCommDeregister(comm->mscclpp_comm, handle));
189192
return ncclSuccess;
190193
}
194+
}
191195
#endif
192196

193197
NCCLCHECK(CommCheck(comm, "ncclCommRegister", "comm"));

0 commit comments

Comments
 (0)