Skip to content

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

[NPUW] Fix weights_path property (#28997)

Alexey Smirnovaed285c0a1cc
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp
index e90cf708b9d..f1fb8219ed1 100644
--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp
+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp
@@ -215,7 +215,7 @@ struct WEIGHTS_PATH final : OptionBase<WEIGHTS_PATH, std::string> {
}
static OptionMode mode() {
- return OptionMode::CompileTime;
+ return OptionMode::RunTime;
}
};
diff --git a/src/plugins/intel_npu/src/al/src/config/runtime.cpp b/src/plugins/intel_npu/src/al/src/config/runtime.cpp
index 3586cf18e08..70eb06c1d6f 100644
--- a/src/plugins/intel_npu/src/al/src/config/runtime.cpp
+++ b/src/plugins/intel_npu/src/al/src/config/runtime.cpp
@@ -26,6 +26,7 @@ void intel_npu::registerRunTimeOptions(OptionsDesc& desc) {
desc.add<ENABLE_CPU_PINNING>();
desc.add<WORKLOAD_TYPE>();
desc.add<TURBO>();
+ desc.add<WEIGHTS_PATH>();
desc.add<BYPASS_UMD_CACHING>();
desc.add<RUN_INFERENCES_SEQUENTIALLY>();
}
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp
index 51e42478e7c..5445a1b776b 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp
@@ -580,6 +580,10 @@ std::string DriverCompilerAdapter::serializeConfig(const Config& config,
std::ostringstream turbostring;
turbostring << ov::intel_npu::turbo.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+" << VALUE_DELIMITER;
content = std::regex_replace(content, std::regex(turbostring.str()), "");
+ // Remove weights path property as it is not used by compiler
+ std::ostringstream weightspathstream;
+ weightspathstream << ov::weights_path.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+" << VALUE_DELIMITER;
+ content = std::regex_replace(content, std::regex(weightspathstream.str()), "");
// Remove Bypass UMD Caching propery
std::ostringstream umdcachestring;
umdcachestring << ov::intel_npu::bypass_umd_caching.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"