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 7b13112986f9ad85056a3e8a5a6ed99bd0be95d5..4a7b7d1329a6a6c6da9b581eaa93f54038c9420d 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 =