From ebc82d6faf52e11b92d1214658a44a765cf7a088 Mon Sep 17 00:00:00 2001 From: Irina Efode Date: Tue, 19 Mar 2024 20:02:52 +0400 Subject: [PATCH 1/4] [API CONFORMANCE] Move some propeties from mandatory to optional for sw plugins --- .../exec_network_base.cpp | 0 .../get_metric.cpp | 0 .../import_export.cpp | 0 .../properties.cpp | 0 .../src/ov_plugin/properties.cpp | 20 ++++--- .../behavior/ov_plugin/properties_tests.hpp | 12 ++-- .../behavior/ov_plugin/properties_tests.cpp | 60 ++++++++++++++----- 7 files changed, 65 insertions(+), 27 deletions(-) rename src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/{ov_executable_network => ov_compiled_model}/exec_network_base.cpp (100%) rename src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/{ov_executable_network => ov_compiled_model}/get_metric.cpp (100%) rename src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/{compiled_model => ov_compiled_model}/import_export.cpp (100%) rename src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/{ov_executable_network => ov_compiled_model}/properties.cpp (100%) diff --git a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_executable_network/exec_network_base.cpp b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/exec_network_base.cpp similarity index 100% rename from src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_executable_network/exec_network_base.cpp rename to src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/exec_network_base.cpp diff --git a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_executable_network/get_metric.cpp b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/get_metric.cpp similarity index 100% rename from src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_executable_network/get_metric.cpp rename to src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/get_metric.cpp diff --git a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/compiled_model/import_export.cpp b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/import_export.cpp similarity index 100% rename from src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/compiled_model/import_export.cpp rename to src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/import_export.cpp diff --git a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_executable_network/properties.cpp b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/properties.cpp similarity index 100% rename from src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_executable_network/properties.cpp rename to src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_compiled_model/properties.cpp diff --git a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp index 7176ea57d14d6f..0d2ecf323ecc6f 100644 --- a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp +++ b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp @@ -24,7 +24,7 @@ INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVPropertiesIncorrectTests, const std::vector default_properties = { {}, - {ov::enable_profiling(true)}, + {ov::enable_profiling(sw_plugin_in_target_device(ov::test::utils::target_device) ? false : true)}, }; INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVPropertiesTests, @@ -36,37 +36,43 @@ INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVPropertiesTests, INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVCheckGetSupportedROMetricsPropsTests, ::testing::Combine( ::testing::Values(ov::test::utils::target_device), - ::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::getROMandatoryProperties())), + ::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::getROMandatoryProperties( + sw_plugin_in_target_device(ov::test::utils::target_device)))), OVCheckGetSupportedROMetricsPropsTests::getTestCaseName); INSTANTIATE_TEST_SUITE_P(ov_plugin, OVCheckGetSupportedROMetricsPropsTests, ::testing::Combine( ::testing::Values(ov::test::utils::target_device), - ::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::getROOptionalProperties())), + ::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::getROOptionalProperties( + sw_plugin_in_target_device(ov::test::utils::target_device)))), OVCheckGetSupportedROMetricsPropsTests::getTestCaseName); INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVCheckSetSupportedRWMetricsPropsTests, ::testing::Combine( ::testing::Values(ov::test::utils::target_device), - ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWMandatoryPropertiesValues())), + ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWMandatoryPropertiesValues( + {}, sw_plugin_in_target_device(ov::test::utils::target_device)))), OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName); INSTANTIATE_TEST_SUITE_P(ov_plugin, OVCheckSetSupportedRWMetricsPropsTests, ::testing::Combine( ::testing::Values(ov::test::utils::target_device), - ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWOptionalPropertiesValues())), + ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWOptionalPropertiesValues( + {}, sw_plugin_in_target_device(ov::test::utils::target_device)))), OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName); INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVCheckSetIncorrectRWMetricsPropsTests, ::testing::Combine( ::testing::Values(ov::test::utils::target_device), - ::testing::ValuesIn(OVCheckSetIncorrectRWMetricsPropsTests::getWrongRWMandatoryPropertiesValues())), + ::testing::ValuesIn(OVCheckSetIncorrectRWMetricsPropsTests::getWrongRWMandatoryPropertiesValues( + {}, sw_plugin_in_target_device(ov::test::utils::target_device)))), OVCheckSetIncorrectRWMetricsPropsTests::getTestCaseName); INSTANTIATE_TEST_SUITE_P(ov_plugin, OVCheckSetIncorrectRWMetricsPropsTests, ::testing::Combine( ::testing::Values(ov::test::utils::target_device), - ::testing::ValuesIn(OVCheckSetIncorrectRWMetricsPropsTests::getWrongRWOptionalPropertiesValues())), + ::testing::ValuesIn(OVCheckSetIncorrectRWMetricsPropsTests::getWrongRWOptionalPropertiesValues( + {}, sw_plugin_in_target_device(ov::test::utils::target_device)))), OVCheckSetIncorrectRWMetricsPropsTests::getTestCaseName); INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVCheckChangePropComplieModleGetPropTests_DEVICE_ID, diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp index 752a67818f285a..5bab29f90bc78b 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp @@ -67,14 +67,14 @@ class OVPropertiesTestsWithCompileModelProps : public testing::WithParamInterfac AnyMap compileModelProperties; - static std::vector getROMandatoryProperties(); - static std::vector getROOptionalProperties(); + static std::vector getROMandatoryProperties(bool is_sw_device = false); + static std::vector getROOptionalProperties(bool is_sw_device = false); static std::vector configureProperties(std::vector props); - static std::vector getRWMandatoryPropertiesValues(std::vector props = {}); - static std::vector getWrongRWMandatoryPropertiesValues(std::vector props = {}); - static std::vector getRWOptionalPropertiesValues(std::vector props = {}); - static std::vector getWrongRWOptionalPropertiesValues(std::vector props = {}); + static std::vector getRWMandatoryPropertiesValues(const std::vector& props = {}, bool is_sw_device = false); + static std::vector getWrongRWMandatoryPropertiesValues(const std::vector& props = {}, bool is_sw_device = false); + static std::vector getRWOptionalPropertiesValues(const std::vector& props = {}, bool is_sw_device = false); + static std::vector getWrongRWOptionalPropertiesValues(const std::vector& props = {}, bool is_sw_device = false); static std::vector getModelDependcePropertiesValues(); }; diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp index 9452690a596e55..96871b9dbb94cc 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp @@ -210,18 +210,26 @@ TEST_P(OVSetPropComplieModleGetPropTests, SetPropertyAndComplieModelWithPropsWor } } -std::vector OVPropertiesTestsWithCompileModelProps::getROMandatoryProperties() { +std::vector OVPropertiesTestsWithCompileModelProps::getROMandatoryProperties(bool is_sw_device) { std::vector res; - res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::device::full_name.mutability), nullptr}}); - res.push_back({{ov::PropertyName(ov::device::architecture.name(), ov::device::architecture.mutability), nullptr}}); - res.push_back({{ov::PropertyName(ov::device::type.name(), ov::device::type.mutability), nullptr}}); - res.push_back({{ov::PropertyName(ov::execution_devices.name(), ov::execution_devices.mutability), nullptr}}); + if (!is_sw_device) { + res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::device::full_name.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::device::architecture.name(), ov::device::architecture.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::device::type.name(), ov::device::type.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::execution_devices.name(), ov::execution_devices.mutability), nullptr}}); + } return res; } -std::vector OVPropertiesTestsWithCompileModelProps::getROOptionalProperties() { +std::vector OVPropertiesTestsWithCompileModelProps::getROOptionalProperties(bool is_sw_device) { std::vector res; + if (is_sw_device) { + res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::device::full_name.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::device::architecture.name(), ov::device::architecture.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::device::type.name(), ov::device::type.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::execution_devices.name(), ov::execution_devices.mutability), nullptr}}); + } res.push_back({{ov::PropertyName(ov::loaded_from_cache.name(), ov::loaded_from_cache.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::uuid.name(), ov::device::uuid.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::luid.name(), ov::device::luid.mutability), nullptr}}); @@ -241,7 +249,9 @@ std::vector OVPropertiesTestsWithCompileModelProps::configurePropert return res; } -std::vector OVPropertiesTestsWithCompileModelProps::getRWMandatoryPropertiesValues(std::vector props) { +std::vector +OVPropertiesTestsWithCompileModelProps::getRWMandatoryPropertiesValues( + const std::vector& props, bool is_sw_device) { std::vector res; if (props.empty() || std::find(props.begin(), props.end(), ov::hint::performance_mode.name()) != props.end()) { @@ -268,14 +278,18 @@ std::vector OVPropertiesTestsWithCompileModelProps::getRWMandatoryPr res.push_back({{ov::enable_profiling(false)}}); } - if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) { - res.push_back({ov::streams::num(3)}); + if (!is_sw_device) { + if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) { + res.push_back({ov::streams::num(3)}); + } } return res; } -std::vector OVPropertiesTestsWithCompileModelProps::getWrongRWMandatoryPropertiesValues(std::vector props) { +std::vector +OVPropertiesTestsWithCompileModelProps::getWrongRWMandatoryPropertiesValues( + const std::vector& props, bool is_sw_device) { std::vector res; if (props.empty() || std::find(props.begin(), props.end(), ov::hint::performance_mode.name()) != props.end()) { @@ -294,14 +308,18 @@ std::vector OVPropertiesTestsWithCompileModelProps::getWrongRWMandat res.push_back({{ov::enable_profiling.name(), -1}}); } - if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) { - res.push_back({ov::streams::num(-10)}); + if (!is_sw_device) { + if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) { + res.push_back({ov::streams::num(-10)}); + } } return res; } -std::vector OVPropertiesTestsWithCompileModelProps::getRWOptionalPropertiesValues(std::vector props) { +std::vector +OVPropertiesTestsWithCompileModelProps::getRWOptionalPropertiesValues( + const std::vector& props, bool is_sw_device) { std::vector res; if (props.empty() || std::find(props.begin(), props.end(), ov::inference_num_threads.name()) != props.end()) { @@ -348,10 +366,18 @@ std::vector OVPropertiesTestsWithCompileModelProps::getRWOptionalPro } } + if (is_sw_device) { + if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) { + res.push_back({ov::streams::num(3)}); + } + } + return res; } -std::vector OVPropertiesTestsWithCompileModelProps::getWrongRWOptionalPropertiesValues(std::vector props) { +std::vector +OVPropertiesTestsWithCompileModelProps::getWrongRWOptionalPropertiesValues( + const std::vector& props, bool is_sw_device) { std::vector res; if (props.empty() || std::find(props.begin(), props.end(), ov::inference_num_threads.name()) != props.end()) { @@ -383,6 +409,12 @@ std::vector OVPropertiesTestsWithCompileModelProps::getWrongRWOption res.push_back({{ov::log::level.name(), -3}}); } + if (is_sw_device) { + if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) { + res.push_back({ov::streams::num(-10)}); + } + } + return res; } From c3ce7fd6c87c192b3483d8a40b0299e501565b75 Mon Sep 17 00:00:00 2001 From: Irina Efode Date: Wed, 20 Mar 2024 11:48:19 +0400 Subject: [PATCH 2/4] Apply review comments --- .../src/ov_plugin/properties.cpp | 2 +- .../behavior/ov_plugin/properties_tests.cpp | 54 +++++++++++++------ 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp index 0d2ecf323ecc6f..e6710c6cf6e464 100644 --- a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp +++ b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/ov_plugin/properties.cpp @@ -24,7 +24,7 @@ INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVPropertiesIncorrectTests, const std::vector default_properties = { {}, - {ov::enable_profiling(sw_plugin_in_target_device(ov::test::utils::target_device) ? false : true)}, + {ov::enable_profiling(false)}, }; INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVPropertiesTests, diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp index 96871b9dbb94cc..2a3dcd836e6e19 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp @@ -212,11 +212,12 @@ TEST_P(OVSetPropComplieModleGetPropTests, SetPropertyAndComplieModelWithPropsWor std::vector OVPropertiesTestsWithCompileModelProps::getROMandatoryProperties(bool is_sw_device) { std::vector res; + res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::device::full_name.mutability), nullptr}}); if (!is_sw_device) { - res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::device::full_name.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::architecture.name(), ov::device::architecture.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::type.name(), ov::device::type.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::execution_devices.name(), ov::execution_devices.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::available_devices.name(), ov::available_devices.mutability), nullptr}}); } return res; @@ -225,10 +226,10 @@ std::vector OVPropertiesTestsWithCompileModelProps::getROMandatoryPr std::vector OVPropertiesTestsWithCompileModelProps::getROOptionalProperties(bool is_sw_device) { std::vector res; if (is_sw_device) { - res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::device::full_name.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::architecture.name(), ov::device::architecture.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::type.name(), ov::device::type.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::execution_devices.name(), ov::execution_devices.mutability), nullptr}}); + res.push_back({{ov::PropertyName(ov::available_devices.name(), ov::available_devices.mutability), nullptr}}); } res.push_back({{ov::PropertyName(ov::loaded_from_cache.name(), ov::loaded_from_cache.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::uuid.name(), ov::device::uuid.mutability), nullptr}}); @@ -581,7 +582,10 @@ TEST_P(OVCheckMetricsPropsTests_ModelDependceProps, ChangeCorrectDevicePropertie TEST_P(OVClassSetDefaultDeviceIDPropTest, SetDefaultDeviceIDNoThrow) { ov::Core ie = ov::test::utils::create_core(); - + // sw plugins are not requested to support `ov::available_devices` and ` ov::device::id` property + if (sw_plugin_in_target_device(target_device)) { + return; + } auto deviceIDs = ie.get_property(target_device, ov::available_devices); if (std::find(deviceIDs.begin(), deviceIDs.end(), deviceID) == deviceIDs.end()) { GTEST_FAIL(); @@ -603,6 +607,10 @@ TEST_P(OVSpecificDeviceSetConfigTest, GetConfigSpecificDeviceNoThrow) { clear_target_device = target_device.substr(0, pos); deviceID = target_device.substr(pos + 1, target_device.size()); } + // sw plugins are not requested to support `ov::available_devices`, `ov::device::id` and `ov::num_streams` property + if (sw_plugin_in_target_device(target_device)) { + return; + } auto deviceIDs = ie.get_property(clear_target_device, ov::available_devices); if (std::find(deviceIDs.begin(), deviceIDs.end(), deviceID) == deviceIDs.end()) { GTEST_FAIL() << "No DeviceID" << std::endl; @@ -640,9 +648,12 @@ TEST_P(OVSpecificDeviceGetConfigTest, GetConfigSpecificDeviceNoThrow) { clear_target_device = target_device.substr(0, pos); deviceID = target_device.substr(pos + 1, target_device.size()); } - auto deviceIDs = ie.get_property(clear_target_device, ov::available_devices); - if (std::find(deviceIDs.begin(), deviceIDs.end(), deviceID) == deviceIDs.end()) { - GTEST_FAIL() << "No DeviceID" << std::endl; + // sw plugins are not requested to support `ov::available_devices` property + if (!sw_plugin_in_target_device(target_device)) { + auto deviceIDs = ie.get_property(clear_target_device, ov::available_devices); + if (std::find(deviceIDs.begin(), deviceIDs.end(), deviceID) == deviceIDs.end()) { + GTEST_FAIL() << "No DeviceID" << std::endl; + } } std::vector configValues; @@ -684,9 +695,12 @@ TEST_P(OVSpecificDeviceTestSetConfig, SetConfigSpecificDeviceNoThrow) { cleartarget_device = target_device.substr(0, pos); deviceID = target_device.substr(pos + 1, target_device.size()); } - auto deviceIDs = ie.get_property(cleartarget_device, ov::available_devices); - if (std::find(deviceIDs.begin(), deviceIDs.end(), deviceID) == deviceIDs.end()) { - GTEST_FAIL(); + // sw plugins are not requested to support `ov::available_devices` property + if (!sw_plugin_in_target_device(target_device)) { + auto deviceIDs = ie.get_property(cleartarget_device, ov::available_devices); + if (std::find(deviceIDs.begin(), deviceIDs.end(), deviceID) == deviceIDs.end()) { + GTEST_FAIL(); + } } OV_ASSERT_NO_THROW(ie.set_property(target_device, ov::enable_profiling(true))); @@ -713,7 +727,12 @@ TEST_P(OVGetMetricPropsTest, GetMetricAndPrintNoThrow_AVAILABLE_DEVICES) { for (auto&& device_id : device_ids) { std::string full_name; - OV_ASSERT_NO_THROW(full_name = ie.get_property(target_device, ov::device::full_name, ov::device::id(device_id))); + // sw plugins are not requested to support `ov::device::id` property + if (sw_plugin_in_target_device(target_device)) { + OV_ASSERT_NO_THROW(full_name = ie.get_property(target_device, ov::device::full_name)); + } else { + OV_ASSERT_NO_THROW(full_name = ie.get_property(target_device, ov::device::full_name, ov::device::id(device_id))); + } ASSERT_FALSE(full_name.empty()); } @@ -800,14 +819,14 @@ TEST_P(OVClassCompileModelAndCheckSecondaryPropertiesTest, CompileModelAndCheckS ASSERT_TRUE(it != configuration.end()); property = it->second.as().begin()->second.as(); if (it == configuration.end()) { - it = configuration.find(ov::num_streams.name()); + it = configuration.find(ov::hint::num_requests.name()); } } - ASSERT_TRUE(property.count(ov::num_streams.name())); - auto actual = property.at(ov::num_streams.name()).as(); + ASSERT_TRUE(property.count(ov::hint::num_requests.name())); + auto actual = property.at(ov::hint::num_requests.name()).as(); ov::Any value; //AutoExcutableNetwork GetMetric() does not support key ov::num_streams - OV_ASSERT_NO_THROW(value = model.get_property(ov::num_streams.name())); + OV_ASSERT_NO_THROW(value = model.get_property(ov::hint::num_requests.name())); int32_t expect = value.as(); ASSERT_EQ(actual, expect); } @@ -820,7 +839,12 @@ TEST_P(OVClassSeveralDevicesTestDefaultCore, DefaultCoreSeveralDevicesNoThrow) { if (pos != std::string::npos) { clear_target_device = target_devices.begin()->substr(0, pos); } - auto deviceIDs = ie.get_property(clear_target_device, ov::available_devices); + std::vector deviceIDs; + if (sw_plugin_in_target_device(clear_target_device)) { + deviceIDs = {clear_target_device}; + } else { + deviceIDs = ie.get_property(clear_target_device, ov::available_devices); + } if (deviceIDs.size() < target_devices.size()) GTEST_FAIL() << "Incorrect Device ID" << std::endl; From 927bc32d39902d84edb3806fc6ea4dacd7c15fda Mon Sep 17 00:00:00 2001 From: Irina Efode Date: Thu, 21 Mar 2024 13:01:24 +0400 Subject: [PATCH 3/4] Move cpu specific test from dhared lib --- .../behavior/ov_plugin/properties_tests.cpp | 38 +++++++++++++++++++ .../behavior/ov_plugin/properties_tests.hpp | 1 - .../behavior/ov_plugin/properties_tests.cpp | 34 ----------------- 3 files changed, 38 insertions(+), 35 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp index 34b87fbb464c1a..5710d4e0c434e2 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp @@ -133,6 +133,44 @@ const std::vector configsDevicePropertiesDouble = { ov::device::properties(ov::AnyMap{{"CPU", ov::AnyMap{ov::num_streams(5)}}})}}; + + + +using OVClassCompileModelAndCheckSecondaryPropertiesTest = OVClassSetDevicePriorityConfigPropsTest; +TEST_P(OVClassCompileModelAndCheckSecondaryPropertiesTest, CompileModelAndCheckSecondaryPropertiesTest) { + ov::Core ie = ov::test::utils::create_core(); + ov::CompiledModel model; + OV_ASSERT_NO_THROW(model = ie.compile_model(actualNetwork, target_device, configuration)); + ov::AnyMap property = configuration; + ov::AnyMap::iterator it = configuration.end(); + // device properties in form ov::device::properties(DEVICE, ...) has the first priority + for (it = configuration.begin(); it != configuration.end(); it++) { + if ((it->first.find(ov::device::properties.name()) != std::string::npos) && + (it->first != ov::device::properties.name())) { + break; + } + } + if (it != configuration.end()) { + // DEVICE_PROPERTIES_ found + property = it->second.as(); + } else { + // search for DEVICE_PROPERTIES + it = configuration.find(ov::device::properties.name()); + ASSERT_TRUE(it != configuration.end()); + property = it->second.as().begin()->second.as(); + if (it == configuration.end()) { + it = configuration.find(ov::num_streams.name()); + } + } + ASSERT_TRUE(property.count(ov::num_streams.name())); + auto actual = property.at(ov::num_streams.name()).as(); + ov::Any value; + //AutoExcutableNetwork GetMetric() does not support key ov::num_streams + OV_ASSERT_NO_THROW(value = model.get_property(ov::num_streams.name())); + int32_t expect = value.as(); + ASSERT_EQ(actual, expect); +} + // OV Class load and check network with ov::device::properties INSTANTIATE_TEST_SUITE_P(smoke_CPU_OVClassCompileModelAndCheckSecondaryPropertiesTest, OVClassCompileModelAndCheckSecondaryPropertiesTest, diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp index 5bab29f90bc78b..ef7e960526856b 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp @@ -104,7 +104,6 @@ class OVClassSetDefaultDeviceIDPropTest : public OVPluginTestBase, using OVClassCompileModelWithCondidateDeviceListContainedMetaPluginTest = OVClassSetDevicePriorityConfigPropsTest; using OVClassCompileModelReturnDefaultHintTest = OVClassSetDevicePriorityConfigPropsTest; using OVClassCompileModelDoNotReturnDefaultHintTest = OVClassSetDevicePriorityConfigPropsTest; -using OVClassCompileModelAndCheckSecondaryPropertiesTest = OVClassSetDevicePriorityConfigPropsTest; using OVGetConfigTest = OVClassBaseTestP; using OVSpecificDeviceSetConfigTest = OVClassBaseTestP; diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp index 2a3dcd836e6e19..d54010dcbf0d27 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp @@ -797,40 +797,6 @@ TEST_P(OVGetMetricPropsOptionalTest, GetMetricAndPrintNoThrow_RANGE_FOR_STREAMS) OV_ASSERT_PROPERTY_SUPPORTED(ov::range_for_streams); } -TEST_P(OVClassCompileModelAndCheckSecondaryPropertiesTest, CompileModelAndCheckSecondaryPropertiesTest) { - ov::Core ie = ov::test::utils::create_core(); - ov::CompiledModel model; - OV_ASSERT_NO_THROW(model = ie.compile_model(actualNetwork, target_device, configuration)); - ov::AnyMap property = configuration; - ov::AnyMap::iterator it = configuration.end(); - // device properties in form ov::device::properties(DEVICE, ...) has the first priority - for (it = configuration.begin(); it != configuration.end(); it++) { - if ((it->first.find(ov::device::properties.name()) != std::string::npos) && - (it->first != ov::device::properties.name())) { - break; - } - } - if (it != configuration.end()) { - // DEVICE_PROPERTIES_ found - property = it->second.as(); - } else { - // search for DEVICE_PROPERTIES - it = configuration.find(ov::device::properties.name()); - ASSERT_TRUE(it != configuration.end()); - property = it->second.as().begin()->second.as(); - if (it == configuration.end()) { - it = configuration.find(ov::hint::num_requests.name()); - } - } - ASSERT_TRUE(property.count(ov::hint::num_requests.name())); - auto actual = property.at(ov::hint::num_requests.name()).as(); - ov::Any value; - //AutoExcutableNetwork GetMetric() does not support key ov::num_streams - OV_ASSERT_NO_THROW(value = model.get_property(ov::hint::num_requests.name())); - int32_t expect = value.as(); - ASSERT_EQ(actual, expect); -} - TEST_P(OVClassSeveralDevicesTestDefaultCore, DefaultCoreSeveralDevicesNoThrow) { ov::Core ie; From 99e7de727b32dabf5d58ac6940bd90fc46cd209e Mon Sep 17 00:00:00 2001 From: Irina Efode Date: Thu, 21 Mar 2024 13:50:45 +0400 Subject: [PATCH 4/4] Revert move tests --- .../behavior/ov_plugin/properties_tests.cpp | 35 +------------------ .../behavior/ov_plugin/properties_tests.hpp | 2 +- .../behavior/ov_plugin/properties_tests.cpp | 34 ++++++++++++++++++ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp index 5710d4e0c434e2..ab6b3580fc7c44 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp @@ -136,40 +136,7 @@ const std::vector configsDevicePropertiesDouble = { -using OVClassCompileModelAndCheckSecondaryPropertiesTest = OVClassSetDevicePriorityConfigPropsTest; -TEST_P(OVClassCompileModelAndCheckSecondaryPropertiesTest, CompileModelAndCheckSecondaryPropertiesTest) { - ov::Core ie = ov::test::utils::create_core(); - ov::CompiledModel model; - OV_ASSERT_NO_THROW(model = ie.compile_model(actualNetwork, target_device, configuration)); - ov::AnyMap property = configuration; - ov::AnyMap::iterator it = configuration.end(); - // device properties in form ov::device::properties(DEVICE, ...) has the first priority - for (it = configuration.begin(); it != configuration.end(); it++) { - if ((it->first.find(ov::device::properties.name()) != std::string::npos) && - (it->first != ov::device::properties.name())) { - break; - } - } - if (it != configuration.end()) { - // DEVICE_PROPERTIES_ found - property = it->second.as(); - } else { - // search for DEVICE_PROPERTIES - it = configuration.find(ov::device::properties.name()); - ASSERT_TRUE(it != configuration.end()); - property = it->second.as().begin()->second.as(); - if (it == configuration.end()) { - it = configuration.find(ov::num_streams.name()); - } - } - ASSERT_TRUE(property.count(ov::num_streams.name())); - auto actual = property.at(ov::num_streams.name()).as(); - ov::Any value; - //AutoExcutableNetwork GetMetric() does not support key ov::num_streams - OV_ASSERT_NO_THROW(value = model.get_property(ov::num_streams.name())); - int32_t expect = value.as(); - ASSERT_EQ(actual, expect); -} + // OV Class load and check network with ov::device::properties INSTANTIATE_TEST_SUITE_P(smoke_CPU_OVClassCompileModelAndCheckSecondaryPropertiesTest, diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp index ef7e960526856b..3d7110efeb33bd 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/properties_tests.hpp @@ -104,7 +104,7 @@ class OVClassSetDefaultDeviceIDPropTest : public OVPluginTestBase, using OVClassCompileModelWithCondidateDeviceListContainedMetaPluginTest = OVClassSetDevicePriorityConfigPropsTest; using OVClassCompileModelReturnDefaultHintTest = OVClassSetDevicePriorityConfigPropsTest; using OVClassCompileModelDoNotReturnDefaultHintTest = OVClassSetDevicePriorityConfigPropsTest; - +using OVClassCompileModelAndCheckSecondaryPropertiesTest = OVClassSetDevicePriorityConfigPropsTest; using OVGetConfigTest = OVClassBaseTestP; using OVSpecificDeviceSetConfigTest = OVClassBaseTestP; using OVSpecificDeviceGetConfigTest = OVClassBaseTestP; diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp index d54010dcbf0d27..8761140369a9ee 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp @@ -749,6 +749,40 @@ TEST_P(OVGetMetricPropsTest, GetMetriDeviceFullNameWithoutAdditionalTerminatorCh } } +TEST_P(OVClassCompileModelAndCheckSecondaryPropertiesTest, CompileModelAndCheckSecondaryPropertiesTest) { + ov::Core ie = ov::test::utils::create_core(); + ov::CompiledModel model; + OV_ASSERT_NO_THROW(model = ie.compile_model(actualNetwork, target_device, configuration)); + ov::AnyMap property = configuration; + ov::AnyMap::iterator it = configuration.end(); + // device properties in form ov::device::properties(DEVICE, ...) has the first priority + for (it = configuration.begin(); it != configuration.end(); it++) { + if ((it->first.find(ov::device::properties.name()) != std::string::npos) && + (it->first != ov::device::properties.name())) { + break; + } + } + if (it != configuration.end()) { + // DEVICE_PROPERTIES_ found + property = it->second.as(); + } else { + // search for DEVICE_PROPERTIES + it = configuration.find(ov::device::properties.name()); + ASSERT_TRUE(it != configuration.end()); + property = it->second.as().begin()->second.as(); + if (it == configuration.end()) { + it = configuration.find(ov::num_streams.name()); + } + } + ASSERT_TRUE(property.count(ov::num_streams.name())); + auto actual = property.at(ov::num_streams.name()).as(); + ov::Any value; + //AutoExcutableNetwork GetMetric() does not support key ov::num_streams + OV_ASSERT_NO_THROW(value = model.get_property(ov::num_streams.name())); + int32_t expect = value.as(); + ASSERT_EQ(actual, expect); +} + TEST_P(OVGetMetricPropsTest, GetMetricAndPrintNoThrow_OPTIMIZATION_CAPABILITIES) { ov::Core ie = ov::test::utils::create_core(); std::vector capabilities;