diff --git a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc index d9b855503b4b3b3df40b0192e569b40731a94953..501e1dfad7644de274ff540458bb9417760dedaf 100644 --- a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc @@ -208,6 +208,11 @@ void ThreadedSSAGraphExecutor::RunOp( try { VLOG(10) << op->DebugString(); op->Run(use_event_); + + for (auto &dev_ctx : op->dev_ctx_) { + dev_ctx.second->Wait(); // Sync error + } + for (auto *ready : *ready_buffer) { ready->store(true, std::memory_order_release); }