From e683ab50b96efb153ac763751e14a8f92c02d15e Mon Sep 17 00:00:00 2001 From: xiongkun Date: Thu, 30 Dec 2021 13:19:34 +0800 Subject: [PATCH] [New-Exe]Fix word2vec hang proble using InterpreterCore (#38584) * fix wait for tiexing * fix work2vec model. new_exe support EOF Exception in ReadOp now --- .../fluid/framework/new_executor/interpretercore.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/new_executor/interpretercore.cc b/paddle/fluid/framework/new_executor/interpretercore.cc index 9d8e4867841..7c0bbac6180 100644 --- a/paddle/fluid/framework/new_executor/interpretercore.cc +++ b/paddle/fluid/framework/new_executor/interpretercore.cc @@ -454,11 +454,20 @@ void InterpreterCore::ExecuteInstructionList( } auto event_name = main_thread_blocker_.WaitEvent(); - VLOG(3) << "event_name: " << event_name; + VLOG(1) << "event_name: " << event_name; if (UNLIKELY(exception_holder_.IsCaught())) { - VLOG(4) << "Exception caught " << exception_holder_.Type(); + VLOG(1) << "Exception caught " << exception_holder_.Type(); + // NOTE(xiongkun) Why we reset ? + // The caught exception may be EOFExcetion, under this situation, we need + // make async_work_queue_ available, so we need reset. async_work_queue_->Cancel(); + async_work_queue_.reset(new interpreter::AsyncWorkQueue( + kHostNumThreads, &main_thread_blocker_)); + PADDLE_ENFORCE_EQ( + main_thread_blocker_.Clear(), 0, + platform::errors::PreconditionNotMet( + "main_thread_blocker_.Clear() return -1, clear failed")); exception_holder_.ReThrow(); } } -- GitLab