Update OpenVINO NPU dynamic external-initializer expectation#29572
Open
GopalakrishnanN wants to merge 3 commits into
Open
Update OpenVINO NPU dynamic external-initializer expectation#29572GopalakrishnanN wants to merge 3 commits into
GopalakrishnanN wants to merge 3 commits into
Conversation
OpenVINO NPU defers dynamic-shape backend creation at session initialization, so the dynamic external-initializer test should not expect the >2GB embedded-proto failure at session construction for NPU. Keep the existing exception expectation for CPU/GPU, where the dynamic backend is initialized immediately and the protobuf size limit is still hit.
GopalakrishnanN
force-pushed
the
GopalakrishnanN/openvino-dynamic-ext-init-npu
branch
from
July 6, 2026 07:39
5f2802d to
effdbd5
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the OpenVINO EP external-initializer dynamic-shape unit test expectations to reflect that NPU handles dynamic-shape backend creation differently than CPU/GPU during session construction.
Changes:
- Split the session-construction expectation by device: keep
EXPECT_THROWfor CPU/GPU and useEXPECT_NO_THROWfor NPU. - Add an explanatory assertion message describing the NPU-specific behavior.
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.
Description
Updates the OpenVINO external-initializer dynamic-shape test to account for NPU behavior.
OVEP_ExtInit_DynamicEmbed_Tests.ModelWithDynamicShapeEmbedsWeightspreviously expected session construction to throw for every device when a dynamic-shape model with >2GB external weights is loaded from memory. That still holds for CPU/GPU, where dynamic backend initialization happens at session construction and the weights are embedded into the model proto, hitting protobuf's 2GB limit.For NPU, backend creation for this dynamic-shape case is deferred at session initialization. As a result, the external weights are not embedded into the model proto at this point and session construction succeeds. The test now keeps the existing
EXPECT_THROWfor CPU/GPU and usesEXPECT_NO_THROWfor NPU.Testing
Installed OpenVINO 2026.2.1 into the repo
.venvand built an OpenVINO NPU provider-test binary:Build result:
onnxruntime_provider_test.exebuilt successfully withonnxruntime_providers_openvino.dll.Ran all CPU/GPU/NPU parameters for the updated test:
Result:
Also reran the self-contained NPU smoke test:
Result: