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]
Cette révision appartient à :
gilbertlee-amd
2024-04-15 12:03:57 -06:00
révisé par GitHub
Parent 8ddb74e3b1
révision 422a7ffcbb
11 fichiers modifiés avec 296 ajouts et 69 suppressions
+23
Voir le fichier
@@ -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;