Adding ASAN changes to address memory leak issue" (#1170)
Co-authored-by: akolliasAMD <akollias@amd.com>
This commit is contained in:
+8
-3
@@ -848,11 +848,16 @@ ncclResult_t getLocalNetCountByBw(struct ncclTopoSystem* system, int gpu, int *c
|
||||
ncclResult_t ncclTopoGetLocalNet(struct ncclTopoSystem* system, int rank, int channelId, int* id) {
|
||||
int gpu;
|
||||
NCCLCHECK(ncclTopoRankToIndex(system, rank, &gpu));
|
||||
int* localNets;
|
||||
int* localNets = NULL;
|
||||
int localNetCount;
|
||||
NCCLCHECK(ncclTopoGetLocal(system, GPU, gpu, NET, &localNets, &localNetCount, NULL));
|
||||
int* localGpus;
|
||||
int* localGpus = NULL;
|
||||
int localGpuCount;
|
||||
if (localNetCount == 0) {
|
||||
*id = -1;
|
||||
free(localNets);
|
||||
return ncclSuccess;
|
||||
}
|
||||
NCCLCHECK(ncclTopoGetLocal(system, NET, localNets[0], GPU, &localGpus, &localGpuCount, NULL));
|
||||
int net = 0;
|
||||
for (int i = 0; i < localGpuCount; i++) {
|
||||
@@ -1000,4 +1005,4 @@ ncclResult_t ncclTopoGetCompCap(struct ncclTopoSystem* system, int* ccMin, int*
|
||||
if (ccMin) *ccMin = min;
|
||||
if (ccMax) *ccMax = max;
|
||||
return ncclSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user