Skip to content

Commit 0115cbd

Browse files
author
chengduozh
committed
fix bug of ScopeBufferedSSAGraphExecutor
test=develop
1 parent d8ca4b1 commit 0115cbd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ FeedFetchList ScopeBufferedSSAGraphExecutor::Run(
3838
const std::vector<std::string> &fetch_tensors) {
3939
if (drop_scope_counter_ == 0) {
4040
platform::RecordEvent e("InitLocalExeScopes");
41-
PrepareLocalExeScopes();
41+
if (!run_op_future_.valid()) {
42+
PrepareLocalExeScopes();
43+
}
4244
run_op_future_.get();
4345
}
4446

@@ -77,6 +79,7 @@ void ScopeBufferedSSAGraphExecutor::DropLocalExeScopes() {
7779
drop_scope_event.reset(nullptr);
7880

7981
platform::RecordEvent e("InitLocalExeScopes");
82+
PrepareLocalExeScopes();
8083
}
8184

8285
void ScopeBufferedSSAGraphExecutor::PrepareLocalExeScopes() {
@@ -98,7 +101,6 @@ void ScopeBufferedSSAGraphExecutor::PrepareLocalExeScopes() {
98101
}
99102
}
100103
}
101-
return 1;
102104
});
103105
}
104106

paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ScopeBufferedSSAGraphExecutor : public SSAGraphExecutor {
6161
std::vector<Scope*> local_scopes_;
6262
std::vector<VariableInfo> var_infos_;
6363
std::vector<platform::Place> places_;
64-
std::future<int> run_op_future_;
64+
std::future<void> run_op_future_;
6565
::ThreadPool threads_pool_;
6666
};
6767
} // namespace details

0 commit comments

Comments
 (0)