[quant][graphmode] Add RemoveReduantDequantize pass#38434
Closed
jerryzh168 wants to merge 6 commits intogh/jerryzh168/316/basefrom
Closed
[quant][graphmode] Add RemoveReduantDequantize pass#38434jerryzh168 wants to merge 6 commits intogh/jerryzh168/316/basefrom
jerryzh168 wants to merge 6 commits intogh/jerryzh168/316/basefrom
Conversation
Summary: We insert dequantize for each use in order to produce quantization patterns that will later be fused, after that we should also remove extra dequantize node produced by this operation. Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
This was referenced May 13, 2020
💊 CI failures summary and remediationsAs of commit 3fd43dc (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 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 30 times. |
Summary: We insert dequantize for each use in order to produce quantization patterns that will later be fused, after that we should also remove extra dequantize node produced by this operation. Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: We insert dequantize for each use in order to produce quantization patterns that will later be fused, after that we should also remove extra dequantize node produced by this operation. Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
supriyar
reviewed
May 14, 2020
| def forward(self, x): | ||
| y = x.size(0) | ||
| x = self.conv(x) | ||
| return (x.size(0) + y) * x |
Contributor
There was a problem hiding this comment.
Why does this case have extra dequant? Is it due to x.size()?
supriyar
approved these changes
May 14, 2020
Contributor
Author
|
I thought about this again, and feel that this might not be very safe, since user can explicitly call dequantize as well, although that's rare, to be safe, I'll create a whitelist for ops that the dequantize can be removed for their input. |
Summary: We insert dequantize for each use in order to produce quantization patterns that will later be fused, after that we should also remove extra dequantize node produced by this operation. Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: We insert dequantize for each use in order to produce quantization patterns that will later be fused, after that we should also remove extra dequantize node produced by this operation. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D21597834](https://our.internmc.facebook.com/intern/diff/D21597834) [ghstack-poisoned]
Summary: We insert dequantize for each use in order to produce quantization patterns that will later be fused, after that we should also remove extra dequantize node produced by this operation. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D21597834](https://our.internmc.facebook.com/intern/diff/D21597834) [ghstack-poisoned]
Contributor
|
This pull request has been merged in 6232481. |
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Pull Request resolved: pytorch#38434 We insert dequantize for each use in order to produce quantization patterns that will later be fused, after that we should also remove extra dequantize node produced by this operation. Test Plan: Imported from OSS Differential Revision: D21597834 fbshipit-source-id: 18dfb2760bbb08932aa4e1d06f96cfc5fb37ed88
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
aten::cat#38570 [quant][graphmode] Different rule for handlingaten::catSummary:
We insert dequantize for each use in order to produce quantization patterns that will
later be fused, after that we should also remove extra dequantize node produced by this operation.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D21597834