[Paper Review] QONNX: Representing Arbitrary-Precision Quantized Neural Networks
This paper introduces QONNX, a novel high-level intermediate representation for arbitrary-precision quantized neural networks built on ONNX. It extends existing ONNX formats with backward-compatible clipping-based quantization and proposes three new operators—Quant, BipolarQuant, and Trunc—to enable flexible, platform-agnostic representation of uniform quantization, enabling interoperability across QAT frameworks and FPGA toolchains like FINN and hls4ml, with a public model zoo released for benchmarking and sharing.
We present extensions to the Open Neural Network Exchange (ONNX) intermediate representation format to represent arbitrary-precision quantized neural networks. We first introduce support for low precision quantization in existing ONNX-based quantization formats by leveraging integer clipping, resulting in two new backward-compatible variants: the quantized operator format with clipping and quantize-clip-dequantize (QCDQ) format. We then introduce a novel higher-level ONNX format called quantized ONNX (QONNX) that introduces three new operators -- Quant, BipolarQuant, and Trunc -- in order to represent uniform quantization. By keeping the QONNX IR high-level and flexible, we enable targeting a wider variety of platforms. We also present utilities for working with QONNX, as well as examples of its usage in the FINN and hls4ml toolchains. Finally, we introduce the QONNX model zoo to share low-precision quantized neural networks.
Motivation & Objective
- To address the lack of a standardized, high-level representation for quantized neural networks (QNNs) across deep learning frameworks and hardware toolchains.
- To enable backward-compatible representation of sub-8-bit quantization in ONNX using integer clipping, extending existing formats like QDQ and quantized operators.
- To design a higher-level, expressive ONNX format—QONNX—that abstracts quantization details and supports tensor-wise and channel-wise quantization via broadcast semantics.
- To enable seamless integration with existing quantization-aware training (QAT) frameworks like Brevitas and QKeras, and FPGA compilation toolchains such as FINN and hls4ml.
- To establish a public QONNX model zoo to share and benchmark low-precision quantized models across diverse datasets and bit-width configurations.
Proposed method
- Extends existing ONNX quantization formats—quantized operator format and QDQ—by introducing integer clipping to support sub-8-bit quantization in a backward-compatible manner.
- Proposes two new low-level formats: quantized operator format with clipping and quantize-clip-dequantize (QCDQ), enabling representation of low-precision quantized tensors with bounded integer values.
- Introduces QONNX, a high-level ONNX IR with three new operators: Quant (for uniform quantization), BipolarQuant (for binary or bipolar quantization), and Trunc (for truncation-based quantization).
- Uses broadcast semantics in QONNX to generalize quantization to tensor-wise and channel-wise settings, increasing expressiveness and portability.
- Develops software utilities for shape inference, constant folding, and conversion pipelines to transform QONNX models into toolchain-specific formats (e.g., FINN-ONNX).
- Enables end-to-end model ingestion in FPGA compilers like FINN and hls4ml by converting QONNX to their native ONNX dialects via automated conversion steps.
Experimental results
Research questions
- RQ1How can sub-8-bit quantized neural networks be represented in ONNX in a backward-compatible way without breaking existing toolchains?
- RQ2What high-level, abstract ONNX representation can flexibly express arbitrary-precision uniform quantization while supporting diverse quantization schemes like tensor-wise and channel-wise quantization?
- RQ3Can a unified intermediate representation like QONNX enable seamless interoperability between QAT frameworks (e.g., Brevitas, QKeras) and FPGA compilation toolchains (e.g., FINN, hls4ml)?
- RQ4How can a standardized, extensible model zoo of low-precision quantized models be established to support benchmarking and community sharing?
- RQ5What is the impact of different bit-width configurations on model accuracy and computational cost in low-precision inference scenarios?
Key findings
- QONNX enables the representation of quantized neural networks with arbitrary bit-widths, including sub-8-bit precision, through a high-level, extensible ONNX-based IR.
- The QCDQ and quantized operator with clipping formats allow backward-compatible representation of low-precision quantization in existing ONNX toolchains.
- The QONNX model zoo includes 7 benchmark models across MNIST, CIFAR-10, and ImageNet, with accuracy ranging from 71.14% (MobileNet-w4a4) to 96.60% (TFC-w2a2), demonstrating practical deployment across datasets.
- Models in the QONNX model zoo exhibit a wide range of computational complexity, from 59k BOPs (TFC-w1a1) to over 74 billion BOPs (MobileNet-w4a4), reflecting diverse efficiency and accuracy trade-offs.
- The integration pipeline successfully converts QONNX models into FINN-ONNX format, enabling full compilation and deployment on FPGAs using the FINN toolchain.
- The proposed QONNX format abstracts quantization details while preserving expressiveness, enabling broader hardware support and future standardization within the ONNX community.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.