Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,23 @@ common::Status OpenVINOExecutionProvider::Compile(
auto& logger = *GetLogger();
Status status = Status::OK();

bool is_epctx_model = false;
if (!fused_nodes.empty()) {
// Assume these properties are constant for all the model subgraphs, otherwise move to SubGraphContext
const auto& graph_body_viewer_0 = fused_nodes[0].filtered_graph.get();
session_context_.onnx_model_path_name = graph_body_viewer_0.ModelPath().string();
session_context_.onnx_opset_version =
graph_body_viewer_0.DomainToVersionMap().at(kOnnxDomain);

// OVIR wrapped in epctx should be treated as source but this code does not
// This corner case is not in use and will be addressed in a future commit
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

The comment is incomplete and unclear. It should explain what 'OVIR' stands for and provide a complete explanation of the issue and planned resolution.

Suggested change
// This corner case is not in use and will be addressed in a future commit
// OVIR (OpenVINO Intermediate Representation) models that are wrapped within an EP (Execution Provider) context (epctx)
// should be treated as source models. However, the current implementation does not handle this case correctly.
// This is a known corner case that is not currently encountered in practice, but it will be properly addressed in a future commit.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding a TODO comment or tracking issue reference to make this technical debt more actionable and trackable.

Suggested change
// This corner case is not in use and will be addressed in a future commit
// TODO: Handle the corner case where OVIR is wrapped in epctx as source. This is not currently in use. Consider tracking in a GitHub issue.

Copilot uses AI. Check for mistakes.
is_epctx_model = ep_ctx_handle_.CheckForOVEPCtxNodeInGraph(graph_body_viewer_0);
}

// The block below is executed during EP context model inference
auto& metadata = shared_context_->shared_weights.metadata; // Metadata object in memory
if (session_context_.so_share_ep_contexts &&
!session_context_.so_context_enable &&
is_epctx_model &&
metadata.empty()) {
fs::path context_model_file_path = session_context_.so_context_file_path;
if (context_model_file_path.empty()) {
Expand Down
Loading