Zhen-Dong / HAWQ

Quantization library for PyTorch. Support low-precision and mixed-precision quantization, with hardware implementation through TVM.
MIT License
410 stars 83 forks source link

Add qonnx support #40

Closed jicampos closed 2 years ago

jicampos commented 2 years ago

Adding support to export quantized models to the QONNX format. All layers are supported in this format. While not many model architectures were tested, an MLP and CNN were heavily used with varying settings, such as symmetric and asymmetric quantization, bit-width, etc. A README.md was added to showcase the simplicity of exporting models and executing the onnx graph.

An additional directory labeled export has been added to utils. All other files and directories are left unchanged. After exporting models, we perform a post-export optimization step with python packages that need to be installed. These packages are onnx, qonnx, and onnxoptimizer.

This PR does not include support for BinaryQuant nodes. This has been left for a future PR along with further onnx optimizations.