Gcn arch name (#886)
We use CMake to determine if we're compiling against a version of ROCm that supports gcnArchName and handles architecture checking appropriately. It includes a few helper functions as drop ins for the functionality we used gcnArch for before; sometimes to enable flags, and sometimes to set frequencies.
This commit is contained in:
+8
-1
@@ -369,7 +369,14 @@ ncclResult_t ncclTopoAddNic(struct ncclXmlNode* xmlNic, struct ncclTopoSystem* s
|
||||
|
||||
ncclResult_t ncclTopoAddGpu(struct ncclXmlNode* xmlGpu, struct ncclTopoSystem* system, struct ncclTopoNode* gpu) {
|
||||
NCCLCHECK(xmlGetAttrInt(xmlGpu, "sm", &gpu->gpu.cudaCompCap));
|
||||
NCCLCHECK(xmlGetAttrInt(xmlGpu, "gcn", &gpu->gpu.gcn));
|
||||
NCCLCHECK(xmlGetAttr(xmlGpu, "gcn", &gpu->gpu.gcn));
|
||||
if (strcmp(gpu->gpu.gcn, "906") == 0) {
|
||||
gpu->gpu.gcn = "gfx906";
|
||||
} else if (strcmp(gpu->gpu.gcn, "908") == 0) {
|
||||
gpu->gpu.gcn = "gfx908";
|
||||
} else if (strcmp(gpu->gpu.gcn, "910") == 0) {
|
||||
gpu->gpu.gcn = "gfx90a";
|
||||
}
|
||||
rcclHipDeviceArch_t arch;
|
||||
NCCLCHECK(xmlGetAttrInt(xmlGpu, "arch", &arch.value));
|
||||
memcpy(&gpu->gpu.arch, &arch.arch, sizeof(hipDeviceArch_t));
|
||||
|
||||
+10
-12
@@ -10,6 +10,8 @@
|
||||
|
||||
#include "graph.h"
|
||||
#include "core.h"
|
||||
#include "archinfo.h"
|
||||
#include <string.h>
|
||||
|
||||
#define LOC_BW 5000.0
|
||||
#define SM60_NVLINK_BW 18.0
|
||||
@@ -123,7 +125,7 @@ struct ncclTopoNode {
|
||||
int rank;
|
||||
int cudaCompCap;
|
||||
int gdrSupport;
|
||||
int gcn;
|
||||
const char* gcn;
|
||||
hipDeviceArch_t arch;
|
||||
}gpu;
|
||||
struct {
|
||||
@@ -224,17 +226,13 @@ static ncclResult_t ncclTopoDevToRank(struct ncclTopoSystem* system, int dev, in
|
||||
}
|
||||
|
||||
// Returns XGMI speed in GB/s
|
||||
static float ncclTopoXGMISpeed(int gcn) {
|
||||
switch (gcn) {
|
||||
case 910:
|
||||
return MI200_XGMI_WIDTH;
|
||||
case 940:
|
||||
case 941:
|
||||
case 942:
|
||||
return GFX94X_XGMI_WIDTH;
|
||||
default:
|
||||
return VEGA_XGMI_WIDTH;
|
||||
}
|
||||
static float ncclTopoXGMISpeed(const char* gcn) {
|
||||
if (IsArchMatch(gcn, "gfx90a"))
|
||||
return MI200_XGMI_WIDTH;
|
||||
else if (IsArchMatch(gcn, "gfx94"))
|
||||
return GFX94X_XGMI_WIDTH;
|
||||
else
|
||||
return VEGA_XGMI_WIDTH;
|
||||
}
|
||||
|
||||
#if ENABLE_COLLTRACE
|
||||
|
||||
+1
-1
@@ -455,7 +455,7 @@ ncclResult_t ncclTopoTuneModel(struct ncclComm* comm, int minCompCap, int maxCom
|
||||
#if defined(ENABLE_LL128)
|
||||
// Enable LL128 by default only on gfx90a with available tuning table
|
||||
pEnable = (graphs[a]->typeInter <= PATH_PXB) && graphs[a]->typeIntra <= PATH_NVL &&
|
||||
(comm->topo->nodes[GPU].nodes[0].gpu.gcn == 910 && comm->topo->ll128Enabled) ? 1 : 0;
|
||||
(IsArchMatch(comm->topo->nodes[GPU].nodes[0].gpu.gcn, "gfx90a") && comm->topo->ll128Enabled) ? 1 : 0;
|
||||
#else
|
||||
pEnable = 0;
|
||||
#endif
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "nvmlwrap.h"
|
||||
#include "xml.h"
|
||||
#include "rocm_smi_wrap.h"
|
||||
#include "archinfo.h"
|
||||
|
||||
/*******************/
|
||||
/* XML File Parser */
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "debug.h"
|
||||
#include "checks.h"
|
||||
#include <stdlib.h>
|
||||
#include "archinfo.h"
|
||||
|
||||
// A few constraints to make the implementation easy
|
||||
#define MAX_STR_LEN 255
|
||||
|
||||
Reference in New Issue
Block a user