Skip to content

Conversation

@javier-intel
Copy link

@javier-intel javier-intel commented Aug 13, 2025

Fix for https://hsdes.intel.com/appstore/article-one/#/article/22021483243 that happened when an onnx source model is compiled with shared context enabled without saving model to ep context.

@MayureshV1 MayureshV1 requested a review from Copilot August 13, 2025 05:02

This comment was marked as outdated.

@MayureshV1 MayureshV1 requested a review from Copilot August 13, 2025 05:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes a bug in the OpenVINO execution provider where ONNX source models fail when compiled with shared context enabled. The issue was identified in Intel's tracking system and involves incorrect handling of EP context models during compilation.

  • Added logic to detect EP context models using CheckForOVEPCtxNodeInGraph()
  • Modified the conditional check to use is_epctx_model instead of !session_context_.so_context_enable
  • Added explanatory comments about the OVIR wrapped in epctx corner case

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.
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.

[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.
@vthaniel vthaniel self-requested a review August 13, 2025 17:00
@javier-intel javier-intel force-pushed the jemartin/fix_hsdes_22021483243 branch from eaaade6 to 1f3aa94 Compare August 13, 2025 17:37
Copy link

@vthaniel vthaniel left a comment

Choose a reason for hiding this comment

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

Tested the EP Context scenarios on the perf_test app available on ovep-develop
and no issues were found

@MayureshV1 MayureshV1 merged commit a780d5b into ovep-develop Aug 13, 2025
6 of 8 checks passed
javier-intel added a commit that referenced this pull request Aug 14, 2025
#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>
vthaniel pushed a commit that referenced this pull request Aug 28, 2025
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants