Skip to content

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

[CPU] Fix Snippets related issues on NVL (#39017)

Chen Xu29a0239fa3fa
diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp
index 0e1d576f497..7d6bd00e535 100644
--- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp
+++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp
@@ -54,6 +54,10 @@ void ScaledAttnLayerCPUTest::SetUp() {
// Issue: 163144
if (with_cpu_x86_avx2_vnni_2()) {
rel_threshold = 0.2f;
+ // Bf16 rounding requires looser threshold for cases without scale
+ if (!has_scale) {
+ abs_threshold = 0.2f;
+ }
} else {
rel_threshold = 2e-2f;
}
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 638ba410dda..bb1d01650a0 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
@@ -638,17 +638,6 @@ const std::vector<std::regex>& disabled_test_patterns() {
patterns.emplace_back(std::regex(R"(.*EnableXattn=1.*)"));
}
- if (!ov::with_cpu_x86_avx512_core_amx() && ov::with_cpu_x86_avx512_core_fp16() && ov::with_cpu_x86_bfloat16()) {
- // AVX10.2-class machines can expose fp16+bf16 without AMX support being enabled in the current CPU mask;
- // keep these known failing snippets skips limited to that path instead of matching broader AMX-disabled CPUs.
- // Issue: 195918: TODO: filter out failing tests on NVL
- patterns.emplace_back(std::regex(R"(smoke_Snippets_MatMult/TransposeMatMul\.CompareWithRefImpl/IS\[0\]=\[\]_\(\[1\.49\.2\.23\]\)_IS\[1\]=\[\]_\(\[2\.2\.23\.39\]\)_Pos=0_T\[0\]=f16_T\[1\]=f16_MatMul_#N=1_#S=1_targetDevice=CPU)"));
- patterns.emplace_back(std::regex(R"(smoke_Snippets_MatMult/TransposeMatMul\.CompareWithRefImpl/IS\[0\]=\[\]_\(\[2\.1\.49\.13\]\)_IS\[1\]=\[\]_\(\[1\.13\.3\.39\]\)_Pos=1_T\[0\]=f16_T\[1\]=f16_MatMul_#N=1_#S=1_targetDevice=CPU)"));
- patterns.emplace_back(std::regex(R"(smoke_Snippets_MHABF16_4D/MHA\.CompareWithRefImpl/IS\[0\]=\[\]_\(\[2\.68\.6\.92\]\)_IS\[1\]=\[\]_\(\[2\.68\.6\.92\]\)_IS\[2\]=\[\]_\(\[1\.1\.68\.68\]\)_IS\[3\]=\[\]_\(\[2\.68\.6\.92\]\)_T\[0\]=bf16_T\[1\]=bf16_T\[2\]=bf16_T\[3\]=bf16_Mul=0_PRC=bf16_#N=3_#S=2_targetDevice=CPU_)"));
- patterns.emplace_back(std::regex(R"(smoke_Snippets_MHABF16_4D/MHA\.CompareWithRefImpl/IS\[0\]=\[\]_\(\[1\.58\.16\.34\]\)_IS\[1\]=\[\]_\(\[1\.58\.16\.34\]\)_IS\[2\]=\[\]_\(\[1\.1\.1\.58\]\)_IS\[3\]=\[\]_\(\[1\.58\.16\.34\]\)_T\[0\]=bf16_T\[1\]=bf16_T\[2\]=bf16_T\[3\]=bf16_Mul=0_PRC=bf16_#N=3_#S=2_targetDevice=CPU_)"));
- patterns.emplace_back(std::regex(R"(smoke_ScaledAttn_CPU/ScaledAttnLayerCPUTest\.CompareWithRefs/netPRC=bf16_IS=\[\?\.\?\.\?\.\?\]_\[\?\.\?\.\?\.\?\]_\[\?\.\?\]_TS=\(2\.8\.16\.32\)_\(2\.8\.16\.32\)_\(2\.8\.16\.32\)_\(1\.8\.48\.32\)_\(1\.8\.48\.32\)_\(1\.8\.48\.32\)_\(16\.48\)_\(16\.1\)_\(1\.48\)_is_causal=.*_has_attn=.*_has_scale=0_trgDev=CPU_primitive=ref_any)"));
- }
-
if (ov::with_cpu_x86_avx512_core_fp16() || CPUTestUtils::with_cpu_x86_avx2_vnni_2()) {
// Issue: 143852
patterns.emplace_back(std::regex(R"(smoke_ConvertRangeSubgraphCPUTest/ConvertRangeSubgraphCPUTest\.CompareWithRefs.*Prc=f16.*)"));
diff --git a/src/tests/functional/plugin/shared/src/snippets/mha.cpp b/src/tests/functional/plugin/shared/src/snippets/mha.cpp
index 0fdef9964d5..872f15ffe63 100644
--- a/src/tests/functional/plugin/shared/src/snippets/mha.cpp
+++ b/src/tests/functional/plugin/shared/src/snippets/mha.cpp
@@ -247,6 +247,10 @@ void MHA::init_thresholds() {
rel_threshold = 0.01f;
abs_threshold = 0.0078125f;
}
+ // Bf16 rounding requires looser threshold
+ if (m_input_types.size() > 1 && m_input_types[0] == ov::element::bf16 && precision_hint == ov::element::bf16) {
+ abs_threshold = 0.05f;
+ }
}
void MHAConstB::init_thresholds() {
diff --git a/src/tests/functional/plugin/shared/src/snippets/transpose_matmul.cpp b/src/tests/functional/plugin/shared/src/snippets/transpose_matmul.cpp
index fc5fd1af0ed..41f1008b4cd 100644
--- a/src/tests/functional/plugin/shared/src/snippets/transpose_matmul.cpp
+++ b/src/tests/functional/plugin/shared/src/snippets/transpose_matmul.cpp
@@ -45,8 +45,7 @@ void TransposeMatMul::SetUp() {
targetDevice = _targetDevice;
init_input_shapes(input_shapes);
-#if defined(OPENVINO_ARCH_ARM64) || defined(OPENVINO_ARCH_ARM)
- // For ARM platforms with FP16 tests, ensure inference precision is FP16
+ // For platforms with FP16 tests, ensure inference precision is FP16
// to match the model precision and avoid comparison tolerance issues
if (std::all_of(elem_types.begin(), elem_types.end(),
[](const ov::element::Type& t) { return t == ov::element::f16; })) {
@@ -56,7 +55,6 @@ void TransposeMatMul::SetUp() {
abs_threshold = 0.5f;
rel_threshold = 0.035f;
}
-#endif
const auto builder = get_builder(elem_types);
function = builder->getOriginal();