Skip to content

Commit 59a2291

Browse files
committed
fix work2vec model. new_exe support EOF Exception in ReadOp now
1 parent 3e0b280 commit 59a2291

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

paddle/fluid/framework/new_executor/interpretercore.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ constexpr const char* kTaskCompletion = "TaskCompletion";
4242
namespace paddle {
4343
namespace framework {
4444
// NOTE(Aurelius84): Need a better strategy to determine it.
45-
static constexpr size_t kHostNumThreads = 2;
45+
static constexpr size_t kHostNumThreads = 4;
4646

4747
bool IsInterpretercoreFastGCEnabled() {
4848
return FLAGS_fast_eager_deletion_mode && FLAGS_use_stream_safe_cuda_allocator;
@@ -458,11 +458,16 @@ void InterpreterCore::ExecuteInstructionList(
458458

459459
if (UNLIKELY(exception_holder_.IsCaught())) {
460460
VLOG(1) << "Exception caught " << exception_holder_.Type();
461-
// NOTE(xiongkun) Why we reset ?
462-
// The caught exception may be EOFExcetion, under this situation, we need make async_work_queue_ available, so we need reset.
461+
// NOTE(xiongkun) Why we reset ?
462+
// The caught exception may be EOFExcetion, under this situation, we need
463+
// make async_work_queue_ available, so we need reset.
463464
async_work_queue_->Cancel();
464-
async_work_queue_.reset(
465-
new interpreter::AsyncWorkQueue(kHostNumThreads, &main_thread_blocker_));
465+
async_work_queue_.reset(new interpreter::AsyncWorkQueue(
466+
kHostNumThreads, &main_thread_blocker_));
467+
PADDLE_ENFORCE_EQ(
468+
main_thread_blocker_.Clear(), 0,
469+
platform::errors::PreconditionNotMet(
470+
"main_thread_blocker_.Clear() return -1, clear failed"));
466471
exception_holder_.ReThrow();
467472
}
468473
}

0 commit comments

Comments
 (0)