pytorch/torch/ao/quantization
Kimish Patel 446afb5f9f [On Device Quantization][pytorch]Make insert_quant_dequant support ondevice ptq (#83570)
Summary:
This diff adds a way to:
- clone previously observed method
- Add calls to observer's calculate_qparams methods
- Extract the scale and zero point
- Use them to insert quant dequant nodes

Now for forward method we have
- observe_forward
- quantize_forward

observe_forward is used post training to observer statistics. In the
case of dynamic PTQ this requires just running that method once to
update weight observer statistics.

quantize_forward method will be used to use the observer
statistics to calculate quantization parameters and apply that to quant
dequant op.

Subsequent diffs will replace dequant + op with their quantized op
counter parts and replace quantize ops with relevant packed params class
where possible

Test Plan:
To be written

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D38771419](https://our.internmc.facebook.com/intern/diff/D38771419)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83570
Approved by: https://github.com/jerryzh168
2022-08-29 17:51:00 +00:00
..
backend_config Fix use-dict-literal lint (#83718) 2022-08-24 00:26:46 +00:00
experimental [quant] Remove unneeded lines from APoT linear (#82909) 2022-08-08 11:30:24 +00:00
fx [quant][ao_migration] torch.nn.quantized._referencetorch.ao.nn.quantized._reference (#78715) 2022-08-25 16:50:36 +00:00
__init__.py [Quant][fx][bc-breaking] Replace qconfig_dict with a config object (#78452) 2022-05-30 18:30:07 +00:00
_correct_bias.py [quant][ao_migration] torch.nn.quantized.modulestorch.ao.nn.quantized.modules (#78713) 2022-08-25 16:50:33 +00:00
_equalize.py
_learnable_fake_quantize.py
fake_quantize.py [quant][better-engineering][bc-breaking] Removed quant_min/quant_max from fake_quant modules 2022-05-11 14:23:05 +00:00
fuse_modules.py Integrate xdoctest - Rebased (#82797) 2022-08-12 02:08:01 +00:00
fuser_method_mappings.py Fix use-dict-literal lint (#83718) 2022-08-24 00:26:46 +00:00
observer.py add qscheme check for quantization observer (#80126) 2022-08-25 10:03:19 +00:00
pattern.md
qconfig_mapping_utils.py [Quant][fx][bc-breaking] Replace qconfig_dict with a config object (#78452) 2022-05-30 18:30:07 +00:00
qconfig_mapping.py [quant][fx] Follow up fixes for qconfig validations for fixedqparams ops (#81010) 2022-07-14 18:06:23 +00:00
qconfig.py [quant][fx] Follow up fixes for qconfig validations for fixedqparams ops (#81010) 2022-07-14 18:06:23 +00:00
quant_type.py [Quant][fx][bc-breaking] Replace *custom_config_dict with config objects 2022-06-16 17:50:07 +00:00
quantization_mappings.py [quant][ao_migration] torch.nn.qattorch.ao.nn.qat (#78716) 2022-08-25 16:50:38 +00:00
quantization_types.py [quant][fx] Move backend_config folder to torch.ao.quantization 2022-04-19 15:38:57 +00:00
quantize_fx.py [quant][ao_migration] torch.nn.quantized.modulestorch.ao.nn.quantized.modules (#78713) 2022-08-25 16:50:33 +00:00
quantize_jit.py [On Device Quantization][pytorch]Make insert_quant_dequant support ondevice ptq (#83570) 2022-08-29 17:51:00 +00:00
quantize.py [quant][ao_migration] torch.nn.quantized.modulestorch.ao.nn.quantized.modules (#78713) 2022-08-25 16:50:33 +00:00
stubs.py
utils.py [Quant][fx][bc-breaking] Replace *custom_config_dict with config objects 2022-06-16 17:50:07 +00:00