TECHNOLOGY

ONNX Runtime small-range quantization: a subnormal scale is not automatically zero

In this article
THE QUICK TAKE

The 1.32 quantization repair preserves valid float16 subnormal scales; inspect exported small-range tensors rather than relying on model-load success.

ONNX Runtime 1.32.0 preserves representable float16 subnormal quantization scales instead of replacing them with one. The linked PR explains that the old substitution could zero small-range weights. This is an exporter-side numerical correction, distinct from a runtime kernel flushing an unrepresentable intermediate or from ordinary low-bit approximation error.

Representable small values still carry information

A scale can be smaller than the normal float16 range and still be representable. Replacing it with a convenient fallback changes the quantizer’s mapping. The PR preserves such values for scalar and blocked cases. A proposed regression starts with nonzero small-range weights, checks the exported scale and quantized codes, and reconstructs the weights. A tensor of all zeros is a useful control but cannot expose accidental zeroing of real small values.

Separate quantization from runtime execution

A corrected runtime cannot recover weights already exported as zero by a previous conversion. Re-run the relevant quantization step and inspect the new artifact before comparing inference. Preserve the original source model and quantizer settings, including datatype and blocked layout. Otherwise a release update that only swaps a runtime library may appear ineffective because the numerically damaged model file remains unchanged on disk.

Bias scales require their own coverage

The PR also addresses float16 QDQ bias handling when its scale underflows or clips. That is related but not identical to the weight-scale case. Include a model with meaningful bias and compare reconstructed contributions separately where possible. A weight-only test can pass while a bias path remains unexercised. Report both the quantized artifact properties and resulting numerical outputs, rather than treating a valid ONNX file as proof of preserved values.

Do not promise a universal accuracy gain

The release repairs preservation of a specific numeric range. Its effect on a task metric depends on whether a model contains affected weights or biases and how they influence outputs. This article reports the upstream conversion repair and an artifact-level test design, without claiming a new benchmark score. An unaffected model can legitimately produce identical results after re-export, while an affected model needs its own quality evaluation.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles