skillfed

qonnx

Frontend and utilities for QONNX

qonnx v1.0.0 74.0K downloads/30d#14,888 on PyPI191
Permissive license Apache-2.0 Active released

What it is and what it does

QONNX is a toolkit for representing and working with quantized neural networks in ONNX format. It introduces custom operators—IntQuant, FloatQuant, BipolarQuant, and Trunc—that enable arbitrary-precision integer and minifloat quantization while remaining compatible with standard ONNX protobuf. Quantized values are stored as standard floats to maintain compatibility.

The package provides utilities for executing QONNX models for functional verification, performing shape inference and constant folding, calculating inference costs in terms of mixed-precision MACs and memory volume, and transforming models between quantization representations. It integrates with quantization-aware training frameworks like Brevitas, QKeras, and HAWQ for export, and supports deployment via FPGA-focused frameworks like FINN and hls4ml.

Use it for:

  • Export quantized models from Brevitas or QKeras and verify their behavior by executing them with QONNX utilities
  • Analyze inference cost of a quantized model in terms of bit operations, memory footprint, and per-layer MAC counts
  • Convert quantized models from QONNX representation to QCDQ-style quantization for different deployment targets
  • Develop custom quantization transformations and executable operators using QONNX's Python infrastructure
  • Prepare quantized neural networks for FPGA deployment via FINN or hls4ml by using QONNX as an intermediate representation

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

QONNX provides Python utilities to work with quantized neural networks in ONNX format, including custom operators for arbitrary-precision integer and minifloat quantization, model execution, shape inference, and inference cost analysis.

Yes, if you work with quantized neural networks and need a common representation for export, analysis, or deployment. The package is actively maintained, has no known vulnerabilities, uses permissive licensing, and integrates with established QAT frameworks and FPGA toolchains. Install friction is low. Not necessary if you only work with standard full-precision ONNX models.

Install

qonnx on PyPI

pip

pip install qonnx

uv

uv add qonnx

poetry

poetry add qonnx

Installing qonnx

Before you install

Low friction installation with a pure-Python wheel. Active maintenance as of June 2026 with 191 repository stars. Depends on 11 runtime packages including numpy, onnx, onnxruntime, and protobuf—all established libraries.

License in practice

Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.

Quickstart

pip install qonnx

from qonnx.core.modelwrapper import ModelWrapper
from qonnx.core.onnx_exec import execute_onnx
import numpy as np

model = ModelWrapper("my-qonnx-model.onnx")
idict = {"in0": np.load("in0.npy"), "in1": np.load("in1.npy")}
odict = execute_onnx(idict)

Verify before relying

  • Minimum Python version requirement (requires_python field is unspecified in metadata)
  • Whether all 11 runtime dependencies are strictly required or if some are optional for specific features

Package facts

License Apache-2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 11 — importlib-metadata, attrs, clize, protobuf, bitstring, numpy, onnx, onnxruntime, onnxscript, sigtools, toposort
Maintenance actively maintained — 176 days since the last release
Last repo commit
First released
Downloads 74,027/month — #14,888 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: qonnx-1.0.0-py2.py3-none-any.whl

Development Status :: 4 - BetaProgramming Language :: Python

Tags

quantized neural networks ONNXarbitrary precision quantizationONNX model executioninference cost analysismixed precision neural networksquantization aware training exportONNX custom operators
quantizationneural-networksonnx

More Artificial Intelligence packages