Skip to content

[NPU] Human readable plugin metadata#35571

Open
alexandruenache1111 wants to merge 20 commits intoopenvinotoolkit:masterfrom
alexandruenache1111:poc_human_string
Open

[NPU] Human readable plugin metadata#35571
alexandruenache1111 wants to merge 20 commits intoopenvinotoolkit:masterfrom
alexandruenache1111:poc_human_string

Conversation

@alexandruenache1111
Copy link
Copy Markdown
Contributor

@alexandruenache1111 alexandruenache1111 commented Apr 28, 2026

Details:

  • adding methods for metadata to read/write most of its contents in a human-readable form
  • some metadata fields are not written in text form since they are considered irrelevant to compatibility check

Tickets:

  • C-180876

AI Assistance:

  • AI assistance used: no / yes
  • If yes, summarize how AI was used and what human validation was performed (build/tests/manual checks).

Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
* Align the string with standard grammar
* Shorten key names
* Opt layouts out

Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
…are equal to 0

Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
@github-actions github-actions Bot added the category: NPU OpenVINO NPU plugin label Apr 28, 2026
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
@alexandruenache1111 alexandruenache1111 marked this pull request as ready for review April 28, 2026 15:05
@alexandruenache1111 alexandruenache1111 requested review from a team as code owners April 28, 2026 15:05
@alexandruenache1111 alexandruenache1111 self-assigned this Apr 28, 2026
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
@alexandruenache1111 alexandruenache1111 changed the title [NPU] POC human readable plugin metadata [NPU] Human readable plugin metadata Apr 29, 2026
Copy link
Copy Markdown
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 extends the Intel NPU blob metadata format to v2.5 by adding an optional “compiler requirements/runtime requirements” string, and introduces a human-readable metadata serialization/parsing path intended for compatibility-string generation (with I/O layouts excluded).

Changes:

  • Bump metadata version to 2.5 and add binary read/write support for an optional compiler requirements string.
  • Add human-readable metadata read/write APIs (per-version) plus a tensor entry point to parse HR metadata.
  • Extend unit tests to cover binary round-trip for the new compiler requirements field.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/plugins/intel_npu/src/plugin/include/metadata.hpp Adds HR read/write APIs to MetadataBase, introduces v2.5 metadata specialization, bumps CURRENT_METADATA_VERSION to 2.5.
src/plugins/intel_npu/src/plugin/src/metadata.cpp Implements v2.5 binary read/write + HR serialization/parsing utilities and HR reader entry point.
src/plugins/intel_npu/tests/unit/npu/metadata_version.cpp Updates test fixture ctor and adds unit tests for binary compiler requirements round-trip (including empty-string behavior).

Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Copy link
Copy Markdown
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

Adds support for exporting/importing NPU plugin metadata in a human-readable key/value format, and extends the binary metadata format with a new v2.5 field for compiler/runtime requirements.

Changes:

  • Introduce write_human_readable() / read_human_readable() APIs on metadata versions and add a parser for the human-readable format.
  • Bump metadata to METADATA_VERSION_2_5 and serialize/deserialize an optional compiler requirements string.
  • Add unit tests covering the new binary field and human-readable round-trips.

Reviewed changes

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

File Description
src/plugins/intel_npu/tests/unit/npu/metadata_version.cpp Adds binary metadata v2.5 unit tests for compiler/runtime requirements string.
src/plugins/intel_npu/tests/unit/npu/metadata_hr.cpp New unit tests for human-readable metadata serialization/parsing across versions.
src/plugins/intel_npu/src/plugin/src/metadata.cpp Implements metadata v2.5 field I/O and human-readable serialization/parsing logic.
src/plugins/intel_npu/src/plugin/include/metadata.hpp Extends metadata API with human-readable methods and defines v2.5/current version.

Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Comment thread src/plugins/intel_npu/src/plugin/include/metadata.hpp Outdated
Comment thread src/plugins/intel_npu/tests/unit/npu/metadata/metadata_text.hpp
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Copy link
Copy Markdown
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 extends the Intel NPU plugin metadata system by introducing a human-readable (text) serialization/deserialization path and bumping the metadata minor version to add a compiler requirements string, while excluding I/O layouts from the human-readable compatibility representation.

Changes:

  • Add metadata version 2.5 with a new compiler requirements string field (get_runtime_reqs()).
  • Implement write_as_text() / read_as_text() across metadata versions, plus a key-value text parser.
  • Add unit tests covering binary and human-readable round-trips for the new fields (notably compiler requirements).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/plugins/intel_npu/tests/unit/npu/metadata_version.cpp Extends binary metadata unit tests to cover v2.5 compiler requirements and bounds checking.
src/plugins/intel_npu/tests/unit/npu/metadata_hr.cpp Adds new unit tests for human-readable metadata round-tripping across versions/fields.
src/plugins/intel_npu/src/plugin/src/metadata.cpp Implements v2.5 binary read/write, human-readable read/write, and text parsing helpers.
src/plugins/intel_npu/src/plugin/include/metadata.hpp Updates public metadata API for human-readable methods, adds v2.5 declarations, and new accessor.

Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Copy link
Copy Markdown
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 extends the Intel NPU plugin blob metadata to support a new version (2.6) that carries a compiler requirements string and introduces human-readable (text) serialization/deserialization for most metadata fields, while intentionally omitting layouts/encryption from the human-readable compatibility string.

Changes:

  • Add METADATA_VERSION_2_6 with runtime/compiler requirements string support and wire it into read/write paths.
  • Introduce human-readable metadata I/O (write_as_text, read_as_text) and a text parser for key/value fields.
  • Update plugin parsing logic for the updated is_encrypted_blob() API and add/extend unit tests (including new HR tests).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/plugins/intel_npu/tests/unit/npu/metadata_version.cpp Extends unit coverage for new metadata fields (compiler requirements) and bounds checking.
src/plugins/intel_npu/tests/unit/npu/metadata_hr.cpp Adds unit tests for human-readable metadata round-tripping and field omission behavior.
src/plugins/intel_npu/src/plugin/src/plugin.cpp Adjusts encrypted-blob handling to the new optional-returning is_encrypted_blob() API.
src/plugins/intel_npu/src/plugin/src/metadata.cpp Implements v2.6 field read/write, adds human-readable read/write + parsing, and strengthens tensor read bounds checks.
src/plugins/intel_npu/src/plugin/include/metadata.hpp Updates metadata versioning, extends API for HR I/O and runtime requirements, and changes encryption flag accessor to std::optional<bool>.

Comment thread src/plugins/intel_npu/tests/unit/npu/metadata/metadata_text.hpp
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp Outdated
* Small cleanup
* Move metadata unit tests to subdir
* Add meta unit tests for text format

Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread src/plugins/intel_npu/tests/unit/npu/metadata/metadata_wrappers.hpp
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp
Comment thread src/plugins/intel_npu/src/plugin/src/metadata.cpp
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: NPU OpenVINO NPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants