TECHNOLOGY

ONNX Runtime prepacked reload: identical bytes can require the same alignment contract

In this article
THE QUICK TAKE

The 1.32 prepacked alignment repair protects save/reload semantics; checksums alone cannot validate address-dependent packed-weight interpretation.

ONNX Runtime 1.32.0 notes preservation of 256-byte prepacked-weight alignment across save and reload. The linked analysis describes packed-region interpretation depending on absolute pointer alignment. Byte-identical serialized weights can therefore behave differently after loading if the storage address violates the packed kernel’s assumptions, making round-trip inference a necessary artifact check.

Serialization preserves bytes, not their address

A file checksum proves content identity, but the loader chooses a new memory address. If packed-region offsets depend on alignment, that address participates in the execution contract. The PR aligns saved blobs and uses aligned storage when a mapping cannot satisfy the requirement. A proposed regression compares original and reloaded inference with the same input, then verifies alignment separately rather than assuming the checksum settles numerical equivalence.

Legacy files can take a different load route

Upstream discusses aligned-copy fallback for older unaligned blobs or mapping failures. That can preserve correctness while changing memory residency and load cost. A local test should include a newly saved artifact and a legacy-layout artifact where available. Report whether zero-copy mapping or a heap copy was used; otherwise a correct compatibility fallback can look like an unexplained memory regression after the update.

Use the affected packed kernel path

The PR’s reproduction concerns a specific CPU MatMulNBits packed configuration. An ordinary unprepacked matrix test does not exercise serialization of that representation. Preserve the relevant accuracy setting, CPU path and weight preparation when adapting the test. Distinguishable inputs should cover the whole output, since a partial alignment error can leave some values plausible. Record the actual loaded library and CPU capabilities with the result.

Round-trip correctness comes before startup claims

Saving prepacked weights aims to reuse preparation work, but faster loading is irrelevant if the restored model computes the wrong function. Validate outputs and storage requirements before timing startup. This article reports the release alignment contract and proposed legacy/new artifact checks, without claiming independent platform verification or a universal memory reduction. Correct fallback can intentionally use more host memory than a valid aligned mapping.

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