File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
paddle/fluid/framework/details Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ FastThreadedSSAGraphExecutor::FastThreadedSSAGraphExecutor(
30
30
local_scopes_ (local_scopes),
31
31
places_(places),
32
32
graph_(std::move(graph)),
33
- pool_(strategy.num_threads_ +
34
- 1 ), // add one more thread for generate op_deps
33
+ pool_(strategy.num_threads_),
34
+ prepare_pool_( 1 ), // add one more thread for generate op_deps
35
35
fetch_ctxs_(places) {
36
36
for (auto &op : ir::FilterByNodeWrapper<OpHandleBase>(*graph_)) {
37
37
int dep = static_cast <int >(op->NotReadyInputSize ());
@@ -160,7 +160,7 @@ void FastThreadedSSAGraphExecutor::RunOpAsync(
160
160
});
161
161
}
162
162
void FastThreadedSSAGraphExecutor::PrepareAtomicOpDeps () {
163
- atomic_op_deps_ = pool_ .enqueue ([&] {
163
+ atomic_op_deps_ = prepare_pool_ .enqueue ([&] {
164
164
auto *op_deps = new std::unordered_map<OpHandleBase *, std::atomic<int >>;
165
165
for (auto &pair : op_deps_) {
166
166
(*op_deps)[pair.first ] = pair.second ;
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