msccl: print stack and memory usage (#723)

* msccl: print stack and memory usage

* Update number of kernels calculation
이 커밋은 다음에 포함됨:
Wenkai Du
2023-04-14 14:59:03 -07:00
커밋한 사람 GitHub
부모 53c1c38f0e
커밋 4b09ffba43
3개의 변경된 파일과 21개의 추가작업 그리고 1개의 파일을 삭제
+1 -1
파일 보기
@@ -172,7 +172,7 @@ ncclResult_t mscclInit(ncclComm_t comm) {
mscclInitialized.store(true, std::memory_order_release);
}
INFO(NCCL_INIT, "MSCCL: Initialization finished");
INFO(NCCL_INIT, "MSCCL: Initialization finished, localSize %ld", mscclKernMaxLocalSize());
return ncclSuccess;
}
+18
파일 보기
@@ -85,6 +85,7 @@ ncclResult_t mscclSetupConnections(struct mscclAlgo* hostAlgo, ncclComm_t comm)
NCCLCHECK(ncclTransportP2pSetup(comm, NULL, 0));
mscclClearIsCallerFlag();
INFO(NCCL_INIT, "MSCCL: Setup connections finished, used %ld", allocTracker[comm->cudaDev].totalAllocSize);
return ncclSuccess;
}
@@ -288,3 +289,20 @@ ncclResult_t mscclSetupKernel(const void* sendBuff, void* recvBuff, size_t count
status.lastStream = stream;
return ncclSuccess;
}
// Determine the maximum kernel stack size of all MSCCL kernels
size_t mscclKernMaxLocalSize() {
ncclResult_t res = ncclSuccess;
int numMscclKerns = sizeof(mscclKernelEntries)/sizeof(void *);
hipFuncAttributes attr = {0};
size_t max = 0;
for (int i = 0; i < numMscclKerns; i++) {
if (mscclKernelEntries[i] != nullptr) {
CUDACHECKGOTO(hipFuncGetAttributes(&attr, reinterpret_cast<const void*>(mscclKernelEntries[i])), res, error);
if (attr.localSizeBytes > max) max = attr.localSizeBytes;
}
}
error:
return (res != ncclSuccess) ? 0 : max;
}