Skip to content

Conversation

@javier-intel
Copy link

Description

Fix EPctx Metadata behavior for weight sharing scenario and update naming convention to avoid weights duplication

Motivation and Context

Fixes a Phi Silica accuracy failure when external data file is in original folder but EPCtx, metadata and blobs are in a separate folder
https://jira.devtools.intel.com/browse/CVS-169168

This comment was marked as outdated.

Copy link

@MayureshV1 MayureshV1 left a comment

Choose a reason for hiding this comment

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

Supports all 3 requested cases:

  • Trigger error if weights file can't be found
  • Append model name to metadata.bin
  • Collocate metadata.bin with ep context model during context generation

Copy link

@MayureshV1 MayureshV1 left a comment

Choose a reason for hiding this comment

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

Identified issues in code flow through unit testing where metadata.bin was using original model path and name instead of epctx name. Needs fixing.

@MayureshV1 MayureshV1 requested a review from Copilot June 24, 2025 07:34

This comment was marked as outdated.

@MayureshV1 MayureshV1 requested a review from Copilot June 24, 2025 23:48

This comment was marked as outdated.

@javier-intel javier-intel force-pushed the jemartin/weight_sharing_metadata_fix branch from 1f09229 to 9b3e51d Compare June 24, 2025 23:52
@MayureshV1 MayureshV1 requested a review from Copilot June 24, 2025 23:54
@javier-intel javier-intel force-pushed the jemartin/weight_sharing_metadata_fix branch from 9b3e51d to 21506c6 Compare June 24, 2025 23:56

This comment was marked as outdated.

@MayureshV1 MayureshV1 requested a review from Copilot June 24, 2025 23:57
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 PR addresses the EPctx metadata behavior by renaming the metadata file and adding filepath validation to enhance the weight sharing scenario.

  • Adjusted metadata file paths during both inference and generation phases.
  • Refactored error handling messages when reading and writing metadata.
  • Added a new member in the shared context to store metadata file path.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
onnxruntime/core/providers/openvino/openvino_execution_provider.cc Updated metadata reading and generation logic with filepath validation and improved error handling.
onnxruntime/core/providers/openvino/contexts.h Added a new field to store the metadata file path.
onnxruntime/core/providers/openvino/backend_manager.cc Adjusted metadata-dependent operations and error reporting for initializer file.

@javier-intel javier-intel force-pushed the jemartin/weight_sharing_metadata_fix branch from da39e24 to 73de0f1 Compare June 25, 2025 00:11
Copy link

@MayureshV1 MayureshV1 left a comment

Choose a reason for hiding this comment

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

Looks Good ! Behavior is verified and meets the requirement

@MayureshV1 MayureshV1 merged commit 90869ff into ovep-develop Jun 25, 2025
6 of 8 checks passed
ankitm3k pushed a commit that referenced this pull request Jul 2, 2025
…#717)

* Change name of metadata file and add filepath validation
* Save metadata file path in shared context for use across model compilation
* Fix metadata file path initialization
* Check that metadata file is created
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.

3 participants