Fix ReshapeFusion shape-input traversal - #32110
Draft
Igor Stadnyk (fallenmi) wants to merge 1 commit into
Draft
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Igor Stadnyk (@fallenmi) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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 #32105.
Motivation and Context
FuseContiguousReshapesfollowed a node's sole output consumer without checking the destination input slot. When a Reshape output supplied input 1 (shape) of another Reshape, the optimizer treated that int64 shape path as a float data path and created a type-invalid_new_reshape.The regression intentionally removes the issue reproducer's irrelevant Cast while preserving the faulty int64 shape-edge relationship. It fails on
mainduring target session initialization with the reportedtensor(float)versustensor(int64)error.Validation
main: the new test fails atInferenceSession::Initialize()with the reported type mismatchGraphTransformationTests.ReshapeFusion*: 23/23 passedonnxruntime_test_all: 1,937 passed, 17 skipped (1,954 total)lintrunner --all-filesgit diff --checkAI assistance disclosure: OpenAI Codex helped investigate and draft this change; I reproduced the bug, reviewed the patch, and ran the validation listed above.