Skip to content

Commit 9a1e0e0

Browse files
will return the hash ID for the first device in the candidate list passed into AUTO.
1 parent d0e49ff commit 9a1e0e0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/inference/src/dev/core_impl.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,17 @@ ov::SoPtr<ov::ICompiledModel> ov::CoreImpl::load_model_from_cache(
14511451
std::string ov::CoreImpl::compute_hash(const std::shared_ptr<const ov::Model>& model,
14521452
const std::string& deviceName,
14531453
const ov::AnyMap& compileOptions) {
1454-
auto properties = create_compile_config(get_plugin(deviceName), compileOptions);
1454+
std::string actualDeviceName = deviceName;
1455+
if (deviceName.find("AUTO") != std::string::npos) {
1456+
auto pos = deviceName.find_first_of(":");
1457+
if (pos != std::string::npos) {
1458+
auto deviceNames = ov::DeviceIDParser::get_multi_devices(deviceName.substr(pos + 1));
1459+
actualDeviceName = deviceNames.size() > 0 ? deviceNames.back() : deviceName;
1460+
} else {
1461+
return "Cannot compute hash for AUTO device without actual device name";
1462+
}
1463+
}
1464+
auto properties = create_compile_config(get_plugin(actualDeviceName), compileOptions);
14551465
return ov::ModelCache::compute_hash(model, properties);
14561466
}
14571467

0 commit comments

Comments
 (0)