Skip to content

Conversation

@dylanneve1
Copy link
Contributor

Details:

  • Draft test model generator

Tickets:

@dylanneve1 dylanneve1 requested review from a team as code owners February 9, 2026 11:33
@github-actions github-actions bot added category: build OpenVINO cmake script / infra category: NPU OpenVINO NPU plugin labels Feb 9, 2026
Copy link
Contributor

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 replaces the legacy ModelGenerator with a new, more capable ModelBuilder for constructing transformer/LLM-like test models used by NPUW unit tests.

Changes:

  • Introduced ModelBuilder (with LLMConfig) for assembling transformer blocks, KV-cache, RoPE, and mask logic.
  • Updated existing NPUW unit tests to use ModelBuilder instead of ModelGenerator.
  • Added dedicated unit tests validating key ModelBuilder behaviors and updated CMake include paths.

Reviewed changes

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

Show a summary per file
File Description
src/plugins/intel_npu/tests/unit/npuw/set_tensor.cpp Switches test model construction to ModelBuilder.
src/plugins/intel_npu/tests/unit/npuw/serialization.cpp Switches repeated-block models to ModelBuilder.
src/plugins/intel_npu/tests/unit/npuw/online_partitioning.cpp Switches partitioning tests to ModelBuilder.
src/plugins/intel_npu/tests/unit/npuw/model_generator/model_generator.hpp Removes legacy ModelGenerator interface.
src/plugins/intel_npu/tests/unit/npuw/model_generator/model_generator.cpp Removes legacy ModelGenerator implementation.
src/plugins/intel_npu/tests/unit/npuw/model_builder_tests.cpp Adds unit tests for ModelBuilder LLM graph construction and key transformations.
src/plugins/intel_npu/tests/unit/npuw/model_builder/model_builder.hpp Adds ModelBuilder public API and LLMConfig.
src/plugins/intel_npu/tests/unit/npuw/model_builder/model_builder.cpp Implements ModelBuilder including KV-cache, RoPE, attention mask, and weight-format helpers.
src/plugins/intel_npu/tests/unit/CMakeLists.txt Updates include path to use npuw/model_builder.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…tests

Avoid file-scope `using namespace ov::test::npuw` to prevent potential
name collisions and improve clarity in stack traces. Only ModelBuilder
is needed from that namespace, so use a targeted using-declaration.
The {0,2,1,3} permutation is its own inverse, so both branches of the
ternary produced the same order. Remove the misleading bool parameter
and note the self-inverse property in the doc comment.
Avoid calling get_partial_shape()[3].get_length() which throws on
dynamic dimensions. Since head_dim is already known at the call site,
pass it as a parameter to make the static-shape requirement explicit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build OpenVINO cmake script / infra category: NPU OpenVINO NPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant