Repository navigation
Skip overridable initializer fusion - #32143
Merged
Akshay Sonawane (apsonawane) merged 2 commits intoAug 20, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents fusion of overridable initializers, preserving runtime input semantics.
Changes:
- Uses constant-initializer detection before fusion.
- Adds regression coverage for initializer-backed graph inputs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
onnxruntime/core/optimizer/fuse_initializers_transformer.cc |
Restricts fusion to constant initializers. |
onnxruntime/test/optimizer/fuse_initializers_transformer_test.cc |
Tests that overridable initializers remain unfused. |
π‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Akshay Sonawane (apsonawane)
enabled auto-merge (squash)
August 18, 2026 00:41
Ti-Tai Wang (titaiwangms)
approved these changes
Aug 20, 2026
Akshay Sonawane (apsonawane)
deleted the
fix/fuse-initializers-overridable-input
branch
August 20, 2026 17:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the logic for determining whether a node's input is a valid initializer for fusion and adds a new unit test to ensure that initializers which can be overridden (i.e., initializers that are also graph inputs) are properly skipped during fusion. The main changes are:
Logic Update
IsNodeValidForFusion, the check for a valid initializer now usesgraph_utils::GetConstantInitializer, ensuring that only constant initializers (not those that can be overridden by graph inputs) are considered valid for fusion.Testing Improvements
FuseInitializersSkipsOverridableInitializer, to verify that the transformer skips fusion for initializers that are also graph inputs and can be overridden. This test ensures the fusion transformation does not incorrectly modify such initializers.graph_transform_test_builder.hheader to support the new test.