From dbcba2923b95423e6f7e8f572386cc806fd9f864 Mon Sep 17 00:00:00 2001 From: Wenkai Du <43822138+wenkaidu@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:06:49 -0700 Subject: [PATCH] Use parallel init of LDS and adjust P2P channels for gfx94x (#943) * Use parallel init of LDS and adjust P2P channels for gfx94x * Move another init to parallel * Fix NCCL_NCHANNELS_PER_PEER setting --- src/collectives/device/common.h | 34 ++++++++++++++++++++------------- src/graph/paths.cc | 13 ++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/collectives/device/common.h b/src/collectives/device/common.h index 77da1ded1d..4acd171f43 100644 --- a/src/collectives/device/common.h +++ b/src/collectives/device/common.h @@ -468,17 +468,10 @@ templatenodes[GPU].nodes[peer].paths[GPU]+g; if (path->type == PATH_NVL) { - if (ncclParamNChannelsPerPeer() == -2) { - float nvlBw = ncclTopoXGMISpeed(system->nodes[GPU].nodes[g].gpu.gcn); - *nChannels = 2*std::max(1, (int)(path->bw / nvlBw)); - } else { - *nChannels = ncclParamNChannelsPerPeer(); - } + float nvlBw = ncclTopoXGMISpeed(system->nodes[GPU].nodes[g].gpu.gcn); + *nChannels = (IsArchMatch(system->nodes[GPU].nodes[0].gpu.gcn, "gfx94") ? 4 : 2)*std::max(1, (int)(path->bw / nvlBw)); } else { *nChannels = 2; } @@ -816,10 +812,9 @@ ncclResult_t ncclTopoComputeP2pChannels(struct ncclComm* comm) { // Adjust P2P channels on Rome comm->p2pnChannelsPerPeer = 2; comm->p2pnChannels = 2; - } - else { + } else { // Round to next pow2 nChannelsPerPeer and nChannels - comm->p2pnChannelsPerPeer = nextPow2(minChannels); + comm->p2pnChannelsPerPeer = (ncclParamNChannelsPerPeer() == -2 ? nextPow2(minChannels) : ncclParamNChannelsPerPeer()); comm->p2pnChannels = nextPow2(comm->p2pnChannels); }