-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[Intel GPU] Extract common utils for conv&qconv #139580
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/139580
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit dd2ec92 with merge base ffb9790 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Is it OK to add Line 61 in 3179eb1
I think we need this autoformat. |
| #include <ATen/ATen.h> | ||
| #include <ATen/Tensor.h> | ||
| #include <ATen/core/Tensor.h> | ||
| #include <iostream> |
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.
where do we need this code?
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.
has removed, thanks for suggestions
EikanWang
left a comment
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.
Overall, LGTM
| auto dims = adims.data(); | ||
| auto data_type = static_cast<dnnl_data_type_t>( | ||
| get_onednn_dtype(src, /*allow_undef*/ true)); | ||
| get_onednn_dtype_include_double(src, /*allow_undef*/ false)); |
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.
What is the motivation behind true->false?
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.
This should be a bug fixing from IPEX by @Stonepia , changing this into false would trigger runtime error if met out-of-expectation error. Otherwise, the error might be hidden.
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.
This is because that if we allow_undef = true, this data_type might be undef, then the consecutive call like below will get wrong result, and cause silent fail.
// when data_type is undef, the md will be something like `0x1`
dnnl_memory_desc_create_with_strides(&md, ndims, dims, data_type, strides);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.
So, pls. add comments here to describe the tricky change.
|
@ZhiweiYan-96 , pls. add detailed descriptions to help reviewers understand your changes. |
hi, @guangyey The number of PRs (8 prs) in current stack exceeds the recommendation of ghstack, I would create another PR to enable formatting. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: Command Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
# Motivation This PR is a precursor to pytorch#133080. The PR extracts common logics in convolution and quantized convolution into `Utils.cpp`. With such modification, these two operators could share codes like input format querying, op layout querying. Pull Request resolved: pytorch#139580 Approved by: https://github.com/EikanWang, https://github.com/guangyey, https://github.com/malfet ghstack dependencies: pytorch#139721
# Motivation This PR is a precursor to pytorch#133080. The PR extracts common logics in convolution and quantized convolution into `Utils.cpp`. With such modification, these two operators could share codes like input format querying, op layout querying. Pull Request resolved: pytorch#139580 Approved by: https://github.com/EikanWang, https://github.com/guangyey, https://github.com/malfet ghstack dependencies: pytorch#139721
# Motivation This PR is a precursor to pytorch#133080. The PR extracts common logics in convolution and quantized convolution into `Utils.cpp`. With such modification, these two operators could share codes like input format querying, op layout querying. Pull Request resolved: pytorch#139580 Approved by: https://github.com/EikanWang, https://github.com/guangyey, https://github.com/malfet ghstack dependencies: pytorch#139721
Motivation
This PR is a precursor to #133080. The PR extracts common logics in convolution and quantized convolution into
Utils.cpp. With such modification, these two operators could share codes like input format querying, op layout querying.Stack from ghstack (oldest at bottom):
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10