Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make proxy dump print out more meaningful information. #1412

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/include/proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ struct ncclProxyOp {
uint8_t* sendbuff;
uint8_t* recvbuff;

int nextRank;
int prevRank;

union ncclProxyOpSpecifics specifics;

struct ncclProxyOp *enqNext;
Expand Down Expand Up @@ -129,6 +132,10 @@ struct ncclProxyArgs {
struct ncclProxyArgs** proxyAppendPtr;

union ncclProxyOpSpecifics specifics;

int prevRank;
int nextRank;
int send;
};
#define NCCL_MAX_NETDEVS 128

Expand Down
20 changes: 15 additions & 5 deletions src/proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,27 +243,30 @@ ncclResult_t getOpIndex(struct ncclProxyArgs* op, struct ncclProxyProgressState*
}

ncclResult_t printProxyOp(struct ncclProxyArgs* op, int poolIndex, int opIndex) {
printf("[%d-%d|%ld| %s", poolIndex, opIndex, op->opCount, op->pattern == ncclPatternSend ? "Send" : op->pattern == ncclPatternRecv ? "Recv" : "Coll");
int peer = op->send ? op->nextRank : op->prevRank;
int isColl = (op->pattern != ncclPatternSend && op->pattern != ncclPatternRecv);
printf("[%d-%d|%ld| %s", poolIndex, opIndex, op->opCount, isColl ? "Coll->" : "");
printf("%s", op->send ? "Send" : "Recv");
for (int s=0; s<op->nsubs; s++) {
struct ncclProxySubArgs* sub = op->subs+s;
if (op->state == ncclProxyOpProgress) {
char status = ' ';
if (op->pattern == ncclPatternRecv) {
if (! op->send) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's wrong with original "op->pattern == ncclPatternRecv" checking?

if (sub->posted < sub->nsteps && sub->posted < sub->done + NCCL_STEPS) status = 'I'; // Init
else if (sub->received < sub->posted) status = 'R'; // Receiving
else if (sub->received < sub->transmitted) status = 'R'; // Receiving
else if (sub->transmitted < sub->received) status = 'F'; // Flushing
else if (sub->done < sub->transmitted) status = 'G'; // Waiting on GPU
else status = 'D'; // Done
} else if (op->pattern == ncclPatternSend) {
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many "patterns". Why remove the original checking?

if (sub->posted < sub->nsteps && sub->posted < sub->done + NCCL_STEPS) status = 'I'; // Init
else if (sub->transmitted < sub->posted) status = 'G'; // Waiting on GPU
else if (sub->done < sub->transmitted) status = 'S'; // Sending
else status = 'D'; // Done
}
printf(" %d%c/%d", sub->peer, status, sub->channelId);
printf(" %d%c/%d", peer, status, sub->channelId);
} else {
printf(" %d/%d", sub->peer, sub->channelId);
printf(" %d/%d", peer, sub->channelId);
}
}
printf("]");
Expand Down Expand Up @@ -397,6 +400,9 @@ static ncclResult_t ncclProxyOpToArgs(struct ncclProxyOp* op, struct ncclProxyAr
args->state = ncclProxyOpReady;
args->progress = op->connection->tcomm->proxyProgress;
args->proxyAppendPtr = op->connection->proxyAppendPtr;
args->send = op->connection->send;
args->prevRank = op->prevRank;
args->nextRank = op->nextRank;
return ncclSuccess;
}

Expand Down Expand Up @@ -548,9 +554,13 @@ ncclResult_t ncclProxySaveOp(struct ncclComm* comm, struct ncclProxyOp* op, bool
case ncclPatternPipelineTo: {
struct ncclRing* ring = &channel->ring;
if (NeedProxy(proxyRecv, op->pattern, op->root, ring, comm->nRanks)) {
op->prevRank = ring->prev;
op->nextRank = ring->next;
NCCLCHECK(SaveProxy(comm, channel, proxyRecv, ring->prev, op, op->connIndex, justInquire));
}
if (NeedProxy(proxySend, op->pattern, op->root, ring, comm->nRanks)) {
op->prevRank = ring->prev;
op->nextRank = ring->next;
NCCLCHECK(SaveProxy(comm, channel, proxySend, ring->next, op, op->connIndex, justInquire));
}
} break;
Expand Down