Skip to content

Commit

Permalink
Pass empty cache_dir to plugin which supports it (openvinotoolkit#24018)
Browse files Browse the repository at this point in the history
### Details:
 - *item1*
 - *...*

### Tickets:
 - *CVS-132745*

---------

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
Co-authored-by: River Li <river.li@intel.com>
  • Loading branch information
zhaixuejun1993 and riverlijunjie authored May 7, 2024
1 parent 2140a1e commit bc3f071
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/inference/src/dev/core_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_npu/src/plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
if (!set_cache_dir.empty()) {
const auto compilerType = localConfig.get<COMPILER_TYPE>();
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");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/proxy/tests/proxy_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>();
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);
Expand Down

0 comments on commit bc3f071

Please sign in to comment.