From 950aec55fd1258b6376171ece618701b5d26beb7 Mon Sep 17 00:00:00 2001 From: chengduo Date: Mon, 6 May 2019 07:59:17 +0800 Subject: [PATCH] It doesn't need sync when fetch_list nit not empty (#17201) test=develop --- .../details/scope_buffered_ssa_graph_executor.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.cc b/paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.cc index 7b13112986f..4a7b7d1329a 100644 --- a/paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.cc @@ -15,6 +15,7 @@ #include "paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.h" #include #include +#include #include #include "paddle/fluid/framework/variable_helper.h" #include "paddle/fluid/platform/profiler.h" @@ -66,16 +67,8 @@ FeedFetchList ScopeBufferedSSAGraphExecutor::Run( platform::RecordEvent e("ScopeBufferedSSAGraphExecutorAfterRun"); ++drop_scope_counter_; - bool stream_end = false; - if (!fetch_tensors.empty()) { - WaitComputationalStreams(); - stream_end = true; - } - if (drop_scope_counter_ == strategy_.num_iteration_per_drop_scope_) { - if (!stream_end) { - WaitComputationalStreams(); - } + WaitComputationalStreams(); for (auto &scope : local_scopes_) { auto &local_scope = -- GitLab