Fix MSCCL algorithm loading order (#1460)

This commit is contained in:
Ziyue Yang
2024-12-16 23:41:17 +08:00
committad av GitHub
förälder 45c1c1a781
incheckning 83c5eb7378
+5 -1
Visa fil
@@ -174,14 +174,18 @@ static ncclResult_t mscclInternalSchedulerInit(ncclComm_t comm, int* numChannels
fullDirPath = mscclAlgoDir;
}
INFO(NCCL_INIT, "Using MSCCL files from %s", fullDirPath);
std::set<std::string> sortedFullPaths;
while ((entry = readdir(dp))) {
if (entry->d_type != DT_LNK && entry->d_type != DT_REG) {
continue;
}
status.algoMetas.emplace_back();
std::string fullPath = fullDirPath;
fullPath += "/";
fullPath += entry->d_name;
sortedFullPaths.insert(fullPath);
}
for (auto& fullPath : sortedFullPaths) {
status.algoMetas.emplace_back();
NCCLCHECK(mscclGetAlgoMetaFromXmlFile(fullPath.c_str(), &(status.algoMetas.back())));
if (status.algoMetas.back().nRanks == comm->nRanks) {
if(status.algoMetas.back().nChannels <= maxNchannels) {