From d3f8efa86b3ae305b9dd2c69d763af00f8d1fdf6 Mon Sep 17 00:00:00 2001 From: Nesterov Alexander Date: Fri, 16 Aug 2024 07:22:13 +0200 Subject: [PATCH] [ARM][CPU] Fix ACL FC executor post ops check on ARM32 (#26065) ### Tickets: - CVS-149013 --- .../executors/acl/acl_fullyconnected.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_fullyconnected.cpp b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_fullyconnected.cpp index 99acb9070550dc..6f464abf33d036 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/acl/acl_fullyconnected.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/acl/acl_fullyconnected.cpp @@ -156,12 +156,15 @@ static MemoryPtr prepareWeightMemory(const MemoryArgs &memory, } static bool checkPostOps(const PostOps &postOps) { - // Add postops - if (!postOps.empty() && postOps.size() == 1) { - if (const auto activation = std::dynamic_pointer_cast(postOps[0])) { - if (checkActivationLayerInfo(convertToEltwiseAlgorithm(activation->type()))) { - return true; - } + if (postOps.empty()) { + return true; + } + if (postOps.size() > 1) { + return false; + } + if (const auto activation = std::dynamic_pointer_cast(postOps[0])) { + if (checkActivationLayerInfo(convertToEltwiseAlgorithm(activation->type()))) { + return true; } } return false; @@ -179,7 +182,7 @@ static void initFCAttrs(const FCAttrs &attrs, fullyConnectedLayerInfo.transpose_weights = false; aclfcAttrs.weightsNonTransposed = attrs.weightsNonTransposed; - if (checkPostOps(postOps)) { + if (!postOps.empty() && checkPostOps(postOps)) { auto activation = std::dynamic_pointer_cast(postOps[0]); fullyConnectedLayerInfo.activation_info = getActivationLayerInfo( convertToEltwiseAlgorithm(activation->type()), @@ -203,10 +206,7 @@ bool ACLFullyConnectedExecutor::supports(const FCConfig &config) { VERIFY(one_of(srcType(config), ov::element::f16, ov::element::f32), UNSUPPORTED_SRC_PRECISIONS); VERIFY(one_of(weiType(config), ov::element::f16, ov::element::f32), UNSUPPORTED_WEI_PRECISIONS); VERIFY(postOpsNumbers(config) < 2, UNSUPPORTED_NUMBER_OF_POSTOPS); - // This define is set because on ARM32 devices postOps in the function is empty (CVS-149013) -#ifndef OPENVINO_ARCH_ARM VERIFY(checkPostOps(config.postOps), UNSUPPORTED_TYPE_OF_POSTOPS); -#endif VERIFY(one_of(srcRank(config), 2U, 3U, 4U), UNSUPPORTED_SRC_RANK); VERIFY(one_of(weiRank(config), 2U, 3U), UNSUPPORTED_WEI_RANK); return true;