Rail optimization for rings (#1140)

- Modifies the ring creation algorithm to be friendlier to rail-optimized topologies (should not affect classic fabric topologies)

[ROCm/rccl commit: 4cb62f999a]
This commit is contained in:
gilbertlee-amd authored and GitHub committed 2024-04-15 12:03:57 -06:00
1 parent 8ddb74e3b1
commit 422a7ffcbb
11 files changed
+296 -69

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@
DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
for i in {0..81}
for i in {0..82}
do
if [[ $i -eq 50 ]] || [[ $i -eq 51 ]]
then
@@ -158,6 +158,7 @@ NodeModelDesc model_descs[] = {
{2, "topo_8p_940vm.xml", "2 nodes gfx940 VM"},
{2, "topo_8p_940_16n.xml", "2 nodes gfx940 16 NICs"},
{2, "topo_8p1h_6.xml", "2 nodes 8P1H Alt."},
{5, "topo_8p_940.xml", "5 nodes gfx940 8P"},
};
NCCL_PARAM(MaxCTAs, "MAX_CTAS", MAXCHANNELS);
+23
View File
@@ -823,6 +823,29 @@ ncclResult_t initTransportsRank_1(struct ncclComm* comm, struct allGatherInfo *a
// Determine local Nvls support
//NCCLCHECK(ncclNvlsInit(comm));
// [RCCL] Compute hostIdx (based on hostHash)
{
comm->topo->nHosts = 0;
for (int r = 0; r < nranks; r++) {
int isNewHost = 1;
// Check if this is the first time this hostname has been used
for (int i = 0; i < r && isNewHost; i++) {
if (comm->peerInfo[i].hostHash == comm->peerInfo[r].hostHash)
isNewHost = 0;
}
if (isNewHost)
{
// Check if this is the same hostname associated with this rank
if (comm->peerInfo[r].hostHash == comm->peerInfo[rank].hostHash)
{
comm->topo->hostIdx = comm->topo->nHosts;
printf("Rank %d is on host %d\n", rank, comm->topo->hostIdx);
}
comm->topo->nHosts++;
}
}
}
// Get rings and trees
ringGraph.id = 0;
ringGraph.pattern = NCCL_TOPO_PATTERN_RING;