Skip to content

Commit

Permalink
[New-Exe]Fix word2vec hang proble using InterpreterCore (#38584)
Browse files Browse the repository at this point in the history
* fix wait for tiexing

* fix work2vec model. new_exe support EOF Exception in ReadOp now
  • Loading branch information
2742195759 authored Dec 30, 2021
1 parent 1c094d3 commit e683ab5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions paddle/fluid/framework/new_executor/interpretercore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit e683ab5

Please sign in to comment.