In this article
The 1.32 constant-sharing fix relies on existing set insertion semantics; test consumer identity and startup scaling without changing constant equivalence rules.
ONNX Runtime 1.32.0 includes an initialization fix in constant sharing that removes a redundant consumer-list search. The linked PR explains that the graph’s consumer insertion already deduplicates through a set. Repeating another growing-list check added avoidable work as duplicate initializers were replaced, turning a storage-saving transformation into a startup bottleneck.
Duplicate protection can itself be duplicated
Checking a list before an insertion is unnecessary if the insertion API already rejects duplicates correctly. The PR removes that extra layer in this path. A proposed review should verify the actual API contract rather than generalizing that duplicate checks are always wasteful. The optimization is justified by a specific set-backed operation, not by assuming every graph adjacency structure safely ignores repeated edges.
Fanout makes the cost visible
Many duplicate constants redirected to one shared initializer can create a large consumer set. A proposed stress case varies duplicate count and fanout independently, then measures transformation time. A tiny model with no repeated constants does not exercise the mechanism. Preserve the same constant contents while varying graph structure so the comparison targets consumer bookkeeping rather than a different amount of tensor data to hash or compare.
Consumer identity must remain correct
After sharing, verify that every intended node references the canonical initializer and that no consumer is missing or spuriously added. Include a node using the same initializer in more than one input position where supported, because node-level consumer sets and edge positions are different concepts. A valid numerical result on one path does not prove that every redirected reference survived the bookkeeping change.
Keep storage savings separate from startup savings
The release change speeds bookkeeping for sharing that already existed. It does not automatically make additional constants equivalent or guarantee a smaller model file. Measure transformation cost and resulting storage as separate outcomes. This article reports the implementation rationale and proposed fanout test without new benchmarks. The useful result is the same correct shared graph constructed with less redundant consumer-list work.
Sources
Related reading
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.