Skip to content

Commit 01a26b7

Browse files
committed
fix: fix bugs
1 parent e40331e commit 01a26b7

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

onnxruntime/core/providers/openvino/backend_manager.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ BackendManager::BackendManager(SessionContext& session_context,
4343
session_context_(session_context),
4444
shared_context_{shared_context} {
4545
subgraph_context_.is_ep_ctx_graph = ep_ctx_handle_.CheckForOVEPCtxNodeInGraph(subgraph);
46-
// If the graph contains a OVIR wrapped node, we check if it has xml file attribute
47-
subgraph_context_.is_ep_ctx_ovir_encapsulated = ep_ctx_handle_.CheckEPCacheContextAttribute(subgraph, "xml");
46+
// If the graph contains a OVIR wrapped node, we check if it has matching xml file name attribute
47+
subgraph_context_.is_ep_ctx_ovir_encapsulated = ep_ctx_handle_.CheckEPCacheContextAttribute(subgraph,
48+
session_context_.onnx_model_path_name.filename().replace_extension("xml").string());
4849

4950
subgraph_context_.model_precision = [&](const GraphViewer& graph_viewer) {
5051
// return empty if graph has no inputs or if types are not one of FP32/FP16

onnxruntime/core/providers/openvino/backends/basic_backend.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ BasicBackend::BasicBackend(std::unique_ptr<ONNX_NAMESPACE::ModelProto>& model_pr
8282

8383
ORT_ENFORCE(!session_context_.so_context_file_path.empty() &&
8484
std::filesystem::path(session_context_.so_context_file_path).is_absolute() &&
85-
std::filesystem::exists(session_context_.so_context_file_path),
86-
log_tag + "Context file path must be non-empty & absolute, when using CreateSessionFormArray() API explicitly."
87-
"Please set a valid absolute path for ep.context_file_path in session options.");
85+
std::filesystem::exists(session_context_.so_context_file_path), log_tag +
86+
"Context file path must be non-empty & absolute, when using CreateSessionFormArray() API explicitly."
87+
" Please set a valid absolute path for ep.context_file_path in session options.");
8888
// Return absolute context file path as input to ImportEPCtxOVIREncapsulation() function.
8989
return session_context_.so_context_file_path;
9090

onnxruntime/core/providers/openvino/ov_interface.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ OVExeNetwork OVCore::ImportModel(std::istream& model_stream,
197197
return OvExceptionBoundary([&]() {
198198
ov::CompiledModel obj;
199199
obj = core.import_model(model_stream, hw_target, device_config);
200+
OVExeNetwork exe(obj, hw_target);
200201
#ifndef NDEBUG
201202
printDebugInfo(exe.Get());
202203
#endif
203-
OVExeNetwork exe(obj, hw_target);
204204
return exe;
205205
},
206206
"Exception while Loading Network for graph {}", name);

0 commit comments

Comments
 (0)