-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[Quant][fx] Refactor lowering code (part 1) #74128
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 commit removes extraneous and duplicate code in _lower_to_native_backend.py. There should be no change in behavior. Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: jerryzh168 Subscribers: jerryzh168 [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
|
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 149bb03 (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).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Summary: This commit removes extraneous and duplicate code in _lower_to_native_backend.py. There should be no change in behavior. Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: jerryzh168 Subscribers: jerryzh168 [ghstack-poisoned]
Summary: This commit removes extraneous and duplicate code in _lower_to_native_backend.py. There should be no change in behavior. Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: jerryzh168 Subscribers: jerryzh168 [ghstack-poisoned]
Summary: This commit removes extraneous and duplicate code in _lower_to_native_backend.py. There should be no change in behavior. Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: jerryzh168 Subscribers: jerryzh168 [ghstack-poisoned]
Summary: This commit removes extraneous and duplicate code in _lower_to_native_backend.py. There should be no change in behavior. Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: jerryzh168 Subscribers: jerryzh168 [ghstack-poisoned]
jerryzh168
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.
thanks, looks good! ideally we should separate them to multiple PRs I think, but maybe you can try to do that next time
|
maybe also add some more details for the refactors in the summary? |
Summary: This commit removes extraneous and duplicate code in _lower_to_native_backend.py. There should be no change in behavior. Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: jerryzh168 Subscribers: jerryzh168 [ghstack-poisoned]
|
Ok, how about I just do the removing subgraph rewriter and |
Summary: This commit is the first step towards refactoring the lowering code in _lower_to_native_backend.py. The main changes included in this commit are: (1) Remove the use of the subgraph rewriter in lowering (2) Replace the use of `is_match` with manual pattern matching The motivation behind (2) is it simplifies the lowering code significantly; previously we had many different but similar patterns for slightly different models. There should be no change in behavior with this PR. Note that this is only part 1 of the refactoring. Part 2 will merge the static and dynamic lowering code paths and refactor the currently duplicate pattern matching / cleanup code into common helper functions. Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Reviewers: jerryzh168 Subscribers: jerryzh168 ghstack-source-id: de7bbb7 Pull Request resolved: #74128
**Summary:** This commit is the first step towards refactoring the lowering code in _lower_to_native_backend.py. The main changes included in this commit are: (1) Remove the use of the subgraph rewriter in lowering (2) Replace the use of `is_match` with manual pattern matching The motivation behind (2) is it simplifies the lowering code significantly; previously we had many different but similar patterns for slightly different models. There should be no change in behavior with this PR. Note that this is only part 1 of the refactoring. Part 2 will merge the static and dynamic lowering code paths and refactor the currently duplicate pattern matching / cleanup code into common helper functions. **Test Plan:** python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps **Reviewers:** jerryzh168 **Subscribers:** jerryzh168 [ghstack-poisoned]
Summary: This commit is the first step towards refactoring the lowering code in _lower_to_native_backend.py. The main changes included in this commit are: (1) Remove the use of the subgraph rewriter in lowering (2) Replace the use of `is_match` with manual pattern matching The motivation behind (2) is it simplifies the lowering code significantly; previously we had many different but similar patterns for slightly different models. There should be no change in behavior with this PR. Note that this is only part 1 of the refactoring. Part 2 will merge the static and dynamic lowering code paths and refactor the currently duplicate pattern matching / cleanup code into common helper functions. Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Reviewers: jerryzh168 Subscribers: jerryzh168 ghstack-source-id: 630d882 Pull Request resolved: #74128
|
@andrewor14 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
Ok, I updated the PR description with more details about the refactor. Provided that the tests pass this PR is ready from my side |
Summary: This commit is the first step towards refactoring the lowering code in _lower_to_native_backend.py. The main changes included in this commit are: (1) Remove the use of the subgraph rewriter in lowering (2) Replace the use of `is_match` with manual pattern matching The motivation behind (2) is it simplifies the lowering code significantly; previously we had many different but similar patterns for slightly different models. There should be no change in behavior with this PR. Note that this is only part 1 of the refactoring. Part 2 will merge the static and dynamic lowering code paths and refactor the currently duplicate pattern matching / cleanup code into common helper functions. Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Reviewers: jerryzh168 Subscribers: jerryzh168 ghstack-source-id: 630d882 Pull Request resolved: #74128
Summary: Pull Request resolved: #74128 **Summary:** This commit is the first step towards refactoring the lowering code in _lower_to_native_backend.py. The main changes included in this commit are: (1) Remove the use of the subgraph rewriter in lowering (2) Replace the use of `is_match` with manual pattern matching The motivation behind (2) is it simplifies the lowering code significantly; previously we had many different but similar patterns for slightly different models. There should be no change in behavior with this PR. Note that this is only part 1 of the refactoring. Part 2 will merge the static and dynamic lowering code paths and refactor the currently duplicate pattern matching / cleanup code into common helper functions. **Test Plan:** python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps **Reviewers:** jerryzh168 **Subscribers:** jerryzh168 Test Plan: Imported from OSS Reviewed By: jerryzh168 Differential Revision: D34910597 Pulled By: andrewor14 fbshipit-source-id: c6fea0c538ce5efc5afaf53e072922528988dda7
|
Hey @andrewor14. |
Stack from ghstack (oldest at bottom):
Summary: This commit is the first step towards refactoring the
lowering code in _lower_to_native_backend.py. The main changes
included in this commit are:
(1) Remove the use of the subgraph rewriter in lowering
(2) Replace the use of
is_matchwith manual pattern matchingThe motivation behind (2) is it simplifies the lowering code
significantly; previously we had many different but similar
patterns for slightly different models. There should be no
change in behavior with this PR.
Note that this is only part 1 of the refactoring. Part 2
will merge the static and dynamic lowering code paths
and refactor the currently duplicate pattern matching /
cleanup code into common helper functions.
Test Plan:
python test/test_quantization.py TestQuantizeFx
python test/test_quantization.py TestQuantizeFxOps
Reviewers: jerryzh168
Subscribers: jerryzh168
Differential Revision: D34910597