[qunat][graphmode][fx] Add a separate lower_to_native_backend function for relu ...
authorJerry Zhang <jerryzh@fb.com>
Wed, 25 Aug 2021 04:05:14 +0000 (21:05 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 25 Aug 2021 04:07:03 +0000 (21:07 -0700)
commitc8527bc39837e6c1e00fb770c0e158508279ba2c
treefdfa4c1b6c536e2977e06e9c077c392a742a66c2
parente69a1398cbe534874060460faf36af21d24ce6e7
[qunat][graphmode][fx] Add a separate lower_to_native_backend function for relu (#62861)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62861

This PR adds a lower_to_native_backend function to lower a quantized reference model
to a model that uses fbgemm/qnnpack ops. We'll gradually add support and remove
the fbgemm/qnnpack specific handling in quantization_patterns.py

Test Plan:
python test/test_quantization.py TestQuantizeFx
python test/test_quantization.py TestQuantizeFxOps

Imported from OSS

Reviewed By: vkuzo

Differential Revision: D30165828

fbshipit-source-id: de1149cd7e7c1840c17c251cd4d35004afd015b7
test/quantization/fx/test_quantize_fx.py
torch/quantization/fx/_lower_to_native_backend.py [new file with mode: 0644]
torch/quantization/fx/convert.py
torch/quantization/fx/lower_to_fbgemm.py [new file with mode: 0644]
torch/quantization/fx/lower_to_qnnpack.py [new file with mode: 0644]
torch/quantization/fx/quantization_patterns.py
torch/quantization/fx/quantized_fusion_patterns_and_replacements.py [new file with mode: 0644]