-
Notifications
You must be signed in to change notification settings - Fork 24.4k
[quant][graphmode] Fix quantized::conv2d patterns in QuantFusion #26515
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: Fix patterns of `prepack` and `permute` after recent changes to `quantized::conv2d` and `quantized::conv2d_prepack` Test Plan: python test/test_jit.py 'TestJit.test_quant_fusion' Reviewers: pt1quant Subscribers: Tasks: Tags: [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.
Looks good but please include a description of the recent changes (or a link to the corresponding PR) you are referring to in the commit message.
%a_perm : Tensor = aten::permute(%a_quant, %in_param) | ||
%w_perm : Tensor = aten::permute(%w_quant, %in_param) | ||
%w_packed = quantized::conv_prepack(%w_perm, %stride, %padding, %dilation, %groups) | ||
%r = quantized::conv2d(%a_perm, %w_packed, %b_quant, %stride, %padding, %dilation, %groups, %r_scale, %r_zero_point) | ||
%out_param : int[] = prim::ListConstruct(%0, %3, %1, %2) | ||
%r_perm = aten::permute(%r, %out_param) |
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 we still need a permute for results?
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 so, it's a TODO in qconv.py: https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/quantized/cpu/qconv.cpp#L375
we need to update after that is removed
This pull request has been merged in 4444b91. |
Summary: Pull Request resolved: pytorch#26515 Fix patterns of `prepack` and `permute` after recent changes to `quantized::conv2d` and `quantized::conv2d_prepack` Test Plan: python test/test_jit.py 'TestJit.test_quant_fusion' Imported from OSS Differential Revision: D17502573 fbshipit-source-id: 1a719fd610e8ea9dc16075abaa042556e1edbceb
Stack from ghstack:
Summary:
Fix patterns of
prepack
andpermute
after recent changesto
quantized::conv2d
andquantized::conv2d_prepack
Test Plan:
python test/test_jit.py 'TestJit.test_quant_fusion'
Reviewers:
pt1quant
Subscribers:
Tasks:
Tags:
Differential Revision: D17502573