-
- Downloads
Loss Aware Post Train Quantization search (#432)
"Loss Aware Post-Training Quantization" (Nahshan et al., 2019) Paper: https://arxiv.org/abs/1911.07190 Reference implementation: https://github.com/ynahshan/nn-quantization-pytorch/tree/master/lapq Proper documentation is still TODO, for now see the example YAML file at 'examples/quantization/post_train_quant/resnet18_imagenet_post_train_lapq.yaml' * Implemented in distiller/quantization/ptq_coordinate_search.py * At the moment that file both the model-independent algorithm implementation and image-classification specific sample script. Still TODO: Refactor that * Post train quantization changes (range_linear): * Added getters/setters for quantization parameters (scale/zero_point) and clipping values * Add option to save backup of FP32 weights to allow re-quantization after quantizer was created. * Add option to clip weights in addition to activations * Fix fusions to not occur only when activations aren't quantized * RangeLinearFakeQuantWrapper: * Make inputs quantization optional * In case of ReLU + ACIQ, clip according to input stats * Data loaders: * Add option to not load train set at all from disk (to speed up loading time in post-training runs) * Modified "image_classifier.py" accordingly
Showing
- distiller/apputils/data_loaders.py 75 additions, 59 deletionsdistiller/apputils/data_loaders.py
- distiller/apputils/image_classifier.py 9 additions, 4 deletionsdistiller/apputils/image_classifier.py
- distiller/quantization/ptq_coordinate_search.py 515 additions, 0 deletionsdistiller/quantization/ptq_coordinate_search.py
- distiller/quantization/quantizer.py 5 additions, 0 deletionsdistiller/quantization/quantizer.py
- distiller/quantization/range_linear.py 424 additions, 76 deletionsdistiller/quantization/range_linear.py
- distiller/utils.py 9 additions, 1 deletiondistiller/utils.py
- examples/quantization/post_train_quant/resnet18_imagenet_post_train_lapq.yaml 101 additions, 0 deletions...n/post_train_quant/resnet18_imagenet_post_train_lapq.yaml
- tests/test_post_train_quant.py 33 additions, 22 deletionstests/test_post_train_quant.py
Loading
Please register or sign in to comment