Skip to content

Add reference examples and guidance (especially for multi-device scenarios) for ValidateCompiledModelCompatibilityInfo - #29168

Merged
adrastogi merged 3 commits into
mainfrom
adrastogi/improve-compat-guidance
Oct 5, 2026
Merged

adrastogi merged 3 commits into
mainfrom
adrastogi/improve-compat-guidance

Conversation

@adrastogi

Copy link
Copy Markdown
Contributor

Description

ValidateCompiledModelCompatibilityInfo is underspecified in that it does not provide enough guidance for EP implementors on how to handle multi-device cases. This change attempts to fill that gap by defining the intended prioritization of the various compatibility states. It also updates the reference implementation in the test plugin EP.

Motivation and Context

This change is being made in response to customer feedback.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR clarifies the intended semantics of OrtEpFactory::ValidateCompiledModelCompatibilityInfo—especially for multi-device EP scenarios—by documenting the required “per-device verdict then worst-of fold” behavior, and updates the example plugin EP + tests to match that guidance.

Changes:

  • Expanded ValidateCompiledModelCompatibilityInfo documentation to define multi-device interpretation and required verdict folding rules (with guidance for “no opinion” vs “bad artifact” cases).
  • Updated the example plugin EP’s compatibility validation to compute per-device compatibility and combine results using the documented reduction.
  • Added end-to-end and unit tests covering single-device, “no opinion”, and multi-device folding behavior.
Show a summary per file
File Description
onnxruntime/test/autoep/test_model_package.cc Adds tests that exercise the public compatibility API against the example plugin EP, including multi-device folding behavior.
onnxruntime/test/autoep/library/example_plugin_ep/ep_factory.cc Refactors the example EP factory’s compatibility validation to evaluate per-device and combine verdicts per the documented rules.
onnxruntime/test/autoep/library/example_plugin_ep/compatibility_combine.h Introduces a shared helper to combine per-device compatibility verdicts using the documented identity + worst-of rule.
include/onnxruntime/core/session/onnxruntime_ep_c_api.h Adds detailed guidance and a normative algorithm for multi-device compatibility validation and result combination.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 3

Comment thread onnxruntime/test/autoep/library/example_plugin_ep/ep_factory.cc Outdated
Comment thread onnxruntime/test/autoep/library/example_plugin_ep/ep_factory.cc Outdated
Comment thread onnxruntime/test/autoep/library/example_plugin_ep/ep_factory.cc Outdated
Comment thread include/onnxruntime/core/session/onnxruntime_ep_c_api.h Outdated
Comment thread include/onnxruntime/core/session/onnxruntime_ep_c_api.h Outdated
Comment thread include/onnxruntime/core/session/onnxruntime_ep_c_api.h Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@adrastogi
adrastogi force-pushed the adrastogi/improve-compat-guidance branch from a93da1f to 1655a44 Compare September 7, 2026 06:47
Comment thread include/onnxruntime/core/session/onnxruntime_ep_c_api.h Outdated
Clarify that ValidateCompiledModelCompatibilityInfo may be called without a session (e.g. via GetModelCompatibilityForEpDevices or model package variant selection), so session options and EP metadata may be unknown.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@adrastogi
adrastogi merged commit dba3629 into main Oct 5, 2026
96 checks passed
@adrastogi
adrastogi deleted the adrastogi/improve-compat-guidance branch October 5, 2026 22:28
This was referenced Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants