-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[EP ABI] Signatures for compatibility info methods #25454
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -442,6 +442,18 @@ typedef enum OrtEpDataLayout { | |
| OrtEpDataLayout_Default = OrtEpDataLayout_NCHW, | ||
| } OrtEpDataLayout; | ||
|
|
||
| /** | ||
| * \brief Enumeration describing the compatibility state of a compiled model relative to an execution provider. | ||
| * | ||
| * \since Version 1.23. | ||
| */ | ||
| typedef enum OrtCompiledModelCompatibility { | ||
| OrtCompiledModelCompatibility_EP_NOT_APPLICABLE = 0, | ||
| OrtCompiledModelCompatibility_EP_SUPPORTED_OPTIMAL, | ||
| OrtCompiledModelCompatibility_EP_SUPPORTED_PREFER_RECOMPILATION, | ||
| OrtCompiledModelCompatibility_EP_UNSUPPORTED, | ||
| } OrtCompiledModelCompatibility; | ||
|
|
||
| /** | ||
| * \brief The OrtEp struct provides functions to implement for an execution provider. | ||
| * \since Version 1.22. | ||
|
|
@@ -668,6 +680,24 @@ struct OrtEp { | |
| ORT_API2_STATUS(CreateSyncStreamForDevice, _In_ OrtEp* this_ptr, | ||
| _In_ const OrtMemoryDevice* memory_device, | ||
| _Outptr_ OrtSyncStreamImpl** stream); | ||
|
|
||
| /** \brief Get a string with details about the EP stack used to produce a compiled model. | ||
| * | ||
| * This function gets a compatibility information string that contains details about the execution provider | ||
| * used to compile a given model. This string can later be used with ValidateCompiledModelCompatibilityInfo | ||
| * to determine if a compiled model is compatible with the EP. | ||
| * | ||
| * The returned string should be a null-terminated, UTF-8 encoded string. ORT will copy it. | ||
| * | ||
| * \param[in] this_ptr The OrtEp instance. | ||
| * \param[in] graph The OrtGraph instance for which to generate compatibility information. | ||
| * | ||
| * \snippet{doc} snippets.dox OrtStatus Return Value | ||
| * | ||
| * \since Version 1.23. | ||
| */ | ||
| const char*(ORT_API_CALL* GetCompiledModelCompatibilityInfo)(_In_ OrtEp* this_ptr, | ||
| _In_ const OrtGraph* graph); | ||
| }; | ||
|
|
||
| /** \brief The function signature that ORT will call to create OrtEpFactory instances. | ||
|
|
@@ -831,6 +861,23 @@ struct OrtEpFactory { | |
| */ | ||
| ORT_API_T(const char*, GetVersion, _In_ const OrtEpFactory* this_ptr); | ||
|
|
||
| /** \brief Validate the compatibility of a compiled model with the execution provider. | ||
| * | ||
| * This function validates if a model produced with the supplied compatibility info string is supported by the underlying EP. | ||
| * The EP should check if a compiled model is compatible with the EP and set the model_compatibility parameter accordingly. | ||
| * | ||
| * \param[in] this_ptr The OrtEpFactory instance. | ||
| * \param[in] compatibility_info The compatibility information string that will be used | ||
| * \param[out] model_compatibility OrtCompiledModelCompatibility enum value describing the compatibility of the model with the EP. | ||
| * | ||
| * \snippet{doc} snippets.dox OrtStatus Return Value | ||
| * | ||
| * \since Version 1.23. | ||
| */ | ||
| OrtStatus*(ORT_API_CALL* ValidateCompiledModelCompatibilityInfo)(_In_ OrtEpFactory* this_ptr, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should use ORT_API2_STATUS so we get consistent usage of |
||
| _In_ const char* compatibility_info, | ||
| _Out_ OrtCompiledModelCompatibility* model_compatibility); | ||
|
|
||
| /** \brief Create an OrtAllocator that can be shared across sessions for the given OrtMemoryInfo. | ||
| * | ||
| * The factory that creates the EP is responsible for providing the allocators required by the EP. | ||
|
|
||
Oops, something went wrong.
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.
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.
This should use ORT_API_T so we get consistent usage of
noexcept.