From 2f64215995cf557736fca9746c262f8a6331b587 Mon Sep 17 00:00:00 2001 From: liutiexing <74819124+liutiexing@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:59:40 +0800 Subject: [PATCH] [NewExe] Ignore eof Exception(#39487) * add align for WorkQueue * add spinlock * merge develop * merge * Add EventsWaiter * Revert "Add EventsWaiter" This reverts commit e206173aa9be7401b83a53581627bfaf557c8fb2. * add log for Executor * Avoid thread reconsruction when EOF Co-authored-by: liutiexing --- .../fluid/framework/new_executor/interpretercore.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/framework/new_executor/interpretercore.cc b/paddle/fluid/framework/new_executor/interpretercore.cc index 518d866afcc..8a5ec83b8b3 100644 --- a/paddle/fluid/framework/new_executor/interpretercore.cc +++ b/paddle/fluid/framework/new_executor/interpretercore.cc @@ -475,12 +475,11 @@ void InterpreterCore::ExecuteInstructionList( if (UNLIKELY(exception_holder_.IsCaught())) { 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_)); + // Graceful exit when the executor encountered a fatal error. + // EOF is not a fatal error. + if (exception_holder_.Type() != "EOF") { + async_work_queue_->Cancel(); + } PADDLE_ENFORCE_EQ( main_thread_blocker_.Clear(), 0, platform::errors::PreconditionNotMet( -- GitLab