[NPU] Human readable plugin metadata#35571
[NPU] Human readable plugin metadata#35571alexandruenache1111 wants to merge 20 commits intoopenvinotoolkit:masterfrom
Conversation
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
…are equal to 0 Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
There was a problem hiding this comment.
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). |
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
There was a problem hiding this comment.
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_5and 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. |
There was a problem hiding this comment.
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 requirementsstring 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. |
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
Signed-off-by: alexandruenache1111 <alexandru.enache@intel.com>
There was a problem hiding this comment.
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_6with 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>. |
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>
Details:
Tickets:
AI Assistance: