Repository navigation
Clarify external initializer and EP context path interaction - #32442
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 76e0b1ed-6661-452c-b1a2-7505883de415
Jambay Kinley (jambayk)
requested review from
Chi Lo (chilo-ms) and
Xiaoyu Z (xiaoyu-work)
and
a balanced review from Copilot
September 4, 2026 17:58
Contributor
There was a problem hiding this comment.
π‘ Changes recommended
Both enhanced diagnostics are unreachable because path validation reports missing files first, causing the new assertions to fail.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Clarifies EPContext path resolution when external initializer directories override model locations.
Changes:
- Documents the interaction between both session options.
- Adds QNN/OpenVINO diagnostics and regression coverage.
- Verifies OpenVINO recovery when
ep.context_file_pathis set.
File summaries
| File | Description |
|---|---|
onnxruntime/test/providers/qnn/qnn_ep_context_test.cc |
Strengthens missing-context diagnostics assertions. |
onnxruntime/test/providers/openvino/openvino_ep_context_test.cc |
Tests failure and recovery path resolution. |
onnxruntime/core/providers/qnn/builder/onnx_ctx_model_helper.cc |
Adds QNN guidance to missing-file errors. |
onnxruntime/core/providers/openvino/onnx_ctx_model_helper.cc |
Adds OpenVINO guidance to missing-file errors. |
include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h |
Documents option interaction and semantics. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Balanced
π‘ Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 76e0b1ed-6661-452c-b1a2-7505883de415
Contributor
There was a problem hiding this comment.
π΅ Needs a closer look
The OpenVINO error exposes an internal invariant expression instead of preserving the prior user-facing status diagnostic.
Review details
Suppressed comments (1)
onnxruntime/core/providers/openvino/onnx_ctx_model_helper.cc:123
ORT_ENFORCEturns this expected user-input failure into an invariant-style diagnostic, so the public exception includes the internal textvalidate_status.IsOK() was false.Preserve the validation status while augmenting its message, then throw that status as before.
ORT_ENFORCE(validate_status.IsOK(), validate_status.ErrorMessage(), path_resolution_guidance);
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 76e0b1ed-6661-452c-b1a2-7505883de415
Jambay Kinley (jambayk)
enabled auto-merge (squash)
September 9, 2026 20:46
Xiaoyu Z (xiaoyu-work)
approved these changes
Sep 9, 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
session.model_external_initializers_file_folder_pathinteracts withep.context_file_path.Motivation
session.model_external_initializers_file_folder_pathoverrides the model directory used internally to resolve ONNX external initializer data. For anEPContextmodel withembed_mode = 0, an EP can consequently search that directory for the external context binary unlessep.context_file_pathidentifies the EPContext model location. The previous errors reported only the unresolved file path and did not explain the option interaction.Testing
lintrunner -aon all changed filesonnxruntime_test_allandonnxruntime_shared_lib_testin the available CPU configurationonnxruntime_shared_lib_test --gtest_filter=CApiTest.TestLoadModelFromPathWithExternalInitializersViaSetExternalDataPath(1 test passed)The local build has OpenVINO and QNN disabled, so the provider-specific tests were added but could not be executed locally.