diff --git a/src/init.cc b/src/init.cc index 0805935207..512114fd05 100644 --- a/src/init.cc +++ b/src/init.cc @@ -1012,7 +1012,8 @@ static ncclResult_t initTransportsRank(struct ncclComm* comm, ncclUniqueId* comm // count NETs used by ring int nNets = 0; int nets[MAXCHANNELS*2]; - for (int i = 0; i < ringGraph.nChannels; i++) { + // do not count NETs in case of single node, i.e comm->topo->nodes[GPU].count == comm->topo->nRanks + for (int i = 0; comm->topo->nodes[GPU].count != comm->topo->nRanks && i < ringGraph.nChannels; i++) { for (int j = 0; j < 2; j++) { int k; for (k = 0; k < nNets; k++) diff --git a/tools/topo_expl/utils.cpp b/tools/topo_expl/utils.cpp index 3ea1e8a13c..a18cd3e590 100644 --- a/tools/topo_expl/utils.cpp +++ b/tools/topo_expl/utils.cpp @@ -604,7 +604,8 @@ ncclResult_t initTransportsRank_3(struct ncclComm* comm, struct allGather3Data_t // count NETs used by ring int nNets = 0; int nets[MAXCHANNELS*2]; - for (int i = 0; i < ringGraph.nChannels; i++) { + // do not count NETs in case of single node, i.e comm->topo->nodes[GPU].count == comm->topo->nRanks + for (int i = 0; comm->topo->nodes[GPU].count != comm->topo->nRanks && i < ringGraph.nChannels; i++) { for (int j = 0; j < 2; j++) { int k; for (k = 0; k < nNets; k++)