From a478a11e0b381c19bc392efd85d016dfaa62df22 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Wed, 21 Mar 2018 12:43:23 +0800 Subject: [PATCH] NCCL Guard for bcast --- paddle/fluid/framework/parallel_executor.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index d06613b573b..a5221d03d61 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -606,7 +606,7 @@ void ParallelExecutor::BCastParamsToGPUs( auto &dims = main_tensor.dims(); size_t numel = main_tensor.numel(); - platform::dynload::ncclGroupStart(); + platform::NCCLGroupGuard guard; for (size_t i = 0; i < member_->places_.size(); ++i) { auto place = member_->places_[i]; @@ -624,7 +624,6 @@ void ParallelExecutor::BCastParamsToGPUs( platform::dynload::ncclBcast(buffer, numel, data_type, 0, nccl_ctx.comm, nccl_ctx.stream()); } - platform::dynload::ncclGroupEnd(); } for (auto &stream : member_->communication_streams_) { -- GitLab