pytorch
a7054869 - [Quant][fx] Refactor lowering code (part 1) (#74128)

Commit
3 years ago
[Quant][fx] Refactor lowering code (part 1) (#74128) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/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 (cherry picked from commit fa05cb9fc0909fe6e199a6b50ea2001c9e9ac0ee)
Author
Committer
Parents
Loading