Add proxyTrace (#1732)

This feature tracks the proxy events and status of each send/recv op. ProxyTrace keeps a fixed number of active ops in host mem and dumps the status of each op when the program crashes or hangs.
This commit is contained in:
Dingming Wu
2025-06-25 21:01:34 -07:00
committed by GitHub
parent 568777a9bf
commit 020dcf0a7c
11 changed files with 693 additions and 2 deletions
+11 -1
View File
@@ -139,11 +139,16 @@ static inline int ncclFuncTrafficPerByte(ncclFunc_t func, int nRanks) {
}
}
RCCL_PARAM_DECLARE(EnableProxyTrace);
/*****************************************************************************/
/* Launch system : synchronization and CUDA kernel launch */
/*****************************************************************************/
static ncclResult_t addProxyOpIfNeeded(struct ncclComm* comm, struct ncclKernelPlan* plan, struct ncclProxyOp* op) {
bool needed = true;
if (rcclParamEnableProxyTrace()) {
op->traceKey.commHash = comm->commHash;
op->traceKey.opCount = comm->opCount;
}
NCCLCHECK(ncclProxySaveOp(comm, op, &needed));
if (needed) {
struct ncclProxyOp* q = ncclMemoryPoolAlloc<struct ncclProxyOp>(&comm->memPool_ncclProxyOp, &comm->memPermanent);
@@ -1030,6 +1035,9 @@ static ncclResult_t addP2pToPlan(
op->rank = comm->rank;
op->eActivationMask = p2pTasks[dir] ? p2pTasks[dir]->eActivationMask : 0;
op->connIndex = connIndex[dir];
if (rcclParamEnableProxyTrace()) {
op->coll = dir ? ncclFuncSend : ncclFuncRecv;
}
// The following are modified per channel part in addWorkToChannels():
// op->buffer, op->nbytes, op->nsteps = ...;
}
@@ -1052,7 +1060,9 @@ static ncclResult_t addP2pToPlan(
int nParts = dir ? work->nSendChannels : work->nRecvChannels;
void* addr = dir ? work->sendAddr : work->recvAddr;
size_t bytes = dir ? work->sendBytes : work->recvBytes;
if (rcclParamEnableProxyTrace()) {
proxyOps[dir].totalBytes = bytes;
}
proxyOps[dir].recvbuff = nullptr;
if (nParts <= part) {
proxyOps[dir].nsteps = 0;