Repository navigation
Fix FuseInitializersTransformer consumer input lookup - #32426
Merged
Xavier Dupré (xadupre) merged 2 commits intoSep 8, 2026
Merged
Xavier Dupré (xadupre) merged 2 commits into
Xavier Dupré (xadupre) merged 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Sylvester Kaczmarek (sylvesterkaczmarek)
September 3, 2026 18:03
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix addresses the reported crash and includes adequate regression coverage.
Pull request overview
Fixes initializer fusion when Cast node and output names differ, preventing out-of-bounds access.
Changes:
- Match consumer inputs using the Cast output value name.
- Enforce that a matching consumer input exists.
- Add regression coverage for independently named nodes and values.
File summaries
| File | Description |
|---|---|
onnxruntime/core/optimizer/fuse_initializers_transformer.cc |
Corrects consumer input lookup and adds a bounds guard. |
onnxruntime/test/optimizer/fuse_initializers_transformer_regression_test.cc |
Verifies successful fusion with differing Cast node/output names. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Xavier Dupré (xadupre)
approved these changes
Sep 4, 2026
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.
Description
Fixes #32405.
FuseInitializersTransformerlocates the consumer input to replace by comparing the producer node name with consumer input value names. ONNX does not require node names and output value names to match.When they differ, the lookup can reach the end of
InputDefs()and the following access can go out of bounds.The transformer now matches the consumer input against the Cast node's output value name and guards against an unexpected missing match.
Tests
Adds a regression test where the Cast node name differs from its output value name, matching the failure reported in #32405.