Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[NPU] Switch COMPILE_LOG_LEVEL to CompileTime (#38481)

Alexandru Enachec7980aafc45d
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp
index b725369ba2f..d18070a9cb8 100644
--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp
+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp
@@ -131,11 +131,10 @@ struct COMPILE_LOG_LEVEL final : OptionBase<COMPILE_LOG_LEVEL, ov::log::Level> {
return "OV_NPU_COMPILE_LOG_LEVEL";
}
- // RunTime despite its name: this is a plugin-side knob, never serialized to the compiler under its own key.
- // serializeConfig() resolves it and forwards the result to the compiler under the compiler-understood
- // LOG_LEVEL key instead.
+ // CompileTime: only affects compilation. serializeConfig() forwards its resolved value to the compiler under
+ // the compiler-understood LOG_LEVEL key instead, and removes this key from the compiler parameters.
static OptionMode mode() {
- return OptionMode::RunTime;
+ return OptionMode::CompileTime;
}
/**
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cpp
index 9faf2fbd517..effe480848f 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cpp
@@ -713,10 +713,9 @@ std::string serializeConfig(const Config& originalConfig,
// is made and the compiler keeps inheriting the plugin LOG_LEVEL exactly as before.
std::optional<Config> configWithCompileLogLevel;
if (originalConfig.has<COMPILE_LOG_LEVEL>()) {
- std::ostringstream levelStr;
- levelStr << originalConfig.get<COMPILE_LOG_LEVEL>();
configWithCompileLogLevel = originalConfig;
- configWithCompileLogLevel->update(ov::log::level.name(), levelStr.str());
+ configWithCompileLogLevel->update(ov::log::level.name(), originalConfig.get<COMPILE_LOG_LEVEL>());
+ configWithCompileLogLevel->remove(ov::intel_npu::compile_log_level.name());
}
const Config& config = configWithCompileLogLevel.has_value() ? *configWithCompileLogLevel : originalConfig;