Handle missing initializers in allocation planner to fix crashes with DML provider#5244
Merged
Merged
Conversation
skottmckay
reviewed
Sep 22, 2020
skottmckay
reviewed
Sep 22, 2020
skottmckay
reviewed
Sep 22, 2020
Contributor
|
Are these changes validated by DML unit tests? |
Contributor
Author
This will be validated with WindowsAI tests. These have been blocked by the issue below, but the fix is about to merge to our fork. |
tianleiwu
pushed a commit
that referenced
this pull request
Sep 23, 2020
… DML provider (#5244) * Fix memory planning bug with DML EP * Address PR comments * Fix typo
tianleiwu
pushed a commit
that referenced
this pull request
Sep 23, 2020
… DML provider (#5244) * Fix memory planning bug with DML EP * Address PR comments * Fix typo
edgchen1
pushed a commit
that referenced
this pull request
Sep 24, 2020
… DML provider (#5244) * Fix memory planning bug with DML EP * Address PR comments * Fix typo
edgchen1
pushed a commit
that referenced
this pull request
Sep 24, 2020
… DML provider (#5244) * Fix memory planning bug with DML EP * Address PR comments * Fix typo
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 addresses crashes in certain models while creation sessions with the DML provider.
The problem is related to an optimization for memory size in which the DML graph partitioner transfers protobuf initializers out of the graph to manage itself. The presence of the initializer though is needed for the allocation planner to call ProcessDef for that value and initialize “reused_buffer_index". With that field left initialized to zero, the planner thinks it’s decided to reuse the same buffer for that initializer and for another value at index zero, causing that buffer to be freed too many times / too early.
The fix is to initialize reused_buffer_index to -1 and detect this case, as well as make the allocation planner a bit more brittle.