Skip to content

Conversation

@intbf
Copy link

@intbf intbf commented Oct 10, 2025

When dynamic shapes are used the model proto might change and invalidate the offsets for ext initializers

Description

During the investigation I noticed that offsets created for EXT initializers are updated/overridden when dynamic shapes are used.

We create model_proto from fused nodes in backend_manager (call to GetModelProtoFromFusedNode)
But then we call BackendManager::Compute, and it requires dynamic backend: (need_dynamic_backend is true)

Data breakpoints on the memory offets from initializers, are hit in BackendManager::ReWriteInputShapeInfo (somewhere down into model_copy->ParseFromString(proto_str);)

The model proto changes, and it's not reliable to use it with open vino

Later when OV tries to get tensor data via TensorExternalData::load_external_mem_data() it crashes because pointers/offsets might be invalidated

Motivation and Context

https://jira.devtools.intel.com/browse/CVS-174804

@javier-intel javier-intel requested a review from Copilot October 10, 2025 15:11
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 modifies the OpenVINO backend manager to skip external initializer logic when dynamic shapes are detected. The change prevents potential issues where model proto changes could invalidate offset calculations for external initializers.

  • Moves the dynamic shape detection logic earlier in the constructor
  • Skips external initializer processing when dynamic input shapes are present

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

… from initializers might become invalid

Signed-off-by: bfilipek <bartlomiej.filipek@intel.com>
@intbf intbf force-pushed the ext_initializer_dynamic_size_regression_fix branch from 07d741e to 97409b4 Compare October 10, 2025 17:11
@MayureshV1 MayureshV1 requested a review from Copilot October 10, 2025 17:31
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


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

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.

LGTM !

@MayureshV1 MayureshV1 merged commit b685871 into intel:ovep-develop Oct 10, 2025
3 of 5 checks passed
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