-
Notifications
You must be signed in to change notification settings - Fork 23k
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
[quant][graphmode] quant_fusion jit pass #24427
Conversation
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
What is the order? First we do fusion and then quant-dequant or otherway. |
I think in future you will have more fusion patterns. How will the QuantFusion look like ? Should you not iterate over set of patterns ? I will let Mikhail provide more comments as he is better familiar with the fusion patterns |
conv->relu fusion will happen here as well, this PR is just used as a placeholder for quant_fusion pass, and we'll extend this later. |
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant 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.
@nishantpdce, when we have several patterns, they will be matched in order they are registered, so it's up to us to decide what we want first. In our case I'd expect the order will be from bigger to smaller, e.g:
- DQ-Conv-Relu-Q --> QConvRelu
- Conv-Relu --> ConvRelu
IOW, we would like to first check patterns that include Q/DQ before we check patterns from generic fusion.
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.
Overall looks good, some remarks are inline!
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags:
This pull request has been merged in 9a9ef21. |
Summary: Added following pass: - _jit_pass_quant_fusion: Fusion pass that replaces the dequant->conv->quant patterns to quantized_conv Test Plan: python test/test_jit.py Reviewers: pt1quant Subscribers: Tasks: Tags: ghstack-source-id: 34aa4a870d51a63137b37f39773c0081b1b4b99d Pull Request resolved: pytorch/pytorch#24427
Stack from ghstack:
Summary:
Added following pass:
to quantized_conv
Test Plan:
python test/test_jit.py
Reviewers:
pt1quant
Subscribers:
Tasks:
Tags:
Differential Revision: D17001142