From 47740ace289721e61489f6b2b5c196f26250aa3f Mon Sep 17 00:00:00 2001 From: Yancey1989 Date: Fri, 7 Dec 2018 17:18:45 +0800 Subject: [PATCH] fix performance --- paddle/fluid/framework/details/all_reduce_op_handle.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/framework/details/all_reduce_op_handle.cc b/paddle/fluid/framework/details/all_reduce_op_handle.cc index ae203387462..6b7bbf9003a 100644 --- a/paddle/fluid/framework/details/all_reduce_op_handle.cc +++ b/paddle/fluid/framework/details/all_reduce_op_handle.cc @@ -107,6 +107,7 @@ void AllReduceOpHandle::RunImpl() { PADDLE_ENFORCE(platform::dynload::ncclAllReduce( buffer, buffer, numel, static_cast(dtype), ncclSum, comm, stream)); + if (!nccl_ctxs_->need_group_call_) cudaStreamSynchronize(stream); }); } -- GitLab