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
[quant] Make choose_qparams_optimized return Tensors to preserve dtype #45530
Conversation
Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: f315abb513eccf7f48f5720d07cc05cb18c5b712 Pull Request resolved: #45530
💊 CI failures summary and remediationsAs of commit 29e0d1c (more details on the Dr. CI page):
🚧 1 fixed upstream failure:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
…eserve dtype" Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D24001134](https://our.internmc.facebook.com/intern/diff/D24001134) [ghstack-poisoned]
Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 807667faa1012387a82ef710ea63dc833071073c Pull Request resolved: #45530
…eserve dtype" Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D24001134](https://our.internmc.facebook.com/intern/diff/D24001134) [ghstack-poisoned]
Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 541687ce1372c1634f2fcaed64735a3ad073015f Pull Request resolved: #45530
@@ -4437,7 +4437,7 @@ | |||
use_c10_dispatcher: full | |||
variants: function | |||
|
|||
- func: choose_qparams_optimized(Tensor input, int numel, int n_bins, float ratio, int bit_width) -> (float, float) | |||
- func: choose_qparams_optimized(Tensor input, int numel, int n_bins, float ratio, int bit_width) -> (Tensor, Tensor) |
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.
I was wondering the reason for having numel as an argument? Isn't it the same as input tensor size?
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.
Not necessarily, it could be per-channel in which case it will be numel per channel
…eserve dtype" Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D24001134](https://our.internmc.facebook.com/intern/diff/D24001134) [ghstack-poisoned]
Summary: Returning double values requires special handling as a return type for aten functions. Instead return tensors where the type is preserved in the tensor dtype Test Plan: python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 5077038980439051616348549ef5958654c23860 Pull Request resolved: #45530
This pull request has been merged in c112e89. |
Stack from ghstack:
Summary:
Returning double values requires special handling as a return type for aten functions.
Instead return tensors where the type is preserved in the tensor dtype
Test Plan:
python test/test_quantization.py TestQuantizedTensor.test_choose_qparams_optimized
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D24001134