-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quant] Adding zero point type check for per channel quantization #40811
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
[ghstack-poisoned]
…ization" Differential Revision: [D22319417](https://our.internmc.facebook.com/intern/diff/D22319417) [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 5ff4884 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 11 times. |
…ization" Differential Revision: [D22319417](https://our.internmc.facebook.com/intern/diff/D22319417) [ghstack-poisoned]
| int64_t quant_min, | ||
| int64_t quant_max) { | ||
| TORCH_CHECK(self.scalar_type() == ScalarType::Float); | ||
| TORCH_CHECK(scale.scalar_type() == ScalarType::Float, |
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.
double I think?
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 think it's float, as per the iterator expectation here. Should I change them to double?
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.
Oh I thought this is quantize_per_tensor.
If this is float then probably zero_point should be int32_t, just to be consistent.
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.
The problem is that in the kernel implementation it is float for scale and int64_t for the zero_point. I will have to change all the kernels
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.
do you know why is that? it would be better to be consistent
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 am not sure why the inconsistency, but I see some kernels use 64 bits and some 32.
…ization" Differential Revision: [D22319417](https://our.internmc.facebook.com/intern/diff/D22319417) [ghstack-poisoned]
…ization" Differential Revision: [D22319417](https://our.internmc.facebook.com/intern/diff/D22319417) [ghstack-poisoned]
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.
Please make sure to change int64_t to int32_t in follow up PRs
…ization" Differential Revision: [D22319417](https://our.internmc.facebook.com/intern/diff/D22319417) [ghstack-poisoned]
…ization" Differential Revision: [D22319417](https://our.internmc.facebook.com/intern/diff/D22319417) [ghstack-poisoned]
Stack from ghstack:
Differential Revision: D22319417