Compiler warnings fix 2 (#1801)

* Changes to device code

* Changes to src/misc

* Changes to graph

* src/include changes

* src/transport changes

* changes in init, enqueue, proxy

* Changes to CMakeLists.txt

* Additional changes to device code

* Additional changes to net.cc

* adding 'compiler warning' tag to ease upstream merge'

* typo correction

* Addessing comments

* Additional changes for new commits

[ROCm/rccl commit: 3f8cac388e]
This commit is contained in:
Avinash
2025-08-05 17:36:23 -05:00
committed by GitHub
parent df3b7e477f
commit f34d760613
28 changed files with 104 additions and 106 deletions
+1 -5
View File
@@ -48,7 +48,6 @@ struct ARSMI_systemNode {
std::string s_card;
};
static const char *kPathDRMRoot = "/sys/class/drm";
static const char *kKFDNodesPathRoot = "/sys/class/kfd/kfd/topology/nodes";
static const uint32_t kAmdGpuId = 0x1002;
@@ -66,7 +65,6 @@ static thread_local int ARSMI_num_devices=-1;
int ARSMI_init(void)
{
std::string err_msg;
uint32_t count = 0;
std::multimap<uint64_t, ARSMI_systemNode> ARSMI_allSystemNodes;
if (ARSMI_num_devices > 0) {
@@ -101,7 +99,7 @@ int ARSMI_init(void)
int ret_loc_id = read_node_properties(node_id, "location_id", &location_id, properties);
int ret_domain = read_node_properties(node_id, "domain", &domain, properties);
int ret_vendor = read_node_properties(node_id, "vendor_id", &vendor_id, properties);
if (ret_gpu_id == 0 && ~(ret_unique_id != 0 || ret_loc_id != 0 || ret_unique_id != 0 || ret_vendor != 0) &&
if (ret_gpu_id == 0 && !(ret_unique_id != 0 || ret_loc_id != 0 || ret_domain != 0 || ret_vendor != 0) &&
(gpu_id != 0) && (vendor_id == kAmdGpuId)) {
// Do not try to build a node if one of these fields
// do not exist in KFD (0 as values okay)
@@ -194,7 +192,6 @@ int ARSMI_init(void)
// the order of each block.
for (auto i=0; i < first_elem.size(); i++) {
// Find the first_elem[i] in sort_vecs in
bool found = false;
for (auto j = 0; j < sort_vecs.size(); j++ ) {
if (first_elem[i] == sort_vecs[j][0].s_bdf) {
for (auto k=0; k<sort_vecs[j].size(); k++) {
@@ -226,7 +223,6 @@ int ARSMI_init(void)
continue;
}
uint64_t hops;
uint64_t type;
uint64_t weight;
uint64_t min_bandwidth;
@@ -30,7 +30,6 @@
RCCL_PARAM(MscclEnabled, "MSCCL_ENABLE", 1);
RCCL_PARAM(MscclForceEnabled, "MSCCL_FORCE_ENABLE", 0);
RCCL_PARAM(MscclEnableSingleProcess, "MSCCL_ENABLE_SINGLE_PROCESS", 1);
static const char* mscclAlgoFilePathEnv = "MSCCL_ALGO_FILE_PATH";
bool mscclEnabled() {
#ifdef COMPILE_MSCCL_KERNEL
@@ -708,7 +708,6 @@ ncclResult_t mscclXmlLoadSingleNode(FILE* file, struct mscclXmlNode* node) {
}
ncclResult_t mscclAlgoMetaXmlLoad(const char* xmlFilePath, struct mscclXmlNode* node) {
ncclResult_t ret = ncclSuccess;
FILE* file = fopen(xmlFilePath, "r");
if (file == NULL) {
fprintf(stderr, "Could not open MSCCL XML algorithm file %s : %s", xmlFilePath, strerror(errno));
@@ -720,7 +719,6 @@ ncclResult_t mscclAlgoMetaXmlLoad(const char* xmlFilePath, struct mscclXmlNode*
}
ncclResult_t mscclGetAlgoMetaFromXmlFile(const char* str, struct mscclAlgoMeta* algoMeta) {
ncclResult_t ret = ncclSuccess;
struct mscclXmlNode* node;
node = (struct mscclXmlNode *)malloc(sizeof(struct mscclXmlNode));
NCCLCHECK(mscclAlgoMetaXmlLoad(str, node));
@@ -123,7 +123,6 @@ ncclResult_t mscclSetupConnections(struct mscclAlgo* hostAlgo, ncclComm_t comm)
static ncclResult_t mscclSetupProxyImpl(struct mscclAlgo* hostAlgo, ncclComm_t comm) {
mscclStatus& status = mscclGetStatus(comm);
mscclThreadLocalStatus& threadLocalStatus = mscclGetThreadLocalStatus();
struct ncclProxyOp proxyOp = {};
proxyOp.connIndex = 0;
proxyOp.sliceSteps = status.sliceSteps;
@@ -147,8 +147,8 @@ std::string facebook_rccl::ProxyTrace::dump(uint64_t commHash) {
sortedDumpStrMap[traceKey.str()] = proxyOpMap.second.str();
}
}
for (const auto &[keyStr, proxyOpStr] : sortedDumpStrMap) {
result += proxyOpStr;
for (const auto &pair : sortedDumpStrMap) {
result += pair.second; //proxyOpStr
}
return result;
}
@@ -159,22 +159,22 @@ std::string facebook_rccl::ProxyTrace::dump() {
// maps serialized key to serliazed proxyOp; sorted by key
std::map<std::string, std::string> sortedDumpStrMap;
for (auto &[commHash, opCountMap] : activeOps) {
for (auto &[opCount, proxyOpMap] : opCountMap) {
for (auto &[opId, opEntry] : proxyOpMap) {
ProxyTraceRecordKey traceKey = {commHash, opCount, opId};
opEntry.computeStatus();
sortedDumpStrMap[traceKey.str()] = opEntry.str();
for (auto &commHash_opCountMap : activeOps) {
for (auto &opCount_proxyOpMap : commHash_opCountMap.second /*opCountMap*/) {
for (auto &opId_opEntry : opCount_proxyOpMap.second/*proxyOpMap*/) {
ProxyTraceRecordKey traceKey = {commHash_opCountMap.first, opCount_proxyOpMap.first, opId_opEntry.first};
opId_opEntry.second.computeStatus();
sortedDumpStrMap[traceKey.str()] = opId_opEntry.second.str();
}
}
}
// add the recent finished ops as well
for (const auto &[keyStr, proxyOpStr] : finishedOps) {
sortedDumpStrMap[keyStr] = proxyOpStr;
for (const auto &keyStr_proxyOpStr : finishedOps) {
sortedDumpStrMap[keyStr_proxyOpStr.first] = keyStr_proxyOpStr.second;
}
for (const auto &[keyStr, proxyOpStr] : sortedDumpStrMap) {
result += proxyOpStr;
for (const auto &keyStr_proxyOpStr : sortedDumpStrMap) {
result += keyStr_proxyOpStr.second;
}
return result;
}
@@ -207,15 +207,15 @@ std::string facebook_rccl::ProxyTraceOp::str() {
float facebook_rccl::ProxyTrace::getMapSizeMB() const {
float size = 0;
for (const auto &[commHash, opCountMap] : activeOps) {
for (const auto &[opCount, proxyOpMap] : opCountMap) {
size += proxyOpMap.size() *
for (const auto &commHash_opCountMap : activeOps) {
for (const auto &opCount_proxyOpMap : commHash_opCountMap.second) {
size += opCount_proxyOpMap.second.size() *
(sizeof(ProxyTraceOp) +
sizeof(std::unique_ptr<facebook_rccl::ProxyTraceOp>));
}
}
for (const auto &[keyStr, proxyOpStr] : finishedOps) {
size += keyStr.size() + proxyOpStr.size();
for (const auto &keyStr_proxyOpStr : finishedOps) {
size += keyStr_proxyOpStr.first.size() + keyStr_proxyOpStr.second.size();
}
return size / 1024.0 / 1024.0;
}
+1 -1
View File
@@ -40,8 +40,8 @@ rcclApiCall::rcclApiCall(rcclCall_t type, const ncclInfo& info)://name(rcclCallS
datatype(info.datatype),
op(info.op),
root(info.root),
comm(info.comm),
nRanks(info.comm->nRanks),
comm(info.comm),
stream(info.stream),
nTasks(info.comm->planner.nTasksP2p + info.comm->planner.nTasksColl),
globalRank(info.comm->localRankToRank[info.comm->localRank])
+2 -1
View File
@@ -663,8 +663,9 @@ ncclResult_t ncclSocketReady(struct ncclSocket* sock, int *running) {
}
ncclResult_t ncclSocketConnect(struct ncclSocket* sock) {
#ifdef ENABLE_TRACE
char line[SOCKET_NAME_MAXLEN+1];
#endif
if (sock == NULL) {
WARN("ncclSocketConnect: pass NULL socket");
return ncclInvalidArgument;