-
Notifications
You must be signed in to change notification settings - Fork 344
add learnable_fake_quantize in pt2e #3135
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/pytorch/ao/3135
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New FailuresAs of commit dd004b2 with merge base a5a8fe2 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
can you correct the name to fake_quantizer
?
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.
@jerryzh168
I'm trying to be consistent with FakeQuantize()
class at: https://github.com/pytorch/ao/blob/main/torchao/quantization/pt2e/fake_quantize.py.
I'm ok to change the file name: learnable_fake_quantize.py
to learnable_fake_quantizer.py
and the class name from LearnableFakeQuantize()
to LearnableFakeQuantizer()
if that is what you meant.
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.
Yeah this is for pt2e flow, so I feel the name FakeQuantize
is more consistent with the other classes?
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.
FakeQuantize
is the wrong name I think since it's a verb not noun, it's not consistent with Observer
which is a noun. We can correct, and deprecate FakeQuantize
itself as we add new things.
But it's OK to do this separately as well
Summary: Learnable Fake Quantize is a popular technique used especially for low-precision QAT. This was available in fx quantization at https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/_learnable_fake_quantize.py#L10?, but not in pt2e quantization flow. This change adds learnable fake quantize in pt2e, with some changes, especially related to how channel wise quantization works. Differential Revision: D83542550
38017fc
to
60b321a
Compare
Summary: Learnable Fake Quantize is a popular technique used especially for low-precision QAT. This was available in fx quantization at https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/_learnable_fake_quantize.py#L10?, but not in pt2e quantization flow. This change adds learnable fake quantize in pt2e, with some changes, especially related to how channel wise quantization works. Differential Revision: D83542550
60b321a
to
a2389fc
Compare
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.
Looks great, thanks for addressing the comments. Once you fix the tests we can go ahead and merge this
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.
Yeah this is for pt2e flow, so I feel the name FakeQuantize
is more consistent with the other classes?
Summary: Learnable Fake Quantize is a popular technique used especially for low-precision QAT. This was available in fx quantization at https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/_learnable_fake_quantize.py#L10?, but not in pt2e quantization flow. This change adds learnable fake quantize in pt2e, with some changes, especially related to how channel wise quantization works. Reviewed By: andrewor14 Differential Revision: D83542550
a2389fc
to
149bc0b
Compare
Summary: Learnable Fake Quantize is a popular technique used especially for low-precision QAT. This was available in fx quantization at https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/_learnable_fake_quantize.py#L10?, but not in pt2e quantization flow. This change adds learnable fake quantize in pt2e, with some changes, especially related to how channel wise quantization works. Reviewed By: andrewor14 Differential Revision: D83542550
149bc0b
to
dd004b2
Compare
Summary: Learnable Fake Quantize is a popular technique used especially for low-precision QAT. This was available in fx quantization at https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/_learnable_fake_quantize.py#L10?, but not in pt2e quantization flow. This change adds learnable fake quantize in pt2e, with some changes, especially related to how channel wise quantization works.
Differential Revision: D83542550