Skip to content

Commit bc3f071

Browse files
Pass empty cache_dir to plugin which supports it (openvinotoolkit#24018)
### Details: - *item1* - *...* ### Tickets: - *CVS-132745* --------- Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com> Co-authored-by: River Li <river.li@intel.com>
1 parent 2140a1e commit bc3f071

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/inference/src/dev/core_impl.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -1287,11 +1287,9 @@ void ov::CoreImpl::set_property_for_device(const ov::AnyMap& configMap, const st
12871287
{
12881288
OPENVINO_SUPPRESS_DEPRECATED_START
12891289
if (device_supports_cache_dir(plugin.second)) {
1290-
ov::AnyMap empty_map;
1291-
auto cacheConfig = coreConfig.get_cache_config_for_device(plugin.second, empty_map);
1292-
if (cacheConfig._cacheManager) {
1293-
configCopy[ov::cache_dir.name()] = cacheConfig._cacheDir;
1294-
}
1290+
ov::AnyMap empty_map = {};
1291+
configCopy[ov::cache_dir.name()] =
1292+
coreConfig.get_cache_config_for_device(plugin.second, empty_map)._cacheDir;
12951293
} else if (configCopy.count(ov::cache_dir.name()) > 0) {
12961294
// Remove "CACHE_DIR" from config if it is not supported by plugin
12971295
configCopy.erase(ov::cache_dir.name());

src/plugins/intel_npu/src/plugin/src/plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
532532
if (!set_cache_dir.empty()) {
533533
const auto compilerType = localConfig.get<COMPILER_TYPE>();
534534
if (compilerType == ov::intel_npu::CompilerType::MLIR) {
535-
_logger.error("Option 'CACHE_DIR' is not supported with MLIR compiler type");
535+
OPENVINO_THROW("Option 'CACHE_DIR' is not supported with MLIR compiler type");
536536
}
537537
}
538538

src/plugins/proxy/tests/proxy_tests.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_subtract(ov::Core& co
649649
for (const auto& it : properties) {
650650
if (it.first == ov::enable_profiling.name())
651651
m_profiling = it.second.as<bool>();
652-
else if (it.first == ov::device::id.name())
652+
else if (it.first == ov::device::id.name() || it.first == ov::cache_dir.name())
653653
continue;
654654
else
655655
OPENVINO_THROW(get_device_name(), " set config: " + it.first);

0 commit comments

Comments
 (0)