# QONNX

An extension to ONNX with custom operators for arbitrary-precision integer and minifloat quantization, plus Python utilities for executing, transforming and analyzing quantized neural network models.

QONNX (Quantized ONNX) adds custom operators, IntQuant, FloatQuant, BipolarQuant and Trunc, to represent binary, ternary, 3-bit, 4-bit, 6-bit and other integer or fixed-point quantization, as well as minifloat quantization with configurable exponent and mantissa bits, directly in ONNX graphs, with quantized values still stored as standard float datatypes so models remain ONNX protobuf-compatible.

Its Python utilities execute QONNX models for functional verification, perform shape inference and constant folding, summarize a model's inference cost in mixed-precision MACs and parameter and activation volume, and support writing custom transformations and executable ops, including experimental conversion from standard NCHW layout to QONNX's NHWC layout. Quantization-aware training frameworks such as Brevitas can export to QONNX, and inference frameworks such as FINN and hls4ml can import it for FPGA dataflow deployment. Apache-2.0 licensed, installed with pip.

Website: https://qonnx.readthedocs.io/
