Resolve unbounded NPU input shapes before compile - #4047
Open
pwolnows wants to merge 6 commits into
Open
Conversation
sstrehlk
approved these changes
Aug 20, 2026
sstrehlk
approved these changes
Aug 21, 2026
pwolnows
enabled auto-merge (squash)
August 21, 2026 07:44
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.
Resolve unbounded NPU input shapes before compilation
Summary
This change adds a
boundedundefined-shape resolving policy for Accuracy Checker. The new policy bounds fully unbounded dynamic input dimensions before model compilation/loading and uses the default policy otherwise.NPU can compile dynamic dimensions only when each dynamic dimension has an explicit upper bound. Models converted with inputs such as
[-1, 3, -1, -1]expose unbounded batch, height, and width dimensions, which OpenVINO represents internally withINT64_MAXas the upper bound. The NPU plugin rejects these shapes during compilation because it cannot statically size buffers and tiling for an open-ended dimension.The fix resolves unbounded input shapes from the first preprocessed input batch, or from the existing template shape range when available, before compiling/loading the model. NPU validation jobs can opt in to this behavior by setting
--undefined_shapes_resolving_policy bounded.Changes
boundedas a supported--undefined_shapes_resolving_policyvalue.boundedis selected.dlsdklauncher, since old configs still instantiateDLSDKLauncherdirectly.default,dynamic, andstaticpolicy behavior.Behavior
For an input like:
With
--undefined_shapes_resolving_policy bounded, Accuracy Checker now resolves the shape before compilation using the shape of the actual preprocessed data. For example, an ImageNet ResNet config that resizes then crops to224x224resolves to:This avoids NPU compile failures such as:
Validation
Run locally:
Also attempted focused pytest coverage:
python3 -m pytest \ tools/accuracy_checker/tests/test_openvino_launcher.py \ tools/accuracy_checker/tests/test_dlsdk_launcher.py \ -k 'bounded'The focused pytest command was skipped in the local environment because OpenVINO Python packages are not installed there.
Notes
This is primarily an NPU compatibility fix, not a CPU/GPU performance optimization. CPU and GPU tolerate unbounded dynamic dimensions in this path, while NPU requires bounded or static dimensions before compilation. The behavior is opt-in through
boundedso NPU jobs can enable it without changing the semantics of the existingdynamicpolicy.