@@ -42,7 +42,7 @@ constexpr const char* kTaskCompletion = "TaskCompletion";
4242namespace paddle {
4343namespace 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
4747bool 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