Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed "NPU_USE_NPUW" : "NO" case #25926

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/plugins/intel_npu/src/plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,17 +596,23 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
// ... 2 - this request is NOT coming from NPUW,
// activate the NPUW path
auto useNpuwKey = ov::intel_npu::use_npuw.name();
if (properties.count(useNpuwKey) && properties.at(useNpuwKey).as<bool>()) {
// CACHE_DIR isn't supported with NPU_USE_NPUW
if (properties.count(ov::cache_dir.name()) || !_globalConfig.get<CACHE_DIR>().empty()) {
OPENVINO_THROW("Option 'CACHE_DIR' is not supported with NPU_USE_NPUW");
ov::AnyMap localProperties = properties;
if (localProperties.count(useNpuwKey)) {
if (localProperties.at(useNpuwKey).as<bool>() == true) {
// CACHE_DIR isn't supported with NPU_USE_NPUW
if (localProperties.count(ov::cache_dir.name()) || !_globalConfig.get<CACHE_DIR>().empty()) {
OPENVINO_THROW("Option 'CACHE_DIR' is not supported with NPU_USE_NPUW");
}
return std::make_shared<ov::npuw::CompiledModel>(model->clone(), shared_from_this(), localProperties);
} else {
// NPUW is disabled, remove the key from the properties
localProperties.erase(useNpuwKey);
}
return std::make_shared<ov::npuw::CompiledModel>(model->clone(), shared_from_this(), properties);
}

const std::map<std::string, std::string> propertiesMap = any_copy(properties);
update_log_level(propertiesMap);
auto localConfig = merge_configs(_globalConfig, propertiesMap);
const std::map<std::string, std::string> localPropertiesMap = any_copy(localProperties);
update_log_level(localPropertiesMap);
auto localConfig = merge_configs(_globalConfig, localPropertiesMap);

const auto set_cache_dir = localConfig.get<CACHE_DIR>();
if (!set_cache_dir.empty()) {
Expand Down
Loading