-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Adding quantized::conv2d function for pytorch mobile in c10 #26152
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: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags:
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags:
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags:
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.
looking good, some comments
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags:
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: b33ea74 Pull Request resolved: pytorch#26152
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags:
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D17422828](https://our.internmc.facebook.com/intern/diff/D17422828) [ghstack-poisoned]
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D17422828](https://our.internmc.facebook.com/intern/diff/D17422828) [ghstack-poisoned]
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D17422828](https://our.internmc.facebook.com/intern/diff/D17422828) [ghstack-poisoned]
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D17422828](https://our.internmc.facebook.com/intern/diff/D17422828) [ghstack-poisoned]
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D17422828](https://our.internmc.facebook.com/intern/diff/D17422828) [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.
I guess one of us would need to rebase depending on whether permute PR lands first or not
@@ -1323,6 +1322,129 @@ def test_qlinear_qnnpack(self, batch_size, input_channels, output_channels, use_ | |||
np.testing.assert_equal( | |||
Y_q_ref2.int_repr().numpy(), Y_q.int_repr().numpy()) | |||
|
|||
@given(batch_size=st.integers(1, 3), |
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.
why do we need separate tests for qnnpack? can't we just use the same set of tests as for fbgemm? (and iterate over available engines in the beginning)
same applies to linear tests above
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.
Ensuring numeric consistency of QNNPACK and FBGEMM is also a requirement for quantization aware training to work, so it will be good to check that both kernels pass the same tests. For QNNPACK we should also add tests that allow for full use of dynamic range of wts and activations
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.
Discussed offline. Will merge tests in a different PR.
Y_scale, | ||
Y_zp, | ||
use_relu): | ||
with enable_mobile_quantized_engine(): |
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.
nit: I'd rather rename it to a function taking qengine as an argument, but since it's a test - it's minor
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.
Few comments/questions. Thanks!
Summary: This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D17459892](https://our.internmc.facebook.com/intern/diff/D17459892) [ghstack-poisoned]
Summary: Pull Request resolved: pytorch/pytorch#26152 This change adds the support to call QNNPACK using the refactored API for Conv2d operators Test Plan: python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack Imported from OSS Differential Revision: D17459892 fbshipit-source-id: d20b3e8b81dd403541cb2b9164731448ca229695
This pull request has been merged in b23be95. |
Stack from ghstack:
Summary:
This change adds the support to call QNNPACK using the refactored API for Conv2d operators
Test Plan:
python test/test_quantized.py TestQNNPackOps.test_qconv_qnnpack
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D17459892