Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions include/onnxruntime/core/session/onnxruntime_ep_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,27 @@ struct OrtEp {
OrtStatus*(ORT_API_CALL* GetCompiledModelCompatibility)(_In_ OrtEp* this_ptr,
_In_ const OrtGraph* graph,
_Out_ OrtCompiledModelCompatibility* model_compatibility);

/** \brief Generate a string with details about the EP stack used to produce a compiled model.
*
* This function generates 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.
Comment on lines +568 to +570
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
* 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.
* \param[in] model_metadata The OrtModelMetadata instance containing model metadata.
* \return the compatibility information string produced by the EP
*
* \snippet{doc} snippets.dox OrtStatus Return Value
*
* \since Version 1.23.
*/
const char*(ORT_API_CALL* GenerateCompiledModelCompatibilityInfoString)(_In_ OrtEp* this_ptr,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skottmckay I pushed a commit with some interface candidates based on my interpretation of the other comment thread- do these look reasonable to you?

_In_ const OrtGraph* graph,
_In_ const OrtModelMetadata* model_metadata);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skottmckay question here about the idea of persisting the compatibility information in the model metadata: would this be something added to the custom metadata map? Still learning about metadata in ORT- the alternative was adding it as a peer value to producer_name, et. al., which is quite a bit more surgery throughout the codebase. I'm moving in the direction of the former but wanted to cross-check.

};

/** \brief The function signature that ORT will call to create OrtEpFactory instances.
Expand Down Expand Up @@ -710,6 +731,24 @@ struct OrtEpFactory {
*/
const char*(ORT_API_CALL* 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 Output parameter set to the OrtCompiledModelCompatibility enum value that
Comment on lines +736 to +738
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* \param[in] this_ptr The OrtEpFactory instance.
* \param[in] compatibility_info The compatibility information string that will be used
* \param[out] model_compatibility Output parameter set to the OrtCompiledModelCompatibility enum value that
* \param[in] this_ptr The OrtEpFactory instance.
* \param[in] compatibility_info The compatibility information string that will be used
* \param[out] model_compatibility Output parameter set to the OrtCompiledModelCompatibility enum value that

* describes the compatibility of the model with the EP.
*
* \snippet{doc} snippets.dox OrtStatus Return Value
*
* \since Version 1.23.
*/
OrtStatus*(ORT_API_CALL* ValidateCompiledModelCompatibilityInfoString)(_In_ OrtEpFactory* this_ptr,
_In_ const char* compatibility_info,
_Out_ OrtCompiledModelCompatibility* model_compatibility);

/** \brief Create an OrtAllocator for the given OrtMemoryInfo.
*
* This is used to create an allocator that an execution provider requires. The factory that creates the EP is
Expand Down
Loading