-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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")); |
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个问题我们讨论过,感觉不需要特判,因为用户在python端会接受到这个异常,如果用户没有退出程序,那么C++端的执行器应该保证可以再次正常运行。所以我们对所有的异常都执行了 reset 操作。
PR types
Others
PR changes
Others
Describe
Others