diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp index ee7bc69efca..b060076db03 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp @@ -137,6 +137,14 @@ std::vector> get_streams_info_table(const int input_streams, } } } + } else if ((1 == model_prefer_threads) && (proc_type_table[0][EFFICIENT_CORE_PROC] > 0) && + (proc_type_table[0][MAIN_CORE_PROC] > 0) && (n_threads > proc_type_table[0][MAIN_CORE_PROC])) { + n_streams = (n_threads >= proc_type_table[0][MAIN_CORE_PROC] + proc_type_table[0][EFFICIENT_CORE_PROC]) + ? static_cast(n_threads - proc_type_table[0][EFFICIENT_CORE_PROC] / 2) + : static_cast(proc_type_table[0][MAIN_CORE_PROC] + + (n_threads - proc_type_table[0][MAIN_CORE_PROC]) / 2); + n_streams = (input_infer_requests > 0) ? std::min(n_streams, input_infer_requests) : n_streams; + n_threads_per_stream = -1; } else { n_streams = ((n_threads + model_prefer_threads - 1) / model_prefer_threads); n_streams = (input_infer_requests > 0) ? std::min(n_streams, input_infer_requests) : n_streams; @@ -150,6 +158,9 @@ std::vector> get_streams_info_table(const int input_streams, while (1) { for (int n = MAIN_CORE_PROC; n < PROC_TYPE_TABLE_SIZE; n++) { if (0 != proc_type_table[0][n]) { + if (n_threads_per_stream == -1) { + stream_info[THREADS_PER_STREAM] = (n == EFFICIENT_CORE_PROC) ? 2 : 1; + } stream_info[PROC_TYPE] = n; stream_info[NUMBER_OF_STREAMS] = static_cast(proc_type_table[0][n] / stream_info[THREADS_PER_STREAM]); diff --git a/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp b/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp index 2fd91f86474..d1f42e8f021 100644 --- a/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/streams_info_table_test.cpp @@ -463,7 +463,7 @@ StreamsCalculationTestCase _1sockets_14cores_tput_5 = { 0, 1, {{20, 6, 8, 6}}, - {{6, MAIN_CORE_PROC, 1}, {8, EFFICIENT_CORE_PROC, 1}, {6, HYPER_THREADING_PROC, 1}}, + {{6, MAIN_CORE_PROC, 1}, {4, EFFICIENT_CORE_PROC, 2}, {6, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_14cores_tput_6 = { @@ -529,6 +529,43 @@ StreamsCalculationTestCase _1sockets_14cores_tput_12 = { {{1, MAIN_CORE_PROC, 6}, {1, EFFICIENT_CORE_PROC, 6}}, }; +StreamsCalculationTestCase _1sockets_14cores_tput_13 = { + 0, + 1, + 0, + 1, + {{20, 6, 8, 6}}, + {{1, MAIN_CORE_PROC, 1}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_tput_14 = { + 0, + 9, + 0, + 1, + {{20, 6, 8, 6}}, + {{6, MAIN_CORE_PROC, 1}, {1, EFFICIENT_CORE_PROC, 2}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_tput_15 = { + 0, + 12, + 0, + 1, + {{20, 6, 8, 6}}, + {{6, MAIN_CORE_PROC, 1}, {3, EFFICIENT_CORE_PROC, 2}}, +}; + +StreamsCalculationTestCase _1sockets_14cores_tput_16 = { + 0, + 15, + 0, + 1, + {{20, 6, 8, 6}}, + {{6, MAIN_CORE_PROC, 1}, {4, EFFICIENT_CORE_PROC, 2}, {1, HYPER_THREADING_PROC, 1}}, +}; + + StreamsCalculationTestCase _1sockets_10cores_latency_1 = { 1, 0, @@ -607,7 +644,7 @@ StreamsCalculationTestCase _1sockets_10cores_tput_5 = { 0, 1, {{12, 2, 8, 2}}, - {{2, MAIN_CORE_PROC, 1}, {8, EFFICIENT_CORE_PROC, 1}, {2, HYPER_THREADING_PROC, 1}}, + {{2, MAIN_CORE_PROC, 1}, {4, EFFICIENT_CORE_PROC, 2}, {2, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_10cores_tput_6 = { @@ -715,7 +752,7 @@ StreamsCalculationTestCase _1sockets_8cores_tput_7 = { 0, 1, {{12, 4, 4, 4}}, - {{4, MAIN_CORE_PROC, 1}, {4, EFFICIENT_CORE_PROC, 1}, {4, HYPER_THREADING_PROC, 1}}, + {{4, MAIN_CORE_PROC, 1}, {2, EFFICIENT_CORE_PROC, 2}, {4, HYPER_THREADING_PROC, 1}}, }; StreamsCalculationTestCase _1sockets_6cores_latency_1 = { @@ -853,6 +890,15 @@ StreamsCalculationTestCase _1sockets_ecores_tput_5 = { {{2, EFFICIENT_CORE_PROC, 8}}, }; +StreamsCalculationTestCase _1sockets_mock_tput_1 = { + 0, + 15, + 0, + 1, + {{20, 6, 7, 6}}, + {{6, MAIN_CORE_PROC, 1}, {3, EFFICIENT_CORE_PROC, 2}, {3, HYPER_THREADING_PROC, 1}}, +}; + TEST_P(StreamsCalculationTests, StreamsCalculation) {} INSTANTIATE_TEST_SUITE_P(StreamsInfoTable, @@ -894,6 +940,10 @@ INSTANTIATE_TEST_SUITE_P(StreamsInfoTable, _1sockets_14cores_tput_10, _1sockets_14cores_tput_11, _1sockets_14cores_tput_12, + _1sockets_14cores_tput_13, + _1sockets_14cores_tput_14, + _1sockets_14cores_tput_15, + _1sockets_14cores_tput_16, _1sockets_10cores_latency_1, _1sockets_10cores_latency_2, _1sockets_10cores_latency_3, @@ -929,6 +979,7 @@ INSTANTIATE_TEST_SUITE_P(StreamsInfoTable, _1sockets_ecores_tput_2, _1sockets_ecores_tput_3, _1sockets_ecores_tput_4, - _1sockets_ecores_tput_5)); + _1sockets_ecores_tput_5, + _1sockets_mock_tput_1)); } // namespace \ No newline at end of file