Enable new property ov::hint::scheduling_core_type (#16106)

* enable apply_processor_type()

* declare PROCESSOR_TYPE

* enable readProperties

* test case for get_property()

* enable set_property() and test cases

* reduce changes

* fix code style issue

* fix python test case issue

* remove python interface

* move processor type definition out of dev_api

* refine coding

* add dependency

* update header file

* update description

* merge intel_cpu header file

* add inline in-code documentation

* change 'UNDEFINED' to 'DEFAULT'

* remove ProcTypeConfig

* refine change

* refine change

* refine process_type to scheduling_core_type

* refine description

* fix code style issue

* change to ov::hint::scheduling_core_type

* fix code style issue

* fix code style issue

* fix python issue

* fix python issue

* fix python issue

* fix python issue

* change core_type_cfg to ov::hint::SchedulingCoreType

* update test case for comments

* update test case for comments

* add default for comments

* update code style

* update for comments

* update for comments

* fix typo

* move cpu_map_scheduling into threading folder

* update for merge conflict

* update for code style
This commit is contained in:
Shen, Wanglei
2023-03-28 10:04:30 +04:00
committed by GitHub
parent 906939a1f1
commit a726f0ae38
18 changed files with 270 additions and 7 deletions
@@ -52,6 +52,10 @@ INSTANTIATE_TEST_SUITE_P(smoke_OVClassSetConfigTest,
OVClassSetUseHyperThreadingHintConfigTest,
::testing::Values("CPU"));
INSTANTIATE_TEST_SUITE_P(smoke_OVClassSetConfigTest,
OVClassSetSchedulingCoreTypeHintConfigTest,
::testing::Values("CPU"));
INSTANTIATE_TEST_SUITE_P(
smoke_OVClassGetMetricTest, OVClassGetMetricTest_OPTIMIZATION_CAPABILITIES,
::testing::Values("CPU"));
@@ -16,6 +16,72 @@ using namespace ov;
namespace {
struct SchedulingCoreTypeTestCase {
ov::hint::SchedulingCoreType input_type;
std::vector<std::vector<int>> proc_type_table;
std::vector<std::vector<int>> result_table;
};
class SchedulingCoreTypeTests : public CommonTestUtils::TestsCommon,
public testing::WithParamInterface<std::tuple<SchedulingCoreTypeTestCase>> {
public:
void SetUp() override {
const auto& test_data = std::get<0>(GetParam());
std::vector<std::vector<int>> test_result_table =
ov::apply_scheduling_core_type(test_data.input_type, test_data.proc_type_table);
ASSERT_EQ(test_data.result_table, test_result_table);
}
};
SchedulingCoreTypeTestCase _2sockets_ALL = {
ov::hint::SchedulingCoreType::ANY_CORE,
{{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}},
{{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}},
};
SchedulingCoreTypeTestCase _2sockets_P_CORE_ONLY = {
ov::hint::SchedulingCoreType::PCORE_ONLY,
{{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}},
{{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}},
};
SchedulingCoreTypeTestCase _2sockets_E_CORE_ONLY = {
ov::hint::SchedulingCoreType::ECORE_ONLY,
{{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}},
{{208, 104, 0, 104}, {104, 52, 0, 52}, {104, 52, 0, 52}},
};
SchedulingCoreTypeTestCase _1sockets_ALL = {
ov::hint::SchedulingCoreType::ANY_CORE,
{{20, 6, 8, 6}},
{{20, 6, 8, 6}},
};
SchedulingCoreTypeTestCase _1sockets_P_CORE_ONLY = {
ov::hint::SchedulingCoreType::PCORE_ONLY,
{{20, 6, 8, 6}},
{{12, 6, 0, 6}},
};
SchedulingCoreTypeTestCase _1sockets_E_CORE_ONLY = {
ov::hint::SchedulingCoreType::ECORE_ONLY,
{{20, 6, 8, 6}},
{{8, 0, 8, 0}},
};
TEST_P(SchedulingCoreTypeTests, SchedulingCoreType) {}
INSTANTIATE_TEST_SUITE_P(SchedulingCoreTypeTable,
SchedulingCoreTypeTests,
testing::Values(_2sockets_ALL,
_2sockets_P_CORE_ONLY,
_2sockets_E_CORE_ONLY,
_1sockets_ALL,
_1sockets_P_CORE_ONLY,
_1sockets_E_CORE_ONLY));
struct UseHTTestCase {
bool use_ht_value;
bool use_ht_changed;
@@ -29,9 +95,7 @@ public:
const auto& test_data = std::get<0>(GetParam());
std::vector<std::vector<int>> test_result_table =
ov::apply_hyper_threading(test_data.use_ht_value,
test_data.use_ht_changed,
test_data.proc_type_table);
ov::apply_hyper_threading(test_data.use_ht_value, test_data.use_ht_changed, test_data.proc_type_table);
ASSERT_EQ(test_data.result_table, test_result_table);
}