-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DML EP] DML Graph Serialization Bug #19748
Merged
Merged
Conversation
This file contains 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
This makes a minimal change to address a crash caused by the PadFusion pass. This pass assumed that the "pads" attribute of a child node existed, and it now skips when it's missing.
onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp
Outdated
Show resolved
Hide resolved
onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp
Outdated
Show resolved
Hide resolved
/azp run Windows CPU CI Pipeline |
Azure Pipelines successfully started running 1 pipeline(s). |
PatriceVignola
previously approved these changes
Mar 12, 2024
fdwr
reviewed
Mar 16, 2024
onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp
Outdated
Show resolved
Hide resolved
Does it need be in 1.17.3 patch release? |
onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp
Show resolved
Hide resolved
PatriceVignola
approved these changes
Mar 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
TedThemistokleous
pushed a commit
to TedThemistokleous/onnxruntime
that referenced
this pull request
May 7, 2024
### Description This pull request addresses several issues: - The DML Graph's nodes were not sorted in a topologically ordered sequence, leading to crashes during deserialization when a child node preceded its parent node. This PR resolves this issue by implementing a topological sorting algorithm before serialization. - During the `RemoveUnconnectedNodes` process: - we update `intermeidateEdge.FromNodeIndex`. Additionally, we must update `intermediateEdge.Name` when it includes `intermediateEdge.FromNodeIndex`, as serialization/deserialization heavily relies on edge names. - we also eliminate unused edges. Consequently, we must erase inputs (now unused) from corresponding maps `serializedGraphInputIndexToSubgraphInputIndex` and `serializedGraphLargeConstantNameToSubgraphInputIndex`. ### Motivation and Context Why is this change required? What problem does it solve? There are few ONNX Zoo public models which were crashing during deserialization. <!-- - - If it fixes an open issue, please link to the issue here. --> --------- Co-authored-by: Jeff Bloomfield <[email protected]>
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
This pull request addresses several issues:
The DML Graph's nodes were not sorted in a topologically ordered sequence, leading to crashes during deserialization when a child node preceded its parent node. This PR resolves this issue by implementing a topological sorting algorithm before serialization.
During the
RemoveUnconnectedNodes
process:we update
intermeidateEdge.FromNodeIndex
. Additionally, we must updateintermediateEdge.Name
when it includesintermediateEdge.FromNodeIndex
, as serialization/deserialization heavily relies on edge names.we also eliminate unused edges. Consequently, we must erase inputs (now unused) from corresponding maps
serializedGraphInputIndexToSubgraphInputIndex
andserializedGraphLargeConstantNameToSubgraphInputIndex
.Motivation and Context
Why is this change required? What problem does it solve?
There are few ONNX Zoo public models which were crashing during deserialization.