From bc3f0710d50164ddd30c07fcad933f101af8dedb Mon Sep 17 00:00:00 2001 From: Xuejun Zhai Date: Tue, 7 May 2024 19:11:09 +0800 Subject: [PATCH] Pass empty cache_dir to plugin which supports it (#24018) ### Details: - *item1* - *...* ### Tickets: - *CVS-132745* --------- Signed-off-by: Zhai, Xuejun Co-authored-by: River Li --- src/inference/src/dev/core_impl.cpp | 8 +++----- src/plugins/intel_npu/src/plugin/src/plugin.cpp | 2 +- src/plugins/proxy/tests/proxy_tests.cpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/inference/src/dev/core_impl.cpp b/src/inference/src/dev/core_impl.cpp index 398f13e9acfb93..afcc9f90487cd0 100644 --- a/src/inference/src/dev/core_impl.cpp +++ b/src/inference/src/dev/core_impl.cpp @@ -1287,11 +1287,9 @@ void ov::CoreImpl::set_property_for_device(const ov::AnyMap& configMap, const st { OPENVINO_SUPPRESS_DEPRECATED_START if (device_supports_cache_dir(plugin.second)) { - ov::AnyMap empty_map; - auto cacheConfig = coreConfig.get_cache_config_for_device(plugin.second, empty_map); - if (cacheConfig._cacheManager) { - configCopy[ov::cache_dir.name()] = cacheConfig._cacheDir; - } + ov::AnyMap empty_map = {}; + configCopy[ov::cache_dir.name()] = + coreConfig.get_cache_config_for_device(plugin.second, empty_map)._cacheDir; } else if (configCopy.count(ov::cache_dir.name()) > 0) { // Remove "CACHE_DIR" from config if it is not supported by plugin configCopy.erase(ov::cache_dir.name()); diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp index b94e95d3b8e344..66e197116dc151 100644 --- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp +++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp @@ -532,7 +532,7 @@ std::shared_ptr Plugin::compile_model(const std::shared_ptr< if (!set_cache_dir.empty()) { const auto compilerType = localConfig.get(); if (compilerType == ov::intel_npu::CompilerType::MLIR) { - _logger.error("Option 'CACHE_DIR' is not supported with MLIR compiler type"); + OPENVINO_THROW("Option 'CACHE_DIR' is not supported with MLIR compiler type"); } } diff --git a/src/plugins/proxy/tests/proxy_tests.cpp b/src/plugins/proxy/tests/proxy_tests.cpp index 5d182f86e7ebc3..d633eaf9b45395 100644 --- a/src/plugins/proxy/tests/proxy_tests.cpp +++ b/src/plugins/proxy/tests/proxy_tests.cpp @@ -649,7 +649,7 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_subtract(ov::Core& co for (const auto& it : properties) { if (it.first == ov::enable_profiling.name()) m_profiling = it.second.as(); - else if (it.first == ov::device::id.name()) + else if (it.first == ov::device::id.name() || it.first == ov::cache_dir.name()) continue; else OPENVINO_THROW(get_device_name(), " set config: " + it.first);