Skip the ext initializer logic when dynamic shapes are used#828
Merged
MayureshV1 merged 1 commit intoOct 10, 2025
Merged
Conversation
javier-intel
approved these changes
Oct 10, 2025
There was a problem hiding this comment.
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>
07d741e to
97409b4
Compare
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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