-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add version check for IAlloactor::GetStats #24989
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
Merged
Merged
Conversation
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
toothache
commented
Jun 9, 2025
skottmckay
previously approved these changes
Jun 9, 2025
skottmckay
previously approved these changes
Jun 9, 2025
yuslepukhin
reviewed
Jun 10, 2025
yuslepukhin
approved these changes
Jun 12, 2025
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.
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 5 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 5 pipeline(s). |
guschmue
pushed a commit
that referenced
this pull request
Jun 17, 2025
### Description <!-- Describe your changes. --> Add version check for IAlloactor::GetStats and IAllocatorImplWrappingOrtAllocator::GetStats. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> The ORT API maintains ABI and backward compatibility, allowing applications built with an older version to run with a newer one. However, when a user calls RegisterAllocator with a custom allocator, any new function pointers introduced in the newer version may contain invalid (garbage) values, as the older application is unaware of them. To address this, this PR adds version checks in OrtAllocatorImplWrappingIAllocator and IAllocatorImplWrappingOrtAllocator to ensure safe and compatible behavior when interfacing with potentially newer ORT structures.
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
Add version check for IAlloactor::GetStats and IAllocatorImplWrappingOrtAllocator::GetStats.
Motivation and Context
The ORT API maintains ABI and backward compatibility, allowing applications built with an older version to run with a newer one. However, when a user calls RegisterAllocator with a custom allocator, any new function pointers introduced in the newer version may contain invalid (garbage) values, as the older application is unaware of them.
To address this, this PR adds version checks in OrtAllocatorImplWrappingIAllocator and IAllocatorImplWrappingOrtAllocator to ensure safe and compatible behavior when interfacing with potentially newer ORT structures.