Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New-Exe]Fix word2vec hang proble using InterpreterCore #38584

Merged
merged 3 commits into from Dec 30, 2021

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants