From dd0846b8d5ef24273ecd159a73628180692e7ebd Mon Sep 17 00:00:00 2001 From: Chen Xu Date: Wed, 5 Jun 2024 15:27:36 +0800 Subject: [PATCH] [CPU] [Snippets] Fix performance regression in calling parallel_nt (#24832) ### Details: - *This PR fixes geomean level performance issue caused by https://github.com/openvinotoolkit/openvino/pull/23180 on platforms with sufficient cores.* - *In the PR mensioned above, `parallel_nt` is used for executing subgraph instead of `parallel_for5d`, becuase the former has performance advantage for the case where #tasks is more than #threads*. That is becuase using `parallel_nt`, we can initilize parameters for each thread, while parameters are initilized for each task in using `parallel_for5d`. So `parallel_nt` has less overheads. - *However, for the case where #tasks is less than #threads, `parallel_nt` brings performance regression. Because compared with `parallel_for5d`, `parallel_nt` doesn't apply the argument `tbb::static_partitioner{}` when calling `tbb::parallel_for`. Here we use `parallel_nt_static` instead to fix the performance regression.* --- src/plugins/intel_cpu/src/nodes/subgraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/subgraph.cpp b/src/plugins/intel_cpu/src/nodes/subgraph.cpp index 01a7e2eedb9..d3bcf5aa668 100644 --- a/src/plugins/intel_cpu/src/nodes/subgraph.cpp +++ b/src/plugins/intel_cpu/src/nodes/subgraph.cpp @@ -879,7 +879,7 @@ void Subgraph::SubgraphExecutor::parallel_for6d(const std::function