Enable default performance hint as tput in AUTO (#11848)
* Enable hint to tput if no property is specified for both AUTO device and target device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. Update logic. 2. Add test cases. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Set hints to default for target device if no hints setting for AUTO plugin and no specific properties setting for target device. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
This commit is contained in:
parent
1872e05375
commit
378b3a2dca
@ -106,8 +106,12 @@ std::vector<DeviceInformation> MultiDeviceInferencePlugin::ParseMetaDevices(cons
|
||||
if (!deviceIDLocal.empty()) {
|
||||
tconfig[PluginConfigParams::KEY_DEVICE_ID] = deviceIDLocal;
|
||||
}
|
||||
|
||||
return GetCore()->GetSupportedConfig(deviceName, tconfig);
|
||||
auto deviceConfig = GetCore()->GetSupportedConfig(deviceName, tconfig);
|
||||
if (deviceConfig.find(PluginConfigParams::KEY_PERFORMANCE_HINT) == deviceConfig.end() && tconfig.find(deviceName) == tconfig.end()) {
|
||||
// setting tput as the default performance mode if no hints setting for AUTO plugin and no properties specified for target device.
|
||||
deviceConfig[PluginConfigParams::KEY_PERFORMANCE_HINT] = PluginConfigParams::THROUGHPUT;
|
||||
}
|
||||
return deviceConfig;
|
||||
};
|
||||
|
||||
auto getDefaultDeviceID = [this](std::string deviceName) -> std::string {
|
||||
|
@ -273,4 +273,25 @@ INSTANTIATE_TEST_SUITE_P(smoke_AUTO_OVClassLoadNetworkWithSecondaryPropertiesTes
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
smoke_OVClassLoadNetworkTest, OVClassLoadNetworkTest,
|
||||
::testing::Values("CPU"));
|
||||
|
||||
const std::vector<ov::AnyMap> default_properties = {{ov::device::priorities("CPU")}};
|
||||
const std::vector<ov::AnyMap> auto_default_properties = {{}};
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_OVClassLoadNetworkWithDefaultPropertiesTest,
|
||||
OVClassLoadNetworkWithDefaultPropertiesTest,
|
||||
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_AUTO),
|
||||
::testing::ValuesIn(default_properties)));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AUTO_OVClassLoadNetworkWithDefaultPropertiesTest,
|
||||
OVClassLoadNetworkWithDefaultPropertiesTest,
|
||||
::testing::Combine(::testing::Values("AUTO:CPU"),
|
||||
::testing::ValuesIn(auto_default_properties)));
|
||||
|
||||
const std::vector<ov::AnyMap> default_incorrect_properties = {
|
||||
{ov::device::priorities("CPU"), ov::device::properties("CPU", ov::hint::allow_auto_batching(true))},
|
||||
};
|
||||
const std::vector<ov::AnyMap> auto_default_incorrect_properties = {{}};
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_OVClassLoadNetworkWithDefaultIncorrectPropertiesTest,
|
||||
OVClassLoadNetworkWithDefaultIncorrectPropertiesTest,
|
||||
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_AUTO),
|
||||
::testing::ValuesIn(default_incorrect_properties)));
|
||||
} // namespace
|
||||
|
@ -101,6 +101,8 @@ using OVClassSetLogLevelConfigTest = OVClassBaseTestP;
|
||||
using OVClassSpecificDeviceTestSetConfig = OVClassBaseTestP;
|
||||
using OVClassSpecificDeviceTestGetConfig = OVClassBaseTestP;
|
||||
using OVClassLoadNetworkWithCorrectPropertiesTest = OVClassSetDevicePriorityConfigTest;
|
||||
using OVClassLoadNetworkWithDefaultPropertiesTest = OVClassSetDevicePriorityConfigTest;
|
||||
using OVClassLoadNetworkWithDefaultIncorrectPropertiesTest = OVClassSetDevicePriorityConfigTest;
|
||||
|
||||
class OVClassSeveralDevicesTest : public OVClassNetworkTest,
|
||||
public ::testing::WithParamInterface<std::vector<std::string>> {
|
||||
@ -1026,6 +1028,24 @@ TEST_P(OVClassLoadNetworkWithCorrectPropertiesTest, LoadNetworkWithCorrectProper
|
||||
OV_ASSERT_NO_THROW(ie.compile_model(actualNetwork, deviceName, configuration));
|
||||
}
|
||||
|
||||
TEST_P(OVClassLoadNetworkWithDefaultPropertiesTest, LoadNetworkWithDefaultPropertiesTest) {
|
||||
ov::Core ie = createCoreWithTemplate();
|
||||
ov::CompiledModel model;
|
||||
OV_ASSERT_NO_THROW(model = ie.compile_model(actualNetwork, deviceName, configuration));
|
||||
ov::hint::PerformanceMode value;
|
||||
OV_ASSERT_NO_THROW(value = model.get_property(ov::hint::performance_mode));
|
||||
ASSERT_EQ(value, ov::hint::PerformanceMode::THROUGHPUT);
|
||||
}
|
||||
|
||||
TEST_P(OVClassLoadNetworkWithDefaultIncorrectPropertiesTest, LoadNetworkWithDefaultIncorrectPropertiesTest) {
|
||||
ov::Core ie = createCoreWithTemplate();
|
||||
ov::CompiledModel model;
|
||||
OV_ASSERT_NO_THROW(model = ie.compile_model(actualNetwork, deviceName, configuration));
|
||||
ov::hint::PerformanceMode value;
|
||||
OV_ASSERT_NO_THROW(value = model.get_property(ov::hint::performance_mode));
|
||||
ASSERT_EQ(value, ov::hint::PerformanceMode::UNDEFINED);
|
||||
}
|
||||
|
||||
TEST_P(OVClassLoadNetworkTest, LoadNetworkWithInvalidDeviceIDThrows) {
|
||||
ov::Core ie = createCoreWithTemplate();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user