Fully disable MSCCL when machine is not matched (#1017)

* Disable MSCCL algorithm meta loading when machine is not matched

* fully disable init

* fix potential segfault
This commit is contained in:
Ziyue Yang
2023-12-14 00:36:21 +08:00
committed by GitHub
parent 53d807a5b9
commit 655742a3a6
4 changed files with 17 additions and 4 deletions
+10 -1
View File
@@ -36,6 +36,14 @@ bool mscclEnabled() {
#endif
}
bool mscclForceEnabled() {
#ifdef COMPILE_MSCCL_KERNEL
return rcclParamMscclForceEnabled();
#else
return false;
#endif
}
void mscclSetIsCallerFlag() {
mscclGetThreadLocalStatus().mscclIsCallerFlag = true;
}
@@ -309,7 +317,8 @@ static ncclResult_t mscclSchedulerSelectAlgo(struct mscclSavedSchedulerParam* pa
if (status.mscclSchedulerPtr) {
NCCLCHECK(status.mscclSchedulerPtr->selectAlgo(&(param->p)));
} else {
if (param->comm->topo->mscclEnabled || rcclParamMscclForceEnabled()) {
// Disable MSCCL algorithms if machine type is not matching
if (param->comm->topo->mscclEnabled || mscclForceEnabled()) {
NCCLCHECK(mscclInternalSchedulerSelectAlgo(&(param->p)));
} else {
param->p.scheduled = false;