(cherry picked from commit 94da229a7788d74685d1591a4e75a8341de64f41)
Этот коммит содержится в:
+25
-29
@@ -700,36 +700,32 @@ ncclResult_t ncclTopoTrimSystem(struct ncclTopoSystem* system, struct ncclComm*
|
||||
} while (system->nodes[NET].count);
|
||||
|
||||
int remove = 1;
|
||||
int arch, vendor, model;
|
||||
NCCLCHECK(ncclTopoCpuType(system, &arch, &vendor, &model));
|
||||
if (arch == NCCL_TOPO_CPU_ARCH_X86 && vendor == NCCL_TOPO_CPU_VENDOR_AMD
|
||||
&& model == NCCL_TOPO_CPU_TYPE_ROME) {
|
||||
int gdr = 1;
|
||||
bool allXgmi = true;
|
||||
// detect if all GPUs are connected by XGMI
|
||||
for (int i = 0; i < system->nodes[GPU].count && allXgmi; i++) {
|
||||
int cudaDev1 = system->nodes[GPU].nodes[i].gpu.dev;
|
||||
for (int j = 0; j < system->nodes[GPU].count && allXgmi; j++) {
|
||||
if (i == j) continue;
|
||||
int cudaDev2 = system->nodes[GPU].nodes[j].gpu.dev;
|
||||
bool isXGMI;
|
||||
NCCLCHECK(ncclTopoGetLinkType(comm->topo, cudaDev1, cudaDev2, &isXGMI));
|
||||
allXgmi &= isXGMI;
|
||||
}
|
||||
}
|
||||
if (allXgmi) system->type |= RCCL_TOPO_XGMI_ALL;
|
||||
for (int g = 0; g < system->nodes[GPU].count; g++) {
|
||||
int net;
|
||||
NCCLCHECK(ncclTopoGetLocalNet(system, system->nodes[GPU].nodes[g].gpu.rank, 0, &net));
|
||||
NCCLCHECK(ncclTopoCheckGdr(system, system->nodes[GPU].nodes[g].id, net, 1, &gdr));
|
||||
if (!gdr) break;
|
||||
}
|
||||
if (gdr && !allXgmi) {
|
||||
remove = 0;
|
||||
system->type |= RCCL_TOPO_GDR_ALL;
|
||||
INFO(NCCL_GRAPH, "GDR is available on all GPUs");
|
||||
int gdr = 1;
|
||||
bool allXgmi = true;
|
||||
// detect if all GPUs are connected by XGMI
|
||||
for (int i = 0; i < system->nodes[GPU].count && allXgmi; i++) {
|
||||
int cudaDev1 = system->nodes[GPU].nodes[i].gpu.dev;
|
||||
for (int j = 0; j < system->nodes[GPU].count && allXgmi; j++) {
|
||||
if (i == j) continue;
|
||||
int cudaDev2 = system->nodes[GPU].nodes[j].gpu.dev;
|
||||
bool isXGMI;
|
||||
NCCLCHECK(ncclTopoGetLinkType(comm->topo, cudaDev1, cudaDev2, &isXGMI));
|
||||
allXgmi &= isXGMI;
|
||||
}
|
||||
}
|
||||
if (allXgmi) system->type |= RCCL_TOPO_XGMI_ALL;
|
||||
for (int g = 0; g < system->nodes[GPU].count; g++) {
|
||||
int net;
|
||||
NCCLCHECK(ncclTopoGetLocalNet(system, system->nodes[GPU].nodes[g].gpu.rank, 0, &net));
|
||||
NCCLCHECK(ncclTopoCheckGdr(system, system->nodes[GPU].nodes[g].id, net, 1, &gdr));
|
||||
if (!gdr) break;
|
||||
}
|
||||
if (gdr && !allXgmi) {
|
||||
remove = 0;
|
||||
system->type |= RCCL_TOPO_GDR_ALL;
|
||||
INFO(NCCL_GRAPH, "GDR is available on all GPUs");
|
||||
}
|
||||
|
||||
if (rcclParamEnableIntranet()) {
|
||||
remove = 0;
|
||||
system->type |= RCCL_TOPO_FORCE_INTRA;
|
||||
@@ -812,7 +808,7 @@ ncclResult_t ncclTopoComputeP2pChannels(struct ncclComm* comm) {
|
||||
|
||||
int arch, vendor, model;
|
||||
NCCLCHECK(ncclTopoCpuType(comm->topo, &arch, &vendor, &model));
|
||||
if (arch == NCCL_TOPO_CPU_ARCH_X86 && vendor == NCCL_TOPO_CPU_VENDOR_INTEL) {
|
||||
if (arch == NCCL_TOPO_CPU_ARCH_X86 && vendor == NCCL_TOPO_CPU_VENDOR_INTEL && !(comm->topo->type & RCCL_TOPO_XGMI_ALL)) {
|
||||
// Adjust P2P channels on Intel platform
|
||||
comm->p2pnChannelsPerPeer = 1;
|
||||
comm->p2pnChannels = 2;
|
||||
|
||||
@@ -578,6 +578,32 @@ static struct rcclRomeModel rome_model_76 = {
|
||||
.treeBase = "",
|
||||
};
|
||||
|
||||
static struct rcclRomeModel rome_model_79 = {
|
||||
.nGpus = 8, .nCpus = 2, .nNics = 0, .nLinks = 7,
|
||||
.gpuIds = { 0x1d000, 0x2e000, 0x3f000, 0x61000, 0x9f000, 0xaf000, 0xbf000, 0xdf000, },
|
||||
.nicIds = { },
|
||||
.gpuNuma = { 0, 0, 0, 0, 1, 1, 1, 1, },
|
||||
.nicNuma = { },
|
||||
.connMatrix = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, },
|
||||
.gdrLevel = { },
|
||||
.pattern = "4040",
|
||||
.ringBase = "0 1 2 3 4 5 6 7|0 1 2 3 4 5 7 6|0 2 4 1 3 6 5 7|0 2 4 6 1 7 3 5|0 3 1 5 2 7 4 6|0 3 5 1 6 2 7 4|0 4 1 7 3 6 2 5|7 6 5 4 3 2 1 0|6 7 5 4 3 2 1 0|7 5 6 3 1 4 2 0|5 3 7 1 6 4 2 0|6 4 7 2 5 1 3 0|4 7 2 6 1 5 3 0|5 2 6 3 7 1 4 0",
|
||||
.options = "noCpuCheck=1",
|
||||
};
|
||||
|
||||
static struct rcclRomeModel rome_model_80 = {
|
||||
.nGpus = 4, .nCpus = 4, .nNics = 4, .nLinks = 3,
|
||||
.gpuIds = { 0x82000, 0xc2000, 0x2000, 0x42000, },
|
||||
.nicIds = { 0x81000, 0xc1000, 0x1000, 0x41000, },
|
||||
.gpuNuma = { 2, 3, 0, 1, },
|
||||
.nicNuma = { 2, 3, 0, 1, },
|
||||
.connMatrix = { 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, },
|
||||
.gdrLevel = { PATH_PHB, PATH_SYS, PATH_SYS, PATH_SYS, PATH_SYS, PATH_PHB, PATH_SYS, PATH_SYS, PATH_SYS, PATH_SYS, PATH_PHB, PATH_SYS, PATH_SYS, PATH_SYS, PATH_SYS, PATH_PHB, },
|
||||
.pattern = "11111111",
|
||||
.ringBase = "N2 2 3 0 1 N1|N0 0 1 3 2 N2|N0 0 2 1 3 N3|N3 3 1 0 2 N2|N3 3 1 2 0 N0|N1 1 0 3 2 N2|N1 1 2 3 0 N0|N2 2 0 1 3 N3|N3 3 0 2 1 N1|N2 2 3 1 0 N0|N1 1 2 0 3 N3|N0 0 3 2 1 N1",
|
||||
.options = "",
|
||||
};
|
||||
|
||||
static struct rcclRomeModel romeTopoModels[] = {
|
||||
rome_model_22,
|
||||
rome_model_25,
|
||||
@@ -617,6 +643,8 @@ static struct rcclRomeModel romeTopoModels[] = {
|
||||
rome_model_73,
|
||||
rome_model_74,
|
||||
rome_model_76,
|
||||
rome_model_79,
|
||||
rome_model_80,
|
||||
};
|
||||
|
||||
/* Parse user defined rings. Format is like :
|
||||
@@ -850,7 +878,7 @@ static void parseOptions(struct ncclTopoSystem* system, const char *options) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool disableNumaMatching(const char *options) {
|
||||
static bool checkOption(const char *options, const char *name) {
|
||||
if (strcmp(options, "")) {
|
||||
char *str_temp = (char *)malloc(strlen(options) + 1);
|
||||
strcpy(str_temp, options);
|
||||
@@ -862,7 +890,7 @@ static bool disableNumaMatching(const char *options) {
|
||||
while (tokens[numTokens-1] != NULL && numTokens < MAX_OPT_TOKENS)
|
||||
tokens[numTokens++] = strtok_r(NULL, "=, ", &state);
|
||||
for (int i = 0; i < numTokens/2; i++) {
|
||||
if (strcmp(tokens[i*2], "disableNumaMatching") == 0) {
|
||||
if (strcmp(tokens[i*2], name) == 0) {
|
||||
return (bool)atol(tokens[i*2+1]);
|
||||
}
|
||||
}
|
||||
@@ -1202,8 +1230,6 @@ ncclResult_t parseRome4P2H(struct ncclTopoSystem* system, struct ncclTopoGraph*
|
||||
// only valid on Rome
|
||||
int arch, vendor, model;
|
||||
NCCLCHECK(ncclTopoCpuType(system, &arch, &vendor, &model));
|
||||
if (arch != NCCL_TOPO_CPU_ARCH_X86 || vendor != NCCL_TOPO_CPU_VENDOR_AMD || model != NCCL_TOPO_CPU_TYPE_ROME)
|
||||
return ncclSuccess;
|
||||
|
||||
// number of GPUs and NICs on each numa node is used as first screening pattern
|
||||
struct rcclRomeModel romeTopo;
|
||||
@@ -1229,7 +1255,10 @@ ncclResult_t parseRome4P2H(struct ncclTopoSystem* system, struct ncclTopoGraph*
|
||||
if (i < romeTopo.nGpus) match_nbio = false;
|
||||
|
||||
for (i = 0; i < sizeof(romeTopoModels)/sizeof(romeTopoModels[0]); i++) {
|
||||
bool ignore_numa = disableNumaMatching(romeTopoModels[i].options);
|
||||
bool ignore_cpu = checkOption(romeTopoModels[i].options, "noCpuCheck");
|
||||
if (!ignore_cpu && (arch != NCCL_TOPO_CPU_ARCH_X86 || vendor != NCCL_TOPO_CPU_VENDOR_AMD || model != NCCL_TOPO_CPU_TYPE_ROME))
|
||||
continue;
|
||||
bool ignore_numa = checkOption(romeTopoModels[i].options, "disableNumaMatching");
|
||||
if (!ignore_numa && romeTopo.nCpus != romeTopoModels[i].nCpus) continue;
|
||||
if (romeTopo.nGpus != romeTopoModels[i].nGpus ||
|
||||
romeTopo.nNics != romeTopoModels[i].nNics || romeTopo.nLinks != romeTopoModels[i].nLinks) continue;
|
||||
@@ -1501,7 +1530,8 @@ ncclResult_t parse4H4P(struct ncclTopoSystem* system, struct ncclTopoGraph* grap
|
||||
}
|
||||
}
|
||||
INFO(NCCL_GRAPH, "%s", line);
|
||||
system->type |= RCCL_TOPO_4P2H_ROME;
|
||||
if (arch == NCCL_TOPO_CPU_ARCH_X86 && vendor == NCCL_TOPO_CPU_VENDOR_AMD && model == NCCL_TOPO_CPU_TYPE_ROME)
|
||||
system->type |= RCCL_TOPO_4P2H_ROME;
|
||||
parseOptions(system, rome_model_68.options);
|
||||
// create 4P4H based on reference and remapped ids
|
||||
NCCLCHECK(parseGraph(rome_model_68.ringBase, system, graph, g_hives, n_hives));
|
||||
|
||||
@@ -837,8 +837,8 @@ ncclResult_t ncclTopoGetXmlFromGraphs(int ngraphs, struct ncclTopoGraph** graphs
|
||||
}
|
||||
|
||||
#if defined(__HIP_PLATFORM_HCC__) || defined(__HCC__) || defined(__HIPCC__)
|
||||
float speedArrayIntra[] = { 24.0, 20.0, 18.0, 15.0, 12.0, 10.0, 9.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.4, 1.2, 0.24, 0.12 };
|
||||
float speedArrayInter[] = { 24.0, 20.0, 18.0, 15.0, 12.0, 10.0, 9.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.4, 1.2, 0.24, 0.12 };
|
||||
float speedArrayIntra[] = { 48.0, 24.0, 20.0, 18.0, 15.0, 12.0, 10.0, 9.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.4, 1.2, 0.24, 0.12 };
|
||||
float speedArrayInter[] = { 48.0, 24.0, 20.0, 18.0, 15.0, 12.0, 10.0, 9.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.4, 1.2, 0.24, 0.12 };
|
||||
#define NSPEEDSINTRA (sizeof(speedArrayIntra)/sizeof(float))
|
||||
#define NSPEEDSINTER (sizeof(speedArrayInter)/sizeof(float))
|
||||
#else
|
||||
@@ -890,7 +890,9 @@ ncclResult_t ncclTopoCompute(ncclTopoSystem* system, struct ncclTopoGraph* graph
|
||||
if (str) {
|
||||
// user supplied topo
|
||||
NCCLCHECK(parseGraph(str, system, graph, NULL, NULL));
|
||||
if (graph->nChannels) {
|
||||
int arch, vendor, model;
|
||||
NCCLCHECK(ncclTopoCpuType(system, &arch, &vendor, &model));
|
||||
if (graph->nChannels && arch == NCCL_TOPO_CPU_ARCH_X86 && vendor == NCCL_TOPO_CPU_VENDOR_AMD && model == NCCL_TOPO_CPU_TYPE_ROME) {
|
||||
system->type |= RCCL_TOPO_4P2H_ROME;
|
||||
}
|
||||
} else if (!rcclParamModelMatchingDisable() && !graph->collNet) {
|
||||
|
||||
@@ -380,7 +380,7 @@ ncclResult_t ncclTopoAddGpu(struct ncclXmlNode* xmlGpu, struct ncclTopoSystem* s
|
||||
return ncclSuccess;
|
||||
}
|
||||
|
||||
struct kvDict kvDictPciClass[] = { { "0x060400", PCI }, { "0x068000", NVS }, { "0x068001", CPU }, { "0x03", GPU }, { "0x02", NIC }, { NULL, PCI /* Default fallback value */ } };
|
||||
struct kvDict kvDictPciClass[] = { { "0x060400", PCI }, { "0x068000", NVS }, { "0x068001", CPU }, { "0x03", GPU }, { "0x02", NIC }, { "0x120000", GPU }, { NULL, PCI /* Default fallback value */ } };
|
||||
struct kvDict kvDictPciGen[] = {
|
||||
{ "2.5 GT/s", 15 }, { "5 GT/s", 30 }, { "8 GT/s", 60 }, { "16 GT/s", 120 }, { "32 GT/s", 240 }, /* Kernel 5.6 and earlier */
|
||||
{ "2.5 GT/s PCIe", 15 }, { "5.0 GT/s PCIe", 30 }, { "8.0 GT/s PCIe", 60 }, { "16.0 GT/s PCIe", 120 }, { "32.0 GT/s PCIe", 240 }, { "64.0 GT/s PCIe", 480 },
|
||||
|
||||
+11
-1
@@ -27,6 +27,7 @@
|
||||
#define NET_BW 12.0 // 100Gbit
|
||||
#define VEGA_XGMI_WIDTH 24.0
|
||||
#define MI200_XGMI_WIDTH 36.0
|
||||
#define GFX94X_XGMI_WIDTH 48.0
|
||||
|
||||
// Intel CPU convert GPU P2P traffic into 64B PCI TLPs, so GPU
|
||||
// to GPU traffic consumes more PCI bandwidth.
|
||||
@@ -223,7 +224,16 @@ static ncclResult_t ncclTopoDevToRank(struct ncclTopoSystem* system, int dev, in
|
||||
|
||||
// Returns XGMI speed in GB/s
|
||||
static float ncclTopoXGMISpeed(int gcn) {
|
||||
return gcn == 910 ? MI200_XGMI_WIDTH : VEGA_XGMI_WIDTH;
|
||||
switch (gcn) {
|
||||
case 910:
|
||||
return MI200_XGMI_WIDTH;
|
||||
case 940:
|
||||
case 941:
|
||||
case 942:
|
||||
return GFX94X_XGMI_WIDTH;
|
||||
default:
|
||||
return VEGA_XGMI_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLE_COLLTRACE
|
||||
|
||||
Ссылка в новой задаче
Block a user