[AUTO] update logic of checking if device with ID is proxy (#21493)
* the proxy device with id should be also a proxy device. * 1. using real name in the logic of checking if device is proxy. 2. Disable the added test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * enable test case --------- Signed-off-by: Wang, Yang <yang4.wang@intel.com> Co-authored-by: Chen Peter <peter.chen@intel.com>
This commit is contained in:
@@ -325,8 +325,9 @@ bool ov::CoreImpl::is_proxy_device(const ov::Plugin& plugin) const {
|
||||
}
|
||||
bool ov::CoreImpl::is_proxy_device(const std::string& dev_name) const {
|
||||
#ifdef PROXY_PLUGIN_ENABLED
|
||||
return pluginRegistry.find(dev_name) != pluginRegistry.end() &&
|
||||
pluginRegistry.at(dev_name).pluginCreateFunc == ov::proxy::create_plugin;
|
||||
std::string real_name = ov::parseDeviceNameIntoConfig(dev_name)._deviceName;
|
||||
return pluginRegistry.find(real_name) != pluginRegistry.end() &&
|
||||
pluginRegistry.at(real_name).pluginCreateFunc == ov::proxy::create_plugin;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
using namespace ov::proxy::tests;
|
||||
|
||||
TEST_F(ProxyTests, can_parse_and_inherit_batch_property) {
|
||||
register_plugin_support_reshape(core, "MOCK_DEVICE", {{ov::proxy::configuration::alias.name(), "ALIAS_MOCK"}});
|
||||
register_plugin_support_reshape(core, "MOCK_DEVICE", {{ov::proxy::configuration::alias.name(), "MOCK_DEVICE"}});
|
||||
auto available_devices = core.get_available_devices();
|
||||
auto model = create_model_with_add();
|
||||
auto compiled_model_default = core.compile_model(model, "MOCK_DEVICE", ov::hint::performance_mode("THROUGHPUT"));
|
||||
@@ -31,4 +31,29 @@ TEST_F(ProxyTests, can_parse_and_inherit_batch_property) {
|
||||
ov::hint::performance_mode("THROUGHPUT"),
|
||||
ov::hint::allow_auto_batching(false));
|
||||
EXPECT_ANY_THROW(compiled_model_no_batch.get_property(ov::auto_batch_timeout));
|
||||
}
|
||||
|
||||
TEST_F(ProxyTests, can_parse_and_inherit_batch_property_for_device_name_with_id) {
|
||||
register_plugin_support_reshape(core, "MOCK_DEVICE", {{ov::proxy::configuration::alias.name(), "MOCK_DEVICE"}});
|
||||
auto available_devices = core.get_available_devices();
|
||||
auto model = create_model_with_add();
|
||||
auto compiled_model_default = core.compile_model(model, "MOCK_DEVICE.1", ov::hint::performance_mode("THROUGHPUT"));
|
||||
#ifdef ENABLE_AUTO_BATCH
|
||||
EXPECT_NO_THROW(compiled_model_default.get_property(ov::auto_batch_timeout)); // batch enabled by default
|
||||
EXPECT_EQ(compiled_model_default.get_property(ov::auto_batch_timeout), 1000); // default value
|
||||
#endif
|
||||
auto compiled_model_with_batch = core.compile_model(model,
|
||||
"MOCK_DEVICE.1",
|
||||
ov::hint::performance_mode("THROUGHPUT"),
|
||||
ov::hint::allow_auto_batching(true),
|
||||
ov::auto_batch_timeout(8));
|
||||
#ifdef ENABLE_AUTO_BATCH
|
||||
EXPECT_NO_THROW(compiled_model_with_batch.get_property(ov::auto_batch_timeout));
|
||||
EXPECT_EQ(compiled_model_with_batch.get_property(ov::auto_batch_timeout), 8);
|
||||
#endif
|
||||
auto compiled_model_no_batch = core.compile_model(model,
|
||||
"MOCK_DEVICE.2",
|
||||
ov::hint::performance_mode("THROUGHPUT"),
|
||||
ov::hint::allow_auto_batching(false));
|
||||
EXPECT_ANY_THROW(compiled_model_no_batch.get_property(ov::auto_batch_timeout));
|
||||
}
|
||||
Reference in New Issue
Block a user