Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

update default number of streams for throughput mode on single XEON CPU (#30834)

Wanglei Shencebb2700e128
diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp
index f532f1efec9..55088cf04ea 100644
--- a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp
+++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp
@@ -330,12 +330,21 @@ std::vector<std::vector<int>> get_streams_info_table(
n_threads_per_stream = 5;
} else if (0 == n_proc % 3) {
n_threads_per_stream = 3;
- } else if (proc_type_table.size() == 1) {
+ } else if ((proc_type_table[0][EFFICIENT_CORE_PROC] > 0 &&
+ proc_type_table[0][EFFICIENT_CORE_PROC] != proc_type_table[0][ALL_PROC]) ||
+ (proc_type_table[0][LP_EFFICIENT_CORE_PROC] > 0)) {
n_threads_per_stream = n_proc;
} else {
n_threads_per_stream = (n_proc > 16) ? 4 : std::max(1, (n_proc / 4));
}
- n_streams = (n_threads / n_threads_per_stream);
+ if (input_threads > 0) {
+ n_streams = n_threads / n_threads_per_stream;
+ } else {
+ n_streams = 0;
+ for (size_t i = MAIN_CORE_PROC; i <= HYPER_THREADING_PROC; i++) {
+ n_streams += proc_type_table[0][i] / n_threads_per_stream;
+ }
+ }
if ((input_infer_requests > 0) && (n_streams > input_infer_requests)) {
n_streams = input_infer_requests;
if (proc_type_table.size() == 1) {
diff --git a/src/plugins/intel_cpu/tests/unit/streams_info/streams_info_table_test.cpp b/src/plugins/intel_cpu/tests/unit/streams_info/streams_info_table_test.cpp
index 5b9f7b9fb40..b26db799788 100644
--- a/src/plugins/intel_cpu/tests/unit/streams_info/streams_info_table_test.cpp
+++ b/src/plugins/intel_cpu/tests/unit/streams_info/streams_info_table_test.cpp
@@ -1902,6 +1902,17 @@ StreamsCalculationTestCase _1sockets_mock_tput_8 = {
{{16, 4, 8, 4, 0, 0, 0}},
{{2, MAIN_CORE_PROC, 2, 0, 0}, {4, EFFICIENT_CORE_PROC, 2, 0, 0}, {2, LP_EFFICIENT_CORE_PROC, 2, 0, 0}},
};
+StreamsCalculationTestCase _1sockets_mock_tput_9 = {
+ 1,
+ false,
+ 0,
+ 0,
+ 0,
+ "THROUGHPUT",
+ {},
+ {{76, 38, 0, 0, 38, 0, 0}},
+ {{9, MAIN_CORE_PROC, 4, 0, 0}, {9, HYPER_THREADING_PROC, 4, 0, 0}},
+};
StreamsCalculationTestCase _2sockets_mock_latency_1 = {
1,
false,
@@ -2928,6 +2939,7 @@ INSTANTIATE_TEST_SUITE_P(StreamsInfoTable,
_1sockets_mock_tput_6,
_1sockets_mock_tput_7,
_1sockets_mock_tput_8,
+ _1sockets_mock_tput_9,
_2sockets_mock_latency_1,
_2sockets_mock_latency_2,
_2sockets_mock_latency_3,