NVIDIA / nccl

Optimized primitives for collective multi-GPU communication
Other
3.28k stars 829 forks source link

Why only flush once using the last non-zero receive? #1393

Open clearsky07 opened 3 months ago

clearsky07 commented 3 months ago

I have a question about ncclIbIflush in net_ib.cc : why only flush once using the last non-zero receive? The src is:

  // Only flush once using the last non-zero receive
  struct ncclIbRequest* req;
  NCCLCHECK(ncclIbGetRequest(&comm->base, &req));
  req->type = NCCL_NET_IB_REQ_FLUSH;
  req->sock = &comm->base.sock;
  struct ncclIbMrHandle* mhandle = (struct ncclIbMrHandle*) mhandles[last];