-
Notifications
You must be signed in to change notification settings - Fork 26.3k
quantized layer norm: add to static quant #36690
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
Summary: Adds the static quantization hook for LayerNorm Test Plan: ``` python test/quantization/test_quantized_nn_mods.py ModuleAPITest.test_layer_norm python test/quantization/test_quantization.py EagerModePostTrainingQuantTest.test_normalization ``` Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 Build failures summary and remediationsAs of commit f3af14b (more details on the Dr. CI page):
XLA failureJob pytorch_xla_linux_bionic_py3_6_clang9_build is failing. Please create an issue with title prefixed by 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. This comment has been revised 7 times. |
Summary: Adds the static quantization hook for LayerNorm Test Plan: ``` python test/quantization/test_quantized_nn_mods.py ModuleAPITest.test_layer_norm python test/quantization/test_quantization.py EagerModePostTrainingQuantTest.test_normalization ``` Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Adds the static quantization hook for LayerNorm Test Plan: ``` python test/quantization/test_quantized_nn_mods.py ModuleAPITest.test_layer_norm python test/quantization/test_quantization.py EagerModePostTrainingQuantTest.test_normalization ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 5370ccb Pull Request resolved: #36690
supriyar
left a comment
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!
Summary: Adds the static quantization hook for LayerNorm Test Plan: ``` python test/quantization/test_quantized_nn_mods.py ModuleAPITest.test_layer_norm python test/quantization/test_quantization.py EagerModePostTrainingQuantTest.test_normalization ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D21055401](https://our.internmc.facebook.com/intern/diff/D21055401) [ghstack-poisoned]
Summary: Adds the static quantization hook for LayerNorm Test Plan: ``` python test/quantization/test_quantized_nn_mods.py ModuleAPITest.test_layer_norm python test/quantization/test_quantization.py EagerModePostTrainingQuantTest.test_normalization ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 4a7194e Pull Request resolved: #36690
|
|
||
| checkQuantized(model) | ||
|
|
||
| def test_normalization(self): |
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.
This test (and other tests here) only test for FBGEMM, needs to be fixed in a later PR.
| self.assertEqual(quant_ref.int_repr().numpy(), qy.int_repr().numpy(), | ||
| message="BatchNorm3d module API failed") | ||
|
|
||
| def test_layer_norm(self): |
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 we test this over qnnpack and FBGEMM? Qnnpack only tests the x86 path.
@given(qengine=st.sampled_from(("qnnpack", "fbgemm")))and using qengine as an argument to the test should do it.
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.
we don't have a mobile implementation for LayerNorm. It might run correctly on mobile but it would be too slow to be useful. Should we still test for it? I'm flexible, more just curios on how we've done it in the past.
raghuramank100
left a comment
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.
Requesting extending test to qnnpack, looks good otherwise!
|
This pull request has been merged in 2c558db. |
Stack from ghstack:
Summary:
Adds the static quantization hook for LayerNorm
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D21055401