pytorch/test/quantization
Andrew Or 8fab682e47 [Quant][fx][bc-breaking] Do not move models to CPU in convert (#80555)
Summary: Previously, we automatically moved the model to CPU in
torch.ao.quantization.fx.convert to work around the issue where
certain functions called by convert expect CPU arguments. This
commit pushes this responsibility to the caller since it is the
user's decision of which device to use.

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

BC-breaking Notes:

Before:
```
model = resnet18(...)
model = prepare_fx(model, qconfig_mapping, example_inputs)
... # calibrate
model = convert_fx(model)
```
After:
```
model = resnet18(...)
model.cpu()
model = prepare_fx(model, qconfig_mapping, example_inputs)
... # calibrate
model = convert_fx(model)
```

Reviewers: jerryzh168

Subscribers: jerryzh168

Differential Revision: [D37528830](https://our.internmc.facebook.com/intern/diff/D37528830)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80555
Approved by: https://github.com/jerryzh168
2022-07-08 19:23:57 +00:00
..
ao_migration fx quant: refactor qconfig setting out of find_matches 2022-06-17 18:52:00 +00:00
bc [quant][fx][bc-breaking] Add required example_args argument to prepare_fx and prepare_qat_fx (#249) (#77608) 2022-05-21 21:03:48 +00:00
core [Quant] Add fast path of qmean/qstd for quantized CPU (reopen #70172) (#80579) 2022-07-05 16:00:04 +00:00
dbr [quant][fx][bc-breaking] Add required example_args argument to prepare_fx and prepare_qat_fx (#249) (#77608) 2022-05-21 21:03:48 +00:00
eager Fix ONNX ATen fallback for non-caffe2 engines 2022-04-14 23:18:45 +00:00
fx [Quant][fx][bc-breaking] Do not move models to CPU in convert (#80555) 2022-07-08 19:23:57 +00:00
jit extend replaceConvolutionWithAtenConv to handle conv_transpose3d (#76888) 2022-05-13 16:40:12 +00:00
serialized [Quant][fx] Reenable serialization test after convert refactor (#74204) 2022-03-15 03:51:14 +00:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00