pytorch/torch/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
..
fx Add Custom Module Support List (#82606) 2022-08-03 17:48:51 +00:00
__init__.py [On Device Quantization][pytorch]Make insert_quant_dequant support ondevice ptq (#83570) 2022-08-29 17:51:00 +00:00
_numeric_suite_fx.py
_numeric_suite.py
fake_quantize.py [quant][fx][improvement] Renamed default_affine_fixed_qparams_observer and default_symmetric_fixed_qparams_observer (#76637) 2022-05-04 02:39:20 +00:00
fuse_modules.py
fuser_method_mappings.py
observer.py
qconfig.py
quant_type.py
quantization_mappings.py
quantize_fx.py
quantize_jit.py [Quantization][Pytorch] On device quantization support part 1 (#83568) 2022-08-29 17:22:30 +00:00
quantize.py
stubs.py
utils.py