Skip to content

Commit

Permalink
fix collective helper (#46582)
Browse files Browse the repository at this point in the history
  • Loading branch information
sneaxiy authored Sep 28, 2022
1 parent 7a7826b commit bd10211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions paddle/fluid/platform/collective_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ class NCCLCommImpl : public NCCLComm {
std::shared_ptr<platform::CudaEventObject> comm_event_;
};

NCCLCommContext& NCCLCommContext::Instance() {
static NCCLCommContext comm_ctx;
return comm_ctx;
}

NCCLComm* NCCLCommContext::CreateComm(
ncclUniqueId* nccl_id, int nranks, int rank, int dev_id, int ring_id) {
PADDLE_ENFORCE_NOT_NULL(nccl_id,
Expand Down
5 changes: 1 addition & 4 deletions paddle/fluid/platform/collective_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ class NCCLComm {
// A singleton NCCL communicator context reserves communication ring ids
class NCCLCommContext {
public:
static NCCLCommContext& Instance() {
static NCCLCommContext comm_ctx;
return comm_ctx;
}
static NCCLCommContext& Instance();

NCCLComm* CreateComm(
ncclUniqueId* nccl_id, int nranks, int rank, int dev_id, int ring_id = 0);
Expand Down

0 comments on commit bd10211

Please sign in to comment.