Improve error message when EPContext node is not assigned to an EP#27474
Merged
adrianlizarraga merged 3 commits intomainfrom Feb 27, 2026
Merged
Improve error message when EPContext node is not assigned to an EP#27474adrianlizarraga merged 3 commits intomainfrom
adrianlizarraga merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves diagnosability when loading pre-compiled models containing EPContext nodes by emitting a targeted error if an EPContext node is not assigned to any execution provider, and adds a regression test to validate the new message.
Changes:
- Add a specialized
NOT_IMPLEMENTEDerror message for unassignedEPContextnodes that includes the node’ssourceattribute and the session’s registered EPs. - Add a new AutoEP test that compiles a model with the example plugin EP and verifies the explicit error when loading it without registering the required EP.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| onnxruntime/test/autoep/test_execution.cc | Adds regression test covering the explicit error when loading an EPContext model without the required EP. |
| onnxruntime/core/framework/session_state.cc | Enhances node-to-EP assignment verification to emit a descriptive error for unassigned EPContext nodes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
xadupre
approved these changes
Feb 27, 2026
edgchen1
approved these changes
Feb 27, 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
Improves the error message returned by ORT when loading a compiled model in a session that does not have the required execution provider(s).
For example, ORT now returns the following error when creating session with a model compiled explicitly for OpenVINO EP without adding OpenVINO EP to the session:
Compare the above message with the more generic message that is currently returned:
Motivation and Context
Improves diagnosability when loading of pre-compiled models fails. Specifically, the ambiguity of the original message led to many hours spent debugging an error where a compiled model failed to run because the expected
OrtEpDevicewas inadvertently not added to a session.