﻿# ONNX Runtime weightless modes: a smaller compiled artifact can require the source model later

Explicit weightless modes in 1.32 expose different runtime dependencies; validate the deployed bundle instead of judging completeness by compiled file size.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-ort-weightless-explicit-mode-dependencies/
Language: en

ONNX Runtime 1.32.0 replaces a weightless on/off choice with explicit modes and recorded external dependencies. The linked PR distinguishes ALL from EXTERNAL_ONLY because their runtime source requirements differ. Reducing what a compiled artifact contains therefore changes its deployment bundle, rather than making the omitted weights or source dependencies unnecessary.

## Provider capability and application choice differ

An EP can advertise several supported modes, while the application requests one concrete mode. The PR explicitly separates the combined capability value from valid application requests. A proposed compatibility test covers an EP supporting both modes and applications able to supply different runtime assets. Choosing the most demanding mode automatically would reintroduce the problem the interface is designed to avoid: a provider update changing requirements the application cannot satisfy.

## Recorded dependencies belong in packaging

The release records weightless mode and external dependency metadata in compiled models. A deployment check should resolve those requirements from the actual bundle and test a fresh process without the development workspace available. A local source path that happens to exist can conceal a missing packaged asset. Include a deliberately absent dependency case and verify the expected warning or failure, rather than only testing the fully populated development environment.

## Explicit options need exact validation

The PR accepts specific mode strings and rejects invalid values rather than interpreting arbitrary truthy text. It also preserves older APIs when the new choice is absent. A proposed migration suite tests precedence, invalid values and an older provider interface. Configuration parsing is part of compatibility: a silently accepted misspelling can select another dependency policy even when the application believes it requested the intended mode.

## Smaller storage is not a standalone performance result

External resolution can move work into startup or runtime. Measure loading and execution with the chosen bundle after correctness checks, not only compiled-file bytes. This article reports the mode/dependency contract and proposed packaging tests without new benchmark claims. The useful result is an explicitly selected mode whose required assets are available and whose numerical output matches the intended source computation.

## Sources

- [ONNX Runtime v1.32.0 release](https://github.com/microsoft/onnxruntime/releases/tag/v1.32.0)
- [ONNX Runtime pull request #32899](https://github.com/microsoft/onnxruntime/pull/32899)

## Related reading

- [ONNX external data: release the graph and relative tensor files together](/journal/fg2-onnx-external-data-relative-artifact-release/)
- [ONNX Runtime offline optimization: a saved optimized graph inherits a target contract](/journal/fg2-onnxruntime-offline-graph-target-compatibility/)
