pytorch/test/quantization
Angela Yi 9b94aa5356 [quant][fx][fix] Fused modules with object_type in qconfig (#60779)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60779

When we do fusion, we replace certain modules (such as Linear + ReLU) with fused versions (such as LinearReLU) by calling `_fuse_fx` in prepare_fx. However when we try to look up using the fused module type in qconfig_dict, we cannot find a match anymore since the qconfig dict contains the original module types. An example is here [N882873](https://fburl.com/anp/azenjx3v).

So we will now update the qconfig_dict to include the fused modules mapping to the qconfigs used for the modules that make up the fused modules. If the modules are not mapped to the same qconfig, then we will raise an error.

Test Plan:
`python test/test_quantization.py TestFuseFx.test_qconfig_fused_module`

Imported from OSS

Reviewed By: supriyar

Differential Revision: D29406941

fbshipit-source-id: 74b5db89f4998aeb02b2bf7c37bf97326580c654
2021-06-28 15:22:22 -07:00
..
bc Introduce quantized convolution serialization format 3 (#60241) 2021-06-24 20:52:43 -07:00
core Fix quantized mean operator in QNNPACK backend (#59761) 2021-06-14 17:30:21 -07:00
eager [quant][eager][fix] Fix a typo in convert function in eager mode quantization (#59571) 2021-06-08 10:24:22 -07:00
fx [quant][fx][fix] Fused modules with object_type in qconfig (#60779) 2021-06-28 15:22:22 -07:00
jit [jit] Set debug name for value coming out of GetAttr nodes. (#59123) 2021-06-09 12:24:55 -07:00
serialized Introduce quantized convolution serialization format 3 (#60241) 2021-06-24 20:52:43 -07:00
__init__.py