Skip to content

Conversation

@adrastogi
Copy link
Contributor

@adrastogi adrastogi commented Aug 14, 2025

Description

This pull request introduces a new mechanism for validating compiled model compatibility with execution providers (EPs) in ONNX Runtime. It adds infrastructure for EPs to generate and store compatibility information in model metadata, and for the runtime to enforce compatibility checks during session initialization.

Motivation and Context

The APIs proposed in this PR address two requirements:

  1. Apps that have an already pre-compiled model on device need a way to determine if the pre-compiled app is still valid (given the EPs / drivers / etc. on the system).
  2. Apps may have many different pre-compiled versions of a model stored on a remote server, and want to figure out which of those models they should download for the device where they are running.

Testing

Validated that the new suite of tests passes cleanly.
Created a private build of this ORT and the AMD Vitis EP. I stepped through the core logic (the EP doesn't have this support wired up as yet so there is no compatibility info written out) and for regression purposes, confirmed I could compile and run inferences through ResNet.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

You can commit the suggested changes from lintrunner.

adrastogi and others added 4 commits August 14, 2025 06:33
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

You can commit the suggested changes from lintrunner.

…es.cc

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@thevishalagarwal
Copy link
Contributor

Hi @adrastogi / @adrianlizarraga - is GetCompiledModelCompatibility API going to be available for non-ABI interfaces as well? Do you have an ETA for this draft PR to merge?

@adrastogi adrastogi marked this pull request as ready for review August 21, 2025 16:44
@adrastogi
Copy link
Contributor Author

Hey @thevishalagarwal- yes, the implementation supports non-ABI interfaces as well. We're trying to get this in as soon as we can (pending a few loose ends that we're chasing down).


In reply to: 3209754229

@adrastogi adrastogi merged commit 8c68aa1 into main Aug 22, 2025
90 of 92 checks passed
@adrastogi adrastogi deleted the adrastogi/model-compat branch August 22, 2025 21:21
adrianlizarraga pushed a commit that referenced this pull request Aug 22, 2025
…y info (#25749)

### Description
This pull request introduces a new mechanism for validating compiled
model compatibility with execution providers (EPs) in ONNX Runtime. It
adds infrastructure for EPs to generate and store compatibility
information in model metadata, and for the runtime to enforce
compatibility checks during session initialization.

### 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 APIs proposed in this PR address two requirements:

1. Apps that have an already pre-compiled model on device need a way to
determine if the pre-compiled app is still valid (given the EPs /
drivers / etc. on the system).
2. Apps may have many different pre-compiled versions of a model stored
on a remote server, and want to figure out which of those models they
should download for the device where they are running.

### Testing
Validated that the new suite of tests passes cleanly. 
Created a private build of this ORT and the AMD Vitis EP. I stepped
through the core logic (the EP doesn't have this support wired up as yet
so there is no compatibility info written out) and for regression
purposes, confirmed I could compile and run inferences through ResNet.

---------

Co-authored-by: Aditya Rastogi <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
adrianlizarraga added a commit that referenced this pull request Aug 25, 2025
### Description
Cherry-pick the following PRs into the `rel-1.23.0` branch:
- #25592
- #25622
- #25688
- #25729
- #25743
- #25769
- #25745
- #25761
- #25751
- #25716
- #25228
- #25768
- #25788
- #25747
- #25800
- #25818
- #25762
- #25749
- #25831


### 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. -->

---------

Co-authored-by: quic-tirupath <[email protected]>
Co-authored-by: quic-calvnguy <[email protected]>
Co-authored-by: qti-kromero <[email protected]>
Co-authored-by: Jeff Kilpatrick <[email protected]>
Co-authored-by: Scott McKay <[email protected]>
Co-authored-by: David Fan <[email protected]>
Co-authored-by: kuanyul-qti <[email protected]>
Co-authored-by: Dmitri Smirnov <[email protected]>
Co-authored-by: Chi Lo <[email protected]>
Co-authored-by: Edward Chen <[email protected]>
Co-authored-by: Chunye Wang@AMD <[email protected]>
Co-authored-by: minfhong-qti <[email protected]>
Co-authored-by: Vishal Agarwal <[email protected]>
Co-authored-by: Maximilian Müller <[email protected]>
Co-authored-by: Maximilian Müller <[email protected]>
Co-authored-by: Changming Sun <[email protected]>
Co-authored-by: adrastogi <[email protected]>
Co-authored-by: Aditya Rastogi <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
gedoensmax pushed a commit to gedoensmax/onnxruntime that referenced this pull request Sep 2, 2025
…y info (microsoft#25749)

### Description
This pull request introduces a new mechanism for validating compiled
model compatibility with execution providers (EPs) in ONNX Runtime. It
adds infrastructure for EPs to generate and store compatibility
information in model metadata, and for the runtime to enforce
compatibility checks during session initialization.

### 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 APIs proposed in this PR address two requirements:

1. Apps that have an already pre-compiled model on device need a way to
determine if the pre-compiled app is still valid (given the EPs /
drivers / etc. on the system).
2. Apps may have many different pre-compiled versions of a model stored
on a remote server, and want to figure out which of those models they
should download for the device where they are running.

### Testing
Validated that the new suite of tests passes cleanly. 
Created a private build of this ORT and the AMD Vitis EP. I stepped
through the core logic (the EP doesn't have this support wired up as yet
so there is no compatibility info written out) and for regression
purposes, confirmed I could compile and run inferences through ResNet.

---------

Co-authored-by: Aditya Rastogi <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
yuslepukhin pushed a commit that referenced this pull request Dec 10, 2025
…val and validation (#26699)

### Description

Adds support for compiled model compatibility information retrieval and
validation in the VitisAI EP. This enables runtime validation of
compiled models against the execution environment to prevent failures
and provide clear compatibility feedback.

**Key Changes:**
- Implemented `GetCompiledModelCompatibilityInfo` to collect and
serialize compatibility metadata during model compilation
- Added `ValidateCompiledModelCompatibilityInfo` to validate
compatibility at runtime against the current environment

### Motivation and Context
Compiled models may fail at runtime due to missing backend plugins,
version mismatches, or hardware platform differences.
The ONNXRuntime add 2 API for support compiled model compatibility
validation system . Ref PRs:
    #25841
    #25749
    

This PR implements a compatibility validation system for Vitis AI EP
that:

- Detects incompatibilities before model loading to prevent runtime
failures
- Enables cross-version compatibility checking between different EP
versions
- Provides clear feedback through specific compatibility status codes
- Maintains backward compatibility with legacy EPs
Kevin-Taha pushed a commit that referenced this pull request Dec 11, 2025
…val and validation (#26699)

### Description

Adds support for compiled model compatibility information retrieval and
validation in the VitisAI EP. This enables runtime validation of
compiled models against the execution environment to prevent failures
and provide clear compatibility feedback.

**Key Changes:**
- Implemented `GetCompiledModelCompatibilityInfo` to collect and
serialize compatibility metadata during model compilation
- Added `ValidateCompiledModelCompatibilityInfo` to validate
compatibility at runtime against the current environment

### Motivation and Context
Compiled models may fail at runtime due to missing backend plugins,
version mismatches, or hardware platform differences.
The ONNXRuntime add 2 API for support compiled model compatibility
validation system . Ref PRs:
    #25841
    #25749
    

This PR implements a compatibility validation system for Vitis AI EP
that:

- Detects incompatibilities before model loading to prevent runtime
failures
- Enables cross-version compatibility checking between different EP
versions
- Provides clear feedback through specific compatibility status codes
- Maintains backward compatibility with legacy EPs
Sumit2318 pushed a commit that referenced this pull request Jan 6, 2026
…val and validation (#26699)

### Description

Adds support for compiled model compatibility information retrieval and
validation in the VitisAI EP. This enables runtime validation of
compiled models against the execution environment to prevent failures
and provide clear compatibility feedback.

**Key Changes:**
- Implemented `GetCompiledModelCompatibilityInfo` to collect and
serialize compatibility metadata during model compilation
- Added `ValidateCompiledModelCompatibilityInfo` to validate
compatibility at runtime against the current environment

### Motivation and Context
Compiled models may fail at runtime due to missing backend plugins,
version mismatches, or hardware platform differences.
The ONNXRuntime add 2 API for support compiled model compatibility
validation system . Ref PRs:
    #25841
    #25749
    

This PR implements a compatibility validation system for Vitis AI EP
that:

- Detects incompatibilities before model loading to prevent runtime
failures
- Enables cross-version compatibility checking between different EP
versions
- Provides clear feedback through specific compatibility status codes
- Maintains backward compatibility with legacy EPs
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.

5 participants