-
Notifications
You must be signed in to change notification settings - Fork 24.1k
[Quant][X86] add an op to compute uint8 batch norm 2d #152811
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
base: gh/Xia-Weiwen/39/base
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/152811
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 6770c6e with merge base 7e637de ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
); | ||
} else if (output.scalar_type() == c10::ScalarType::BFloat16) { | ||
auto out_ptr = output.data_ptr<at::BFloat16>(); | ||
q_batch_norm_cpu_kernel_impl<at::BFloat16>( |
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.
Same comment as previous PR, let's merge these branches.
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. I have updated this part.
Stack from ghstack (oldest at bottom):
Summary
This PR adds a new op,
onednn.qbatch_norm2d
, which accepts uint8 inputs on CPU device (instead of QuantizedCPU).The new ops are implemented with AVX512 instructions and it provides similar performance as its counterpart for QuantizedCPU device
quantized.batch_norm2d
.The new op supports output dtypes other than uint8 (fp32, fp16 and bf16 are supported).
Test plan
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168