Skip to content

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

[NPU] Fix BOTH options on Import path if not supported by Plugin (#34579)

Bogdan Pereanu109ac7f9e0f7
diff --git a/src/plugins/intel_npu/src/plugin/src/properties.cpp b/src/plugins/intel_npu/src/plugin/src/properties.cpp
index 2844c90cfb6..a8035de8e80 100644
--- a/src/plugins/intel_npu/src/plugin/src/properties.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/properties.cpp
@@ -1142,11 +1142,22 @@ FilteredConfig Properties::getConfigWithCompilerPropertiesDisabled(const ov::Any
const std::map<std::string, std::string> rawConfig = any_copy(properties);
std::map<std::string, std::string> cfgsToSet;
for (const auto& [key, value] : rawConfig) {
- if ((updatedConfig.hasOpt(key) && updatedConfig.getOpt(key).mode() == OptionMode::CompileTime)) {
- _logger.info(
- "Config key '%s' is recognized as a compiler option, will not be used for current configuration.",
- key.c_str());
- continue;
+ if (updatedConfig.hasOpt(key)) {
+ const auto optionMode = updatedConfig.getOpt(key).mode();
+
+ if (optionMode == OptionMode::CompileTime) {
+ _logger.info(
+ "Config key '%s' is recognized as a compiler option, will not be used for current configuration.",
+ key.c_str());
+ continue;
+ }
+
+ if (optionMode == OptionMode::Both && !updatedConfig.isAvailable(key)) {
+ _logger.info(
+ "Config key '%s' is not enabled by the plugin, will not be used for current configuration.",
+ key.c_str());
+ continue;
+ }
}
cfgsToSet.emplace(key, value);