Skip to content

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

[Snippets][CPU] Enable MLP sequence and GatedMLP support for ARM64 arch (#31754)

Arseniy Obolenskiyf6e5240f1e7a
diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp
index ba084f242a1..5c5235c0189 100644
--- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp
+++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp
@@ -1277,6 +1277,11 @@ void Transformations::MainSnippets() {
#if !defined(SNIPPETS_LIBXSMM_TPP) && defined(OPENVINO_ARCH_X86_64)
const bool isMlpSeqSupported = is_infer_prc_supported_by_brgemm;
+#elif defined(OPENVINO_ARCH_ARM64)
+ // Note: Currently, MLPSeqSnippets is enabled only in tests
+ // TODO: Enable TokenizeMLPSeqSnippets on ARM for all scenarios
+ const bool isMlpSeqSupported =
+ any_of(config.inferencePrecision, ov::element::f32, ov::element::dynamic) && ignoreCallback;
#else
const bool isMlpSeqSupported = false;
#endif
diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp
index 4c5481ea964..807faf4639a 100644
--- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp
+++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp
@@ -511,10 +511,8 @@ std::vector<std::string> disabledTestPatterns() {
#if defined(OPENVINO_ARCH_ARM64)
// Tests to be enabled on ARM64
retVector.emplace_back(R"(smoke_Snippets_ConvAdd/ConvEltwise.CompareWithRefImpl.*)");
- retVector.emplace_back(R"(smoke_Snippets_GatedMLP.*)");
retVector.emplace_back(R"(smoke_Snippets_GroupNormalization.*)");
retVector.emplace_back(R"(smoke_Snippets_MHA.*)");
- retVector.emplace_back(R"(smoke_Snippets_MLP_SEQ.*)");
retVector.emplace_back(R"(smoke_Snippets_PrecisionPropagation_Convertion.*)");
#endif
#if defined(_WIN32)
diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/snippets/mlp_seq.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/snippets/mlp_seq.cpp
index 8998ae935a3..8695187df4a 100644
--- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/snippets/mlp_seq.cpp
+++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/snippets/mlp_seq.cpp
@@ -26,11 +26,19 @@ std::vector<std::vector<InputShape>> inputShape_2D() {
// - The first element is the number of hidden layers in the MLP
// - The second element is a pair: {expected number of subgraphs, expected number of nodes}
std::vector<std::pair<size_t, std::pair<size_t, size_t>>> numHiddenLayersWithExpectations() {
+#if defined(OPENVINO_ARCH_ARM64)
+ return {
+ {1, {1, 1}},
+ {3, {1, 1}},
+ {5, {1, 1}},
+ };
+#else
return {
{1, {1, 1}},
{3, {2, 2}},
{5, {3, 3}},
};
+#endif
}
std::vector<std::pair<size_t, std::pair<size_t, size_t>>> numHiddenLayersWithExpectationsBf16() {
@@ -43,12 +51,21 @@ std::vector<std::pair<size_t, std::pair<size_t, size_t>>> numHiddenLayersWithExp
}
std::vector<std::pair<size_t, std::pair<size_t, size_t>>> numHiddenLayersWithExpectationsQuantized() {
+#if defined(OPENVINO_ARCH_ARM64)
+ return {
+ {1, {1, 1}},
+ {3, {1, 1}},
+ {5, {1, 1}},
+ {7, {1, 1}},
+ };
+#else
return {
{1, {1, 1}},
{3, {1, 1}},
{5, {1, 1}},
{7, {2, 2}},
};
+#endif
}
std::vector<size_t> hiddenMatmulSizes() {