未验证 提交 b619648c 编写于 作者: H houj04 提交者: GitHub

bugfix: parallel_executor for xpu should use BindThreadedSSAGraphExecutor (#32792) (#32933)

上级 4831e378
...@@ -1406,11 +1406,24 @@ std::vector<ir::Graph *> ParallelExecutor::CreateSSAGraphExecutor( ...@@ -1406,11 +1406,24 @@ std::vector<ir::Graph *> ParallelExecutor::CreateSSAGraphExecutor(
member_->executor_.reset(new details::ThreadedSSAGraphExecutor( member_->executor_.reset(new details::ThreadedSSAGraphExecutor(
exec_strategy, member_->local_scopes_, member_->local_exec_scopes_, exec_strategy, member_->local_scopes_, member_->local_exec_scopes_,
member_->places_, graph)); member_->places_, graph));
} else {
if (member_->use_device_ == p::kXPU) {
#if defined(PADDLE_WITH_XPU)
VLOG(3) << "use BindThreadedSSAGraphExecutor";
member_->executor_.reset(new details::BindThreadedSSAGraphExecutor(
exec_strategy, member_->local_scopes_,
member_->local_exec_scopes_, member_->places_, graph));
#else
PADDLE_THROW(platform::errors::PermissionDenied(
"Paddle can't use XPU device since it's not compiled with XPU,"
"Please recompile or reinstall Paddle with XPU support."));
#endif
} else { } else {
VLOG(3) << "use FastThreadedSSAGraphExecutor"; VLOG(3) << "use FastThreadedSSAGraphExecutor";
member_->executor_.reset(new details::FastThreadedSSAGraphExecutor( member_->executor_.reset(new details::FastThreadedSSAGraphExecutor(
exec_strategy, member_->local_scopes_, member_->local_exec_scopes_, exec_strategy, member_->local_scopes_,
member_->places_, graph)); member_->local_exec_scopes_, member_->places_, graph));
}
} }
final_graphs.emplace_back(graph); final_graphs.emplace_back(graph);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册