-
Notifications
You must be signed in to change notification settings - Fork 691
[ET] enabling half dtype input for quantization #11479
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
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11479
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 1 Cancelled JobAs of commit 316d2c0 with merge base 8cfa858 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D76053764 |
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
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
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76053764 |
1f024fc
into
gh/ahmtox/12/base
Summary: # Context Need these changes that were reverted in the weekend. Original stack of commits were unable to be merged into main due to an existing lintrunner issue blocking the merge. All the changes already went through [review](#11479) and approved. Differential Revision: D76737404
Pull Request resolved: #11479 Currently the cpu implementation for the quantization operator (which includes `quantize_per_token`, `quantize_per_tensor`, and `quantize_per_channel`), does not inherently support half (fp16) input scalar types. In order to align with the PyTorch implementation that accepts fp16 and bfp16 inputs, this diff aims to enable half input dtype support for the quantization operators. We will be comparing this implementation against the vulkan operators. As defined in ExecuTorch [scalar_type_util.h](https://github.com/pytorch/executorch/blob/053686242c1687f0d51b3bb8befd14b047d7b025/runtime/core/exec_aten/util/scalar_type_util.h#L190) file, there is a method to enable support simply changing which preprocessor is called to ET_FORALL_FLOATH_TYPES. This enables support for Half (fp16), Float (fp32), and Double (fp64). I have also included more comprehensive testing against the input dtypes, including adding double testing since it didn't already exist before. Instead of just confirming that all the output dtypes are supported, we also have a check that all input dtypes are supported now as well. ghstack-source-id: 290376481 @exported-using-ghexport Differential Revision: [D76053764](https://our.internmc.facebook.com/intern/diff/D76053764/)
Stack from ghstack (oldest at bottom):
Improving the cpu implementation op_quantize to support input half dtype and adding additional testing
Differential Revision: D76053764