Conversation
…ith 'import' and 'import from' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Contributor
Author
|
@adrianlizarraga / @skottmckay, mind taking a look at this one whenever you can? Fills in some missing language bindings for that recently added API to get compat info from the model metadata. Thanks! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Python and C# bindings (plus tests) for the new C API helpers that extract EP compatibility info from a model’s metadata, enabling compatibility checks without creating an inference session.
Changes:
- Added Python pybind exports for
GetCompatibilityInfoFromModel/GetCompatibilityInfoFromModelBytesand expanded Python EP-compatibility tests. - Added C#
OrtEnvAPIs and native interop delegates for the two compatibility-info extraction functions. - Added C# unit tests for new APIs (mostly argument/error-path coverage) and test utilities to generate minimal ONNX models with metadata.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| onnxruntime/test/python/onnxruntime_test_python_ep_compatibility.py | Adds model-bytes and file-path Python tests for compatibility-info extraction. |
| onnxruntime/python/onnxruntime_pybind_state.cc | Exposes new C API helpers to Python via pybind and documents them. |
| csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/EpCompatibilityTests.cs | Adds C# tests and an ONNX model builder helper for metadata-based compatibility info. |
| csharp/src/Microsoft.ML.OnnxRuntime/OrtEnv.shared.cs | Adds public C# OrtEnv methods to extract compatibility info from model path/bytes. |
| csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs | Wires new C API function pointers and delegates into the C# interop layer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/EpCompatibilityTests.cs
Show resolved
Hide resolved
adrianlizarraga
previously approved these changes
Mar 12, 2026
adrianlizarraga
approved these changes
Mar 14, 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
This change adds C# and Python language bindings and tests for the recently-introduced GetCompatibilityInfoFromModel / GetCompatibilityInfoFromModelBytes API.
Motivation and Context
#27015 introduced a new API to facilitate getting the model compatibility information from the metadata of a model (either a file or the model bytes). For convenience, we should ideally have some other language bindings included to make consumption a little easier.