Fix MSCCL proxy number of chunks calculation (#821)

Current number of transmissions parsed from MSCCL algorithm is 1-based value,
but when calculating proxy number of chunks, it's taken as 0-based value.
This commit fixes this issue.

[ROCm/rccl commit: f7dc7b7e6a]
Cette révision appartient à :
Ziyue Yang
2023-07-27 04:24:49 +08:00
révisé par GitHub
Parent d80fba94e9
révision 9d9dcd23ce
2 fichiers modifiés avec 3 ajouts et 3 suppressions
+1 -1
Voir le fichier
@@ -658,7 +658,7 @@ ncclResult_t mscclGetAlgoFromXmlFile(const char* str, struct mscclAlgo* algo, in
// finish up mscclChannel calculation // finish up mscclChannel calculation
for (int c = 0; c < MSCCL_MAX_COUNT; c++) { for (int c = 1; c <= MSCCL_MAX_COUNT; c++) {
struct mscclChannelPeerInfo* sendPeer = &mscclChannel->sendPeerInfo[mscclChannel->nSendPeers]; struct mscclChannelPeerInfo* sendPeer = &mscclChannel->sendPeerInfo[mscclChannel->nSendPeers];
if (sendPeer->nTransmissionsOfCount[c] > 0) { if (sendPeer->nTransmissionsOfCount[c] > 0) {
sendPeer->existingCounts[sendPeer->nExistingCounts] = c; sendPeer->existingCounts[sendPeer->nExistingCounts] = c;
+2 -2
Voir le fichier
@@ -118,7 +118,7 @@ ncclResult_t mscclSetupProxy(struct mscclAlgo* hostAlgo, ncclComm_t comm) {
int nRecvs = 0; int nRecvs = 0;
for (int j = 0; j < recvPeer->nExistingCounts; j++){ for (int j = 0; j < recvPeer->nExistingCounts; j++){
int c = recvPeer->existingCounts[j]; int c = recvPeer->existingCounts[j];
int nStepsInCount = DIVUP(c+1, status.maxAllowedCount); int nStepsInCount = DIVUP(c, status.maxAllowedCount);
nRecvs += recvPeer->nTransmissionsOfCount[c] * nStepsInCount; nRecvs += recvPeer->nTransmissionsOfCount[c] * nStepsInCount;
} }
proxyOp.nsteps = nLoopsChunkSteps * nRecvs; proxyOp.nsteps = nLoopsChunkSteps * nRecvs;
@@ -131,7 +131,7 @@ ncclResult_t mscclSetupProxy(struct mscclAlgo* hostAlgo, ncclComm_t comm) {
int nSends = 0; int nSends = 0;
for (int j = 0; j < sendPeer->nExistingCounts; j++){ for (int j = 0; j < sendPeer->nExistingCounts; j++){
int c = sendPeer->existingCounts[j]; int c = sendPeer->existingCounts[j];
int nStepsInCount = DIVUP(c+1, status.maxAllowedCount); int nStepsInCount = DIVUP(c, status.maxAllowedCount);
nSends += sendPeer->nTransmissionsOfCount[c] * nStepsInCount; nSends += sendPeer->nTransmissionsOfCount[c] * nStepsInCount;
} }
proxyOp.nsteps = nLoopsChunkSteps * nSends; proxyOp.nsteps = nLoopsChunkSteps * nSends;