Skip to content

Commit a780d5b

Browse files
javier-intelMayureshV1Copilot
authored
Fix failing case where input onnx model is used with shared context e… (#776)
* Fix failing case where input onnx model is used with shared context enabled * Update onnxruntime/core/providers/openvino/openvino_execution_provider.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: MayureshV1 <47039074+MayureshV1@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 609dfbf commit a780d5b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

onnxruntime/core/providers/openvino/openvino_execution_provider.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,23 @@ common::Status OpenVINOExecutionProvider::Compile(
9494
auto& logger = *GetLogger();
9595
Status status = Status::OK();
9696

97+
bool is_epctx_model = false;
9798
if (!fused_nodes.empty()) {
9899
// Assume these properties are constant for all the model subgraphs, otherwise move to SubGraphContext
99100
const auto& graph_body_viewer_0 = fused_nodes[0].filtered_graph.get();
100101
session_context_.onnx_model_path_name = graph_body_viewer_0.ModelPath().string();
101102
session_context_.onnx_opset_version =
102103
graph_body_viewer_0.DomainToVersionMap().at(kOnnxDomain);
104+
105+
// OVIR wrapped in epctx should be treated as source but this code does not
106+
// This corner case is not in use and will be addressed in a future commit
107+
is_epctx_model = ep_ctx_handle_.CheckForOVEPCtxNodeInGraph(graph_body_viewer_0);
103108
}
104109

105110
// The block below is executed during EP context model inference
106111
auto& metadata = shared_context_->shared_weights.metadata; // Metadata object in memory
107112
if (session_context_.so_share_ep_contexts &&
108-
!session_context_.so_context_enable &&
113+
is_epctx_model &&
109114
metadata.empty()) {
110115
fs::path context_model_file_path = session_context_.so_context_file_path;
111116
if (context_model_file_path.empty()) {

0 commit comments

Comments
 (0)