diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp index ca48bb0ea31208..5915d284be61fc 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp @@ -158,9 +158,9 @@ std::vector> get_streams_info_table(const int input_streams, stream_info[PROC_TYPE] = ALL_PROC; } } - } else if (((input_streams_changed == false) && + } else if ((((input_streams_changed == false) || ((input_streams_changed == true) && (input_streams == 1))) && (latencyThreadingMode == Config::LatencyThreadingMode::PER_PLATFORM)) || - (proc_type_table.size() == 1) || ((input_streams_changed == true) && (input_streams == 1))) { + (proc_type_table.size() == 1)) { n_streams = 1; if ((proc_type_table.size() == 1) && (model_prefer_threads > 0)) { stream_info[NUMBER_OF_STREAMS] = n_streams; @@ -183,27 +183,17 @@ std::vector> get_streams_info_table(const int input_streams, } else { n_threads_per_stream = proc_type_table[0][ALL_PROC]; } - } else if ((input_streams_changed == false) && + } else if (((input_streams_changed == false) || ((input_streams_changed == true) && (input_streams == 1))) && (latencyThreadingMode == Config::LatencyThreadingMode::PER_SOCKET)) { for (auto& row : proc_socket_table) { n_threads_per_stream = std::max(n_threads_per_stream, row[ALL_PROC]); } - for (auto& row : proc_socket_table) { - if (n_threads_per_stream <= row[ALL_PROC]) { - n_streams++; - } - } - n_streams = input_infer_requests > 0 ? std::min(input_infer_requests, n_streams) : n_streams; + n_streams = 1; } else { for (size_t i = 1; i < proc_type_table.size(); i++) { n_threads_per_stream = std::max(n_threads_per_stream, proc_type_table[i][ALL_PROC]); } - for (size_t i = 1; i < proc_type_table.size(); i++) { - if (n_threads_per_stream <= proc_type_table[i][ALL_PROC]) { - n_streams++; - } - } - n_streams = input_infer_requests > 0 ? std::min(input_infer_requests, n_streams) : n_streams; + n_streams = 1; } } else { n_threads = diff --git a/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp b/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp index 8a773d5712bd29..9e8081c0b89896 100644 --- a/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp @@ -303,7 +303,7 @@ StreamGenerateionTestCase generation_latency_2sockets_48cores_6 = { false, ov::hint::PerformanceMode::LATENCY, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, - {{1, MAIN_CORE_PROC, 24, 0, 0}, {1, MAIN_CORE_PROC, 24, 1, 1}}, + {{1, MAIN_CORE_PROC, 24, 0, 0}}, }; StreamGenerateionTestCase generation_latency_2sockets_48cores_7 = { @@ -325,7 +325,7 @@ StreamGenerateionTestCase generation_latency_2sockets_48cores_7 = { false, ov::hint::PerformanceMode::LATENCY, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, - {{1, MAIN_CORE_PROC, 24, 0, 0}, {1, MAIN_CORE_PROC, 24, 1, 1}}, + {{1, MAIN_CORE_PROC, 24, 0, 0}}, }; StreamGenerateionTestCase generation_latency_2sockets_48cores_8 = { @@ -347,7 +347,7 @@ StreamGenerateionTestCase generation_latency_2sockets_48cores_8 = { false, ov::hint::PerformanceMode::LATENCY, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, - {{1, ALL_PROC, 48, -1, -1}, {0, MAIN_CORE_PROC, 24, 0, 0}, {0, MAIN_CORE_PROC, 24, 1, 1}}, + {{1, MAIN_CORE_PROC, 24, 0, 0}}, }; StreamGenerateionTestCase generation_latency_2sockets_48cores_9 = { @@ -369,7 +369,7 @@ StreamGenerateionTestCase generation_latency_2sockets_48cores_9 = { false, ov::hint::PerformanceMode::LATENCY, {{48, 48, 0, 0, -1, -1}, {24, 24, 0, 0, 0, 0}, {24, 24, 0, 0, 1, 1}}, - {{1, ALL_PROC, 48, -1, -1}, {0, MAIN_CORE_PROC, 24, 0, 0}, {0, MAIN_CORE_PROC, 24, 1, 1}}, + {{1, MAIN_CORE_PROC, 24, 0, 0}}, }; StreamGenerateionTestCase generation_tput_1sockets_14cores_2 = { 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 486a284370daf4..186d6df9b1d220 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 @@ -126,12 +126,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_socket_1 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, - {{1, ALL_PROC, 104, 0, 0}, - {0, MAIN_CORE_PROC, 52, 0, 0}, - {0, HYPER_THREADING_PROC, 52, 0, 0}, - {1, ALL_PROC, 104, 1, 1}, - {0, MAIN_CORE_PROC, 52, 1, 1}, - {0, HYPER_THREADING_PROC, 52, 1, 1}}, + {{1, ALL_PROC, 104, 0, 0}, {0, MAIN_CORE_PROC, 52, 0, 0}, {0, HYPER_THREADING_PROC, 52, 0, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_socket_2 = { 1, @@ -142,7 +137,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_socket_2 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, - {{1, MAIN_CORE_PROC, 52, 0, 0}, {1, MAIN_CORE_PROC, 52, 1, 1}}, + {{1, MAIN_CORE_PROC, 52, 0, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_socket_3 = { 1, @@ -161,12 +156,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_socket_3 = { {0, MAIN_CORE_PROC, 26, 0, 0}, {0, MAIN_CORE_PROC, 26, 1, 0}, {0, HYPER_THREADING_PROC, 26, 0, 0}, - {0, HYPER_THREADING_PROC, 26, 1, 0}, - {1, ALL_PROC, 104, -1, 1}, - {0, MAIN_CORE_PROC, 26, 2, 1}, - {0, MAIN_CORE_PROC, 26, 3, 1}, - {0, HYPER_THREADING_PROC, 26, 2, 1}, - {0, HYPER_THREADING_PROC, 26, 3, 1}}, + {0, HYPER_THREADING_PROC, 26, 1, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_socket_4 = { 1, @@ -177,12 +167,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_socket_4 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, {{104, 104, 0, 0, -1, -1}, {26, 26, 0, 0, 0, 0}, {26, 26, 0, 0, 1, 0}, {26, 26, 0, 0, 2, 1}, {26, 26, 0, 0, 3, 1}}, - {{1, ALL_PROC, 52, -1, 0}, - {0, MAIN_CORE_PROC, 26, 0, 0}, - {0, MAIN_CORE_PROC, 26, 1, 0}, - {1, ALL_PROC, 52, -1, 1}, - {0, MAIN_CORE_PROC, 26, 2, 1}, - {0, MAIN_CORE_PROC, 26, 3, 1}}, + {{1, ALL_PROC, 52, -1, 0}, {0, MAIN_CORE_PROC, 26, 0, 0}, {0, MAIN_CORE_PROC, 26, 1, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_socket_5 = { 1, @@ -215,11 +200,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_socket_7 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_SOCKET, {{104, 104, 0, 0, -1, -1}, {26, 26, 0, 0, 0, 0}, {26, 26, 0, 0, 1, 0}, {26, 26, 0, 0, 2, 1}, {26, 26, 0, 0, 3, 1}}, - {{1, ALL_PROC, 104, -1, -1}, - {0, MAIN_CORE_PROC, 26, 0, 0}, - {0, MAIN_CORE_PROC, 26, 1, 0}, - {0, MAIN_CORE_PROC, 26, 2, 1}, - {0, MAIN_CORE_PROC, 26, 3, 1}}, + {{1, ALL_PROC, 52, -1, 0}, {0, MAIN_CORE_PROC, 26, 0, 0}, {0, MAIN_CORE_PROC, 26, 1, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_socket_8 = { 1, @@ -267,12 +248,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_node_1 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, {{208, 104, 0, 104, -1, -1}, {104, 52, 0, 52, 0, 0}, {104, 52, 0, 52, 1, 1}}, - {{1, ALL_PROC, 104, 0, 0}, - {0, MAIN_CORE_PROC, 52, 0, 0}, - {0, HYPER_THREADING_PROC, 52, 0, 0}, - {1, ALL_PROC, 104, 1, 1}, - {0, MAIN_CORE_PROC, 52, 1, 1}, - {0, HYPER_THREADING_PROC, 52, 1, 1}}, + {{1, ALL_PROC, 104, 0, 0}, {0, MAIN_CORE_PROC, 52, 0, 0}, {0, HYPER_THREADING_PROC, 52, 0, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_node_2 = { 1, @@ -283,7 +259,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_node_2 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, {{104, 104, 0, 0, -1, -1}, {52, 52, 0, 0, 0, 0}, {52, 52, 0, 0, 1, 1}}, - {{1, MAIN_CORE_PROC, 52, 0, 0}, {1, MAIN_CORE_PROC, 52, 1, 1}}, + {{1, MAIN_CORE_PROC, 52, 0, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_node_3 = { 1, @@ -298,18 +274,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_node_3 = { {52, 26, 0, 26, 1, 0}, {52, 26, 0, 26, 2, 1}, {52, 26, 0, 26, 3, 1}}, - {{1, ALL_PROC, 52, -1, 0}, - {0, MAIN_CORE_PROC, 26, 0, 0}, - {0, MAIN_CORE_PROC, 26, 1, 0}, - {1, ALL_PROC, 52, -1, 1}, - {0, MAIN_CORE_PROC, 26, 2, 1}, - {0, MAIN_CORE_PROC, 26, 3, 1}, - {1, ALL_PROC, 52, -1, 0}, - {0, HYPER_THREADING_PROC, 26, 0, 0}, - {0, HYPER_THREADING_PROC, 26, 1, 0}, - {1, ALL_PROC, 52, -1, 1}, - {0, HYPER_THREADING_PROC, 26, 2, 1}, - {0, HYPER_THREADING_PROC, 26, 3, 1}}, + {{1, ALL_PROC, 52, -1, 0}, {0, MAIN_CORE_PROC, 26, 0, 0}, {0, MAIN_CORE_PROC, 26, 1, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_node_4 = { 1, @@ -320,10 +285,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_node_4 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, {{104, 104, 0, 0, -1, -1}, {26, 26, 0, 0, 0, 0}, {26, 26, 0, 0, 1, 0}, {26, 26, 0, 0, 2, 1}, {26, 26, 0, 0, 3, 1}}, - {{1, MAIN_CORE_PROC, 26, 0, 0}, - {1, MAIN_CORE_PROC, 26, 1, 0}, - {1, MAIN_CORE_PROC, 26, 2, 1}, - {1, MAIN_CORE_PROC, 26, 3, 1}}, + {{1, MAIN_CORE_PROC, 26, 0, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_node_5 = { 1, @@ -334,11 +296,7 @@ StreamsCalculationTestCase _2sockets_104cores_latency_node_5 = { "LATENCY", ov::intel_cpu::Config::LatencyThreadingMode::PER_NUMA_NODE, {{104, 104, 0, 0, -1, -1}, {26, 26, 0, 0, 0, 0}, {26, 26, 0, 0, 1, 0}, {26, 26, 0, 0, 2, 1}, {26, 26, 0, 0, 3, 1}}, - {{1, ALL_PROC, 104, -1, -1}, - {0, MAIN_CORE_PROC, 26, 0, 0}, - {0, MAIN_CORE_PROC, 26, 1, 0}, - {0, MAIN_CORE_PROC, 26, 2, 1}, - {0, MAIN_CORE_PROC, 26, 3, 1}}, + {{1, MAIN_CORE_PROC, 26, 0, 0}}, }; StreamsCalculationTestCase _2sockets_104cores_latency_node_6 = { 1,