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.
Cette révision appartient à :
Ziyue Yang
2023-07-27 04:24:49 +08:00
révisé par GitHub
Parent 420f8af6a0
révision f7dc7b7e6a
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
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];
if (sendPeer->nTransmissionsOfCount[c] > 0) {
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;
for (int j = 0; j < recvPeer->nExistingCounts; j++){
int c = recvPeer->existingCounts[j];
int nStepsInCount = DIVUP(c+1, status.maxAllowedCount);
int nStepsInCount = DIVUP(c, status.maxAllowedCount);
nRecvs += recvPeer->nTransmissionsOfCount[c] * nStepsInCount;
}
proxyOp.nsteps = nLoopsChunkSteps * nRecvs;
@@ -131,7 +131,7 @@ ncclResult_t mscclSetupProxy(struct mscclAlgo* hostAlgo, ncclComm_t comm) {
int nSends = 0;
for (int j = 0; j < sendPeer->nExistingCounts; j++){
int c = sendPeer->existingCounts[j];
int nStepsInCount = DIVUP(c+1, status.maxAllowedCount);
int nStepsInCount = DIVUP(c, status.maxAllowedCount);
nSends += sendPeer->nTransmissionsOfCount[c] * nStepsInCount;
}
proxyOp.nsteps = nLoopsChunkSteps * nSends;