File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
paddle/fluid/framework/details Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ FastThreadedSSAGraphExecutor::FastThreadedSSAGraphExecutor(
29
29
local_scopes_ (local_scopes),
30
30
places_(places),
31
31
graph_(std::move(graph)),
32
- pool_(strategy.num_threads_ +
33
- 1 ), // add one more thread for generate op_deps
32
+ pool_(strategy.num_threads_),
33
+ prepare_pool_( 1 ), // add one more thread for generate op_deps
34
34
fetch_ctxs_(places) {
35
35
auto &ops = graph_->Get <details::GraphOps>(" ops" );
36
36
@@ -155,9 +155,8 @@ void FastThreadedSSAGraphExecutor::RunOpAsync(
155
155
});
156
156
}
157
157
void FastThreadedSSAGraphExecutor::PrepareAtomicOpDeps () {
158
- atomic_op_deps_ = pool_.enqueue ([&] {
159
- std::unordered_map<OpHandleBase *, std::atomic<int >> *op_deps =
160
- new std::unordered_map<OpHandleBase *, std::atomic<int >>;
158
+ atomic_op_deps_ = prepare_pool_.enqueue ([&] {
159
+ auto *op_deps = new std::unordered_map<OpHandleBase *, std::atomic<int >>;
161
160
for (auto &pair : op_deps_) {
162
161
(*op_deps)[pair.first ] = pair.second ;
163
162
}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class FastThreadedSSAGraphExecutor : public SSAGraphExecutor {
46
46
std::vector<OpHandleBase *> bootstrap_ops_;
47
47
48
48
::ThreadPool pool_;
49
+ ::ThreadPool prepare_pool_;
49
50
platform::DeviceContextPool fetch_ctxs_;
50
51
std::atomic<int > remaining_;
51
52
You can’t perform that action at this time.
0 commit comments