Skip to content

Conversation

@2742195759
Copy link
Contributor

PR types

Others

PR changes

Others

Describe

Others

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@Aurelius84 Aurelius84 changed the title Fix word2vec [New-Exe]Fix word2vec hang proble using InterpreterCore Dec 29, 2021
Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +460 to +470
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"));
Copy link
Contributor

@zhiqiu zhiqiu Dec 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this ok?

if (exception_holder_.Type() != "EOF"){
async_work_queue_->Cancel();
}
exception_holder_.ReThrow();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个问题我们讨论过,感觉不需要特判,因为用户在python端会接受到这个异常,如果用户没有退出程序,那么C++端的执行器应该保证可以再次正常运行。所以我们对所有的异常都执行了 reset 操作。

@Aurelius84 Aurelius84 merged commit e683ab5 into PaddlePaddle:develop Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants