Skip to content

Commit 40723df

Browse files
Forgot to update the serialization function
1 parent 59630db commit 40723df

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

src/plugins/intel_npu/src/compiler_adapter/include/vcl_serializer.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ namespace driver_compiler_utils {
2929
*
3030
* @param compilerVersion The compiler version reported by the driver.
3131
* @param supportedOpsetVersion The last operators set version supported by the compiler.
32-
* @param useBaseModelSerializer "true" means the legacy serializer will be used (weights will be copied), "false" means
33-
* the optimized one is used instead (weights pointers are stored instead).
32+
* @param config Used to determine which version of the implementation will be applied.
3433
*/
3534
SerializedIR serializeIR(const std::shared_ptr<const ov::Model>& model,
3635
ze_graph_compiler_version_info_t compilerVersion,
3736
const uint32_t supportedOpsetVersion,
38-
const bool useBaseModelSerializer = true);
37+
const FilteredConfig& config);
3938

4039
/**
4140
* @brief Serialize input / output information to string format.

src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,7 @@ std::shared_ptr<IGraph> DriverCompilerAdapter::compile(const std::shared_ptr<con
9090

9191
_logger.debug("serialize IR");
9292

93-
auto serializedIR = driver_compiler_utils::serializeIR(
94-
model,
95-
compilerVersion,
96-
maxOpsetVersion,
97-
config.isAvailable(ov::intel_npu::use_base_model_serializer.name()) ? config.get<USE_BASE_MODEL_SERIALIZER>()
98-
: true);
93+
auto serializedIR = driver_compiler_utils::serializeIR(model, compilerVersion, maxOpsetVersion, config);
9994

10095
std::string buildFlags;
10196
const bool useIndices = !((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 9));
@@ -151,12 +146,7 @@ std::shared_ptr<IGraph> DriverCompilerAdapter::compileWS(const std::shared_ptr<o
151146
}
152147

153148
_logger.debug("serialize IR");
154-
auto serializedIR = driver_compiler_utils::serializeIR(
155-
model,
156-
compilerVersion,
157-
maxOpsetVersion,
158-
config.isAvailable(ov::intel_npu::use_base_model_serializer.name()) ? config.get<USE_BASE_MODEL_SERIALIZER>()
159-
: true);
149+
auto serializedIR = driver_compiler_utils::serializeIR(model, compilerVersion, maxOpsetVersion, config);
160150

161151
std::string buildFlags;
162152
const bool useIndices = !((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 9));
@@ -299,12 +289,7 @@ ov::SupportedOpsMap DriverCompilerAdapter::query(const std::shared_ptr<const ov:
299289
_logger.info("getSupportedOpsetVersion Max supported version of opset in CiD: %d", maxOpsetVersion);
300290

301291
_logger.debug("serialize IR");
302-
auto serializedIR = driver_compiler_utils::serializeIR(
303-
model,
304-
compilerVersion,
305-
maxOpsetVersion,
306-
config.isAvailable(ov::intel_npu::use_base_model_serializer.name()) ? config.get<USE_BASE_MODEL_SERIALIZER>()
307-
: true);
292+
auto serializedIR = driver_compiler_utils::serializeIR(model, compilerVersion, maxOpsetVersion, config);
308293

309294
std::string buildFlags;
310295
buildFlags += driver_compiler_utils::serializeConfig(config, compilerVersion);

src/plugins/intel_npu/src/compiler_adapter/src/vcl_serializer.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,15 @@ class VCLSerializerWithoutWeightsCopy : public VCLSerializerBase {
455455
SerializedIR serializeIR(const std::shared_ptr<const ov::Model>& model,
456456
const ze_graph_compiler_version_info_t compilerVersion,
457457
const uint32_t supportedOpsetVersion,
458-
const bool useBaseModelSerializer) {
458+
const FilteredConfig& config) {
459+
bool useBaseModelSerializer = true;
460+
if (config.isAvailable(ov::intel_npu::use_base_model_serializer.name())) {
461+
useBaseModelSerializer = config.get<USE_BASE_MODEL_SERIALIZER>();
462+
} else if (config.isAvailable(ov::intel_npu::model_serializer_version.name())) {
463+
useBaseModelSerializer =
464+
!(config.get<MODEL_SERIALIZER_VERSION>() == ov::intel_npu::ModelSerializerVersion::NO_WEIGHTS_COPY);
465+
}
466+
459467
if (!useBaseModelSerializer) {
460468
// Non-constness required for adding & removing weights pointer attributes. The current instance is already a
461469
// clone (or should be one), we are not modifying the original model.

0 commit comments

Comments
 (0)