From d3c82c356e806d17d399f152948dee3c8ac169e8 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 20 Mar 2018 12:18:37 +0800 Subject: [PATCH] Wait multiple stream --- paddle/fluid/framework/parallel_executor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 0f9bc869725..f4f5ab6a6f7 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -816,6 +816,10 @@ void ParallelExecutor::Run(const std::vector &fetch_tensors, // FIXME: // It could be optimized by using multiple events in an operator. // Manually sync computation during iter. + for (auto &s : member_->communication_streams_) { + s.second.ctx_->Wait(); + } + for (auto &p : member_->places_) { platform::DeviceContextPool::Instance().Get(p)->Wait(); } -- GitLab