﻿# llama.cpp Hexagon IQ2_XXS: tiny weights test a different failure than ordinary quantization error

The b12376 Hexagon IQ2_XXS work includes small-scale underflow coverage; compare the same quantized weights across HVX and HMX dispatch paths.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-hexagon-iq2xxs-small-scale-underflow/
Language: en

llama.cpp b12376 adds Hexagon IQ2_XXS and NVFP4 weight paths, including a fix for F16 scale underflow in HMX IQ2_XXS dequantization. The PR’s small-weight tests are a meaningful part of that support: broad ordinary-range testing can miss a scale that vanishes only at the low end of the numeric range.

## Underflow can erase the scale

The PR identifies an F16 scale-underflow issue in the HMX dequantization path. That is distinct from the expected approximation error introduced when the original weights were quantized. If an intermediate scale becomes zero, the runtime may lose information already present in the quantized representation. A useful reference therefore starts from the same stored quantized weights, not from a different higher-precision model with its own unavoidable quantization difference.

## Small inputs need a deliberate test distribution

Random values drawn from a comfortable range may rarely exercise a tiny scale. The upstream work adds small-weight cases specifically for this risk. An independent test should vary scale magnitude deliberately while preserving nonzero reference outputs, then inspect absolute and relative errors with care. A relative metric alone becomes unstable near zero, while an overly generous absolute tolerance can hide complete disappearance of a small result.

## Cross the vector-to-matrix dispatch boundary

Upstream documents HVX kernels for small activation-column counts and HMX paths for larger ones. A tiny-batch result therefore cannot validate the HMX correction by itself. Compare neighbouring column counts across the route boundary using the same weights and a trusted reference. This isolates a backend implementation difference from a change in quantization. Preserve matrix dimensions in the report rather than describing both runs only as the same model.

## Format support includes numerical edge cases

A new supports-op entry and a working ordinary example are useful but incomplete evidence for a low-bit backend. Repacking, scale interpretation and both execution paths need coverage. The PR reports its own checks; this article proposes how to retain the relevant edge case in another qualification suite. It does not claim a new accuracy score for an IQ2_XXS model or generalize the repaired underflow to every low-precision format.

## Sources

- [llama.cpp b12376 release](https://github.com/ggml-org/llama.cpp/releases/tag/b12376)
- [llama.cpp pull request #31954](https://github.com/ggml-org/llama.cpp/pull/31954)

## Related reading

- [llama.cpp b12202 and the difference between a precision request and an accumulator](/journal/news-llamacpp-b12202-precision-request-vs-accumulator/)
- [Choosing a GGUF file for llama.cpp](/journal/llama-cpp-gguf-selection/)
