From 14d039e4a1014d2facfb0c134f1c2f24f4994e5a Mon Sep 17 00:00:00 2001 From: WangXi Date: Tue, 9 Feb 2021 12:16:16 +0800 Subject: [PATCH] Fix the problem that the number of ops executed by xpu is wrong (#30961) --- .../framework/details/bind_threaded_ssa_graph_executor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/details/bind_threaded_ssa_graph_executor.cc b/paddle/fluid/framework/details/bind_threaded_ssa_graph_executor.cc index 6d3c52dabbd..6ce1eac2e30 100644 --- a/paddle/fluid/framework/details/bind_threaded_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/bind_threaded_ssa_graph_executor.cc @@ -131,13 +131,13 @@ FetchResultType BindThreadedSSAGraphExecutor::RunMainStream( platform::XPUPlace cur_place; std::size_t cur_count = 0; - while (cur_count < op_deps_.size()) { + while (cur_count < op_deps->size()) { cur_count++; auto cur_op = ready_ops->Pop(); // when execption, get cur_op == nullptr if (cur_op == nullptr) { std::lock_guard lock(mutex_); - exec_op_count_ = op_deps_.size(); + exec_op_count_ = op_deps->size(); break; } auto dev_ctxes_ = cur_op->DeviceContext(); @@ -153,7 +153,7 @@ FetchResultType BindThreadedSSAGraphExecutor::RunMainStream( } { std::unique_lock lock(mutex_); - cv_.wait(lock, [&] { return exec_op_count_ >= op_deps_.size(); }); + cv_.wait(lock, [&] { return exec_op_count_ >= op_deps->size(); }); } if (exception_.IsCaught()) { -- GitLab