未验证 提交 bd10211c 编写于 作者: S sneaxiy 提交者: GitHub

fix collective helper (#46582)

上级 7a7826b7
......@@ -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,
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册