-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
mkldnn directory cleanup #47779
mkldnn directory cleanup #47779
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
Great job cleaning this up!
I added a few suggestions.
There's really a lot that needs to be changed after the PHI migrations... Maybe it's a good idea to Ctrl-F "MKLDNN" and change it to "OneDNN" wherever possible?
@piotrekobi TYVM for review 👍 I know that there are still many MKLDNN files, but as you can see this PR already exceeded limit of modified files. Let's try to merge what is already done. Final refactor will be done after we migrate all remaining fluid oneDNN kernels to PHI |
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
@@ -371,7 +371,14 @@ add_sparse_inputs(const std::vector<const phi::SelectedRows*>& inputs, | |||
auto& input_rows = input->rows(); | |||
|
|||
#ifdef PADDLE_WITH_MKLDNN | |||
paddle::operators::OneDNNAXPYHandler<T> axpy_handler(input_width, T(1.f)); | |||
|
|||
auto& pool = paddle::platform::DeviceContextPool::Instance(); |
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.
We don't recommend using paddle::platform::DeviceContextPool::Instance()
in PHI. You could add DeviceContext
argument for this function to pass dev_ctx
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.
Thanks for catching this.
This function has CPUContext
instead of OneDNNContext
so I'm unable to use GetDevice()
method. I removed fluid dependency and created OneDNNContext
before this function is called. Could you please advice if this approach 0c9ca31 is good?
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.
It seems good. LGTM
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
PR types
Others
PR changes
Others
Describe