Skip to content

Commit 80e587b

Browse files
[NPU] Registering a new config option that will be used for enabling the new model serializer (#32303)
### Details: - The new model serializer is being developed on [this branch](#31939). Registering only the config option in advance will allow us to merge the compiler PR sooner since it has a dependency on it. ### Tickets: - *CVS-173711*
1 parent 7de8ff8 commit 80e587b

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,4 +1411,18 @@ struct WS_COMPILE_CALL_NUMBER final : OptionBase<WS_COMPILE_CALL_NUMBER, uint32_
14111411
}
14121412
};
14131413

1414+
struct USE_BASE_MODEL_SERIALIZER final : OptionBase<USE_BASE_MODEL_SERIALIZER, bool> {
1415+
static std::string_view key() {
1416+
return ov::intel_npu::use_base_model_serializer.name();
1417+
}
1418+
1419+
static bool defaultValue() {
1420+
return true;
1421+
}
1422+
1423+
static OptionMode mode() {
1424+
return OptionMode::CompileTime;
1425+
}
1426+
};
1427+
14141428
} // namespace intel_npu

src/plugins/intel_npu/src/al/include/intel_npu/npu_private_properties.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,21 @@ static constexpr ov::Property<WSVersion> separate_weights_version{"NPU_SEPARATE_
348348
*/
349349
static constexpr ov::Property<bool> weightless_blob{"NPU_WEIGHTLESS_BLOB"};
350350

351+
/**
352+
* @brief [Only for NPU Plugin]
353+
* Type: bool. Default is "true".
354+
*
355+
* This config option concerns the algorithm used for serializing the "ov::Model" at compilation time in order to be
356+
* passed through the driver.
357+
*
358+
* The base serializer is the OV implementation of the "XmlSerializer" without any extensions. All weights are copied in
359+
* a separate buffer. By turning this off, the NPU extension of the serializer is enabled. This allows optimizing the
360+
* process by avoiding copies into a separate weights buffer. However, this solution may be less reliable.
361+
*
362+
* @note This option doesn't actually do anything right now, it has been registered in advance.
363+
*/
364+
static constexpr ov::Property<bool> use_base_model_serializer{"NPU_USE_BASE_MODEL_SERIALIZER"};
365+
351366
/**
352367
* @brief [Experimental, only for NPU Plugin]
353368
* Type: integer.

src/plugins/intel_npu/src/plugin/src/plugin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ void Plugin::init_options() {
298298
REGISTER_OPTION(WEIGHTLESS_BLOB);
299299
REGISTER_OPTION(SEPARATE_WEIGHTS_VERSION);
300300
REGISTER_OPTION(WS_COMPILE_CALL_NUMBER);
301+
REGISTER_OPTION(USE_BASE_MODEL_SERIALIZER);
301302

302303
if (_backend) {
303304
if (_backend->isCommandQueueExtSupported()) {

src/plugins/intel_npu/src/plugin/src/properties.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ void Properties::registerPluginProperties() {
382382
TRY_REGISTER_SIMPLE_PROPERTY(ov::workload_type, WORKLOAD_TYPE);
383383
TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::weightless_blob, WEIGHTLESS_BLOB);
384384
TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::separate_weights_version, SEPARATE_WEIGHTS_VERSION);
385+
TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::use_base_model_serializer, USE_BASE_MODEL_SERIALIZER);
385386

386387
TRY_REGISTER_CUSTOMFUNC_PROPERTY(ov::intel_npu::stepping, STEPPING, [&](const Config& config) {
387388
if (!config.has<STEPPING>()) {

0 commit comments

Comments
 (0)