Skip to content

Commit 6ca7720

Browse files
committed
Apply suggestions from code review
1 parent 6bec04b commit 6ca7720

File tree

22 files changed

+60
-73
lines changed

22 files changed

+60
-73
lines changed

src/inference/dev_api/openvino/runtime/system_conf.hpp

+1-15
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ OPENVINO_RUNTIME_API bool with_cpu_x86_avx2();
111111
*/
112112
OPENVINO_RUNTIME_API bool with_cpu_x86_avx2_vnni();
113113

114-
/**
115-
* @brief Checks whether CPU supports AVX2_VNNI_2 capability
116-
* @ingroup ov_dev_api_system_conf
117-
* @return `True` is AVX2_VNNI_2 instructions are available, `false` otherwise
118-
*/
119-
OPENVINO_RUNTIME_API bool with_cpu_x86_avx2_vnni_2();
120-
121114
/**
122115
* @brief Checks whether CPU supports AVX 512 capability
123116
* @ingroup ov_dev_api_system_conf
@@ -142,17 +135,10 @@ OPENVINO_RUNTIME_API bool with_cpu_x86_avx512_core_vnni();
142135
/**
143136
* @brief Checks whether CPU supports BFloat16 capability
144137
* @ingroup ov_dev_api_system_conf
145-
* @return `True` is tAVX512_BF16 or AVX2_VNNI_2 instructions are available, `false` otherwise
138+
* @return `True` is tAVX512_BF16 instructions are available, `false` otherwise
146139
*/
147140
OPENVINO_RUNTIME_API bool with_cpu_x86_bfloat16();
148141

149-
/**
150-
* @brief Checks whether CPU supports Float16 capability
151-
* @ingroup ov_dev_api_system_conf
152-
* @return `True` is tAVX512_FP16 or AVX2_VNNI_2 instructions are available, `false` otherwise
153-
*/
154-
OPENVINO_RUNTIME_API bool with_cpu_x86_float16();
155-
156142
/**
157143
* @brief Checks whether CPU supports fp16 capability
158144
* @ingroup ov_dev_api_system_conf

src/inference/src/system_conf.cpp

+1-16
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ bool with_cpu_x86_avx2_vnni() {
7575
return get_cpu_info().has(Xbyak::util::Cpu::tAVX2 | Xbyak::util::Cpu::tAVX_VNNI);
7676
}
7777

78-
bool with_cpu_x86_avx2_vnni_2() {
79-
return with_cpu_x86_avx2_vnni() && get_cpu_info().has(Xbyak::util::Cpu::tAVX_VNNI_INT8) &&
80-
get_cpu_info().has(Xbyak::util::Cpu::tAVX_NE_CONVERT);
81-
}
82-
8378
bool with_cpu_x86_avx512f() {
8479
return get_cpu_info().has(Xbyak::util::Cpu::tAVX512F);
8580
}
@@ -93,17 +88,13 @@ bool with_cpu_x86_avx512_core_vnni() {
9388
}
9489

9590
bool with_cpu_x86_bfloat16() {
96-
return get_cpu_info().has(Xbyak::util::Cpu::tAVX512_BF16) || with_cpu_x86_avx2_vnni_2();
91+
return get_cpu_info().has(Xbyak::util::Cpu::tAVX512_BF16);
9792
}
9893

9994
bool with_cpu_x86_avx512_core_fp16() {
10095
return get_cpu_info().has(Xbyak::util::Cpu::tAVX512_FP16);
10196
}
10297

103-
bool with_cpu_x86_float16() {
104-
return with_cpu_x86_avx512_core_fp16() || with_cpu_x86_avx2_vnni_2();
105-
}
106-
10798
bool with_cpu_x86_avx512_core_amx_int8() {
10899
return get_cpu_info().has(Xbyak::util::Cpu::tAMX_INT8);
109100
}
@@ -142,9 +133,6 @@ bool with_cpu_x86_avx2() {
142133
bool with_cpu_x86_avx2_vnni() {
143134
return false;
144135
}
145-
bool with_cpu_x86_avx2_vnni_2() {
146-
return false;
147-
}
148136
bool with_cpu_x86_avx512f() {
149137
return false;
150138
}
@@ -160,9 +148,6 @@ bool with_cpu_x86_bfloat16() {
160148
bool with_cpu_x86_avx512_core_fp16() {
161149
return false;
162150
}
163-
bool with_cpu_x86_float16() {
164-
return false;
165-
}
166151
bool with_cpu_x86_avx512_core_amx_int8() {
167152
return false;
168153
}

src/plugins/intel_cpu/src/nodes/paged_attn.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ bool PagedAttention::isSupportedOperation(const std::shared_ptr<const ov::Node>&
276276
ov::element::Type PagedAttention::getRuntimePrecision() const {
277277
auto rtPrecision = getOriginalInputPrecisionAtPort(0);
278278
// bf16 should be enabled only when platform supports
279-
if (rtPrecision == ov::element::bf16 && ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) {
279+
if (rtPrecision == ov::element::bf16 && ov::with_cpu_x86_bfloat16()) {
280280
rtPrecision = ov::element::bf16;
281281
} else if (rtPrecision == ov::element::f16 && ov::with_cpu_x86_avx512_core_fp16()) {
282282
rtPrecision = ov::element::f16;

src/plugins/intel_cpu/src/nodes/scaled_attn.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ void ScaledDotProductAttention::createPrimitive() {
12381238
std::shared_ptr<Executor> executor = nullptr;
12391239
#ifdef OPENVINO_ARCH_X86_64
12401240
if (rtPrecision == ov::element::bf16) {
1241-
if (ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) {
1241+
if (ov::with_cpu_x86_bfloat16()) {
12421242
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::bfloat16>>(context,
12431243
m_key_quant_param.groupSize,
12441244
m_value_quant_param.groupSize,
@@ -2082,7 +2082,7 @@ const ScaledDotProductAttention::SDPAQuantParam& ScaledDotProductAttention::getV
20822082
ov::element::Type ScaledDotProductAttention::getRuntimePrecision() const {
20832083
auto rtPrecision = getOriginalInputPrecisionAtPort(0);
20842084
// bf16 should be enabled only when platform supports
2085-
if (rtPrecision == ov::element::bf16 && ov::with_cpu_x86_bfloat16()) {
2085+
if (rtPrecision == ov::element::bf16 && (ov::with_cpu_x86_bfloat16() || mayiuse(cpu_isa_t::avx2_vnni_2))) {
20862086
rtPrecision = ov::element::bf16;
20872087
} else if (rtPrecision == ov::element::f16 && ov::intel_cpu::hasHardwareSupport(ov::element::f16)) {
20882088
rtPrecision = ov::element::f16;

src/plugins/intel_cpu/src/nodes/topk.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -1986,9 +1986,6 @@ void TopK::initSupportedPrimitiveDescriptors() {
19861986
ov::element::u8};
19871987

19881988
ov::element::Type dataPrecision = getOriginalOutputPrecisionAtPort(TOPK_DATA);
1989-
if (dataPrecision == ov::element::bf16 && !hasHardwareSupport(ov::element::bf16)) {
1990-
THROW_CPU_NODE_ERR("gets incorrect isa for BF16!");
1991-
}
19921989
bool precisionSupported = std::find(std::begin(supportedPrecision), std::end(supportedPrecision), dataPrecision) !=
19931990
std::end(supportedPrecision);
19941991
// BF16 is not supported for AVX2_VNNI_2 platforms

src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ TEST_F(OVClassConfigTestCPU, smoke_PluginSetConfigStreamsNum) {
156156
#if defined(OPENVINO_ARCH_ARM) || defined(OPENVINO_ARCH_ARM64)
157157
const auto expected_precision_for_performance_mode = ov::intel_cpu::hasHardwareSupport(ov::element::f16) ? ov::element::f16 : ov::element::f32;
158158
#else
159-
const auto expected_precision_for_performance_mode =
160-
(ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) ? ov::element::bf16 : ov::element::f32;
159+
const auto expected_precision_for_performance_mode = ov::with_cpu_x86_bfloat16() ? ov::element::bf16 : ov::element::f32;
161160
#endif
162161

163162
TEST_F(OVClassConfigTestCPU, smoke_PluginSetConfigHintInferencePrecision) {

src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/random_uniform.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void RandomUniformLayerTestCPU::SetUp() {
7979
updateSelectedType(getPrimitiveType(), ElementType::f32, configuration);
8080
}
8181
} else if (output_prc == ElementType::bf16) {
82-
if (ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) {
82+
if (ov::with_cpu_x86_bfloat16()) {
8383
updateSelectedType(getPrimitiveType(), ElementType::bf16, configuration);
8484
} else {
8585
updateSelectedType("ref_any", ElementType::bf16, configuration);

src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/scaled_attn.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ void ScaledAttnLayerCPUTest::SetUp() {
5959
}
6060

6161
if (inType == ElementType::bf16) {
62-
rel_threshold = 2e-2f;
62+
// Issue: 163144
63+
if (with_cpu_x86_avx2_vnni_2()) {
64+
rel_threshold = 0.2f;
65+
} else {
66+
rel_threshold = 2e-2f;
67+
}
6368
}
6469
selectedType = makeSelectedTypeStr(selectedType, inType);
6570
init_input_shapes(inputShapes);
@@ -133,7 +138,7 @@ TEST_P(ScaledAttnLayerCPUTest, CompareWithRefs) {
133138
bool has_scale;
134139
std::string targetDevice;
135140
std::tie(inType, inputShapes, is_causal, has_attn, has_scale, targetDevice, cpuParams) = this->GetParam();
136-
if (inType == ElementType::bf16 && !ov::with_cpu_x86_bfloat16())
141+
if (inType == ElementType::bf16 && !ov::with_cpu_x86_bfloat16() && !with_cpu_x86_avx2_vnni_2())
137142
GTEST_SKIP();
138143
run();
139144
CheckPluginRelatedResults(compiledModel, "ScaledAttn");

src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/group_convolution.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ std::vector<groupConvLayerCPUTestParamsSet> filterParamsSetForDevice(
275275
auto additionalConfig = std::get<configIndex>(param);
276276
if (additionalConfig.count(ov::hint::inference_precision.name()) &&
277277
ov::element::bf16 == additionalConfig[ov::hint::inference_precision.name()].as<ov::element::Type>() &&
278-
(!ov::with_cpu_x86_bfloat16() || ov::with_cpu_x86_avx2_vnni_2())) {
278+
!ov::with_cpu_x86_bfloat16()) {
279279
continue;
280280
}
281281
resParamsSet.push_back(param);

src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/matmul.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ std::vector<ov::AnyMap> filterAdditionalConfig_Brgemm() {
157157
#else
158158
std::vector<ov::AnyMap> additionalConfig = {{}};
159159
#endif
160-
if (with_cpu_x86_bfloat16()) {
160+
if (with_cpu_x86_bfloat16() || with_cpu_x86_avx2_vnni_2()) {
161161
additionalConfig.push_back({ov::hint::inference_precision(ov::element::bf16)});
162162
}
163163

src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/normalize.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class NormalizeL2LayerCPUTest : public testing::WithParamInterface<NormalizeL2La
6565
selectedType = getPrimitiveType();
6666
}
6767
// BF16 is not supported for NormalizeL2 on AVX2_VNNI_2 platforms
68-
if (ov::with_cpu_x86_avx2_vnni_2() && inType == ElementType::bf16) {
68+
if (with_cpu_x86_avx2_vnni_2() && inType == ElementType::bf16) {
6969
selectedType = makeSelectedTypeStr("unknown", ElementType::f32);
7070
} else {
7171
selectedType = makeSelectedTypeStr("unknown", inType);

src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class ROIPoolingCPULayerTest : public testing::WithParamInterface<ROIPoolingCPUT
195195
}
196196
selectedType.push_back('_');
197197
// BF16 is not supported for ROIPooling on AVX2_VNNI_2 platforms
198-
if (ov::with_cpu_x86_avx2_vnni_2() && netPrecision == ElementType::bf16) {
198+
if (with_cpu_x86_avx2_vnni_2() && netPrecision == ElementType::bf16) {
199199
selectedType += ov::element::f32.to_string();
200200
} else {
201201
selectedType += netPrecision.to_string();

src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/topk.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class TopKLayerCPUTest : public testing::WithParamInterface<TopKLayerCPUTestPara
103103
configuration.insert(additionalConfig.begin(), additionalConfig.end());
104104

105105
// BF16 is not supported for TopK on AVX2_VNNI_2 platforms
106-
if (ov::with_cpu_x86_avx2_vnni_2() && netPrecision == ElementType::bf16) {
106+
if (with_cpu_x86_avx2_vnni_2() && netPrecision == ElementType::bf16) {
107107
selectedType = makeSelectedTypeStr(getPrimitiveType(), ElementType::f32);
108108
} else {
109109
selectedType = makeSelectedTypeStr(getPrimitiveType(), netPrecision);

src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/interaction.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class IntertactionCPUTest : public testing::WithParamInterface<InteractionLayerC
149149
ElementType inType;
150150
InputShape inputShape;
151151
std::tie(inType, inputShape) = this->GetParam();
152-
bool with_bf16 = ov::with_cpu_x86_bfloat16();
152+
bool with_bf16 = ov::with_cpu_x86_bfloat16() || with_cpu_x86_avx2_vnni_2();
153153
if (with_bf16 && (inType == ov::element::bf16 || inType == ov::element::i32)) {
154154
selectedType = makeSelectedTypeStr("ref_any", ov::element::bf16);
155155
} else {

src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
#if defined(OPENVINO_ARCH_RISCV64)
1010
# include "nodes/kernels/riscv64/cpu_isa_traits.hpp"
1111
#endif
12-
1312
#include <string>
1413
#include <vector>
1514

15+
#include "utils/cpu_test_utils.hpp"
16+
1617
std::vector<std::string> disabledTestPatterns() {
1718
std::vector<std::string> retVector{
1819
// TODO: Issue 31841
@@ -579,7 +580,7 @@ std::vector<std::string> disabledTestPatterns() {
579580
// TODO: Issue 92895
580581
// on platforms which do not support AMX, we are disabling I8 input tests
581582
retVector.emplace_back(R"(smoke_LPT/FakeQuantizeWithNotOptimalTransformation.CompareWithRefImpl.*CPU.*i8.*)");
582-
if ((!ov::with_cpu_x86_avx512_core_amx_bf16() && !ov::with_cpu_x86_bfloat16()) || ov::with_cpu_x86_avx2_vnni_2()) {
583+
if (!ov::with_cpu_x86_avx512_core_amx_bf16() && !ov::with_cpu_x86_bfloat16()) {
583584
// ignored for not supported bf16 platforms
584585
retVector.emplace_back(R"(.*smoke_Snippets_EnforcePrecision_bf16.*)");
585586
retVector.emplace_back(R"(.*smoke_Snippets_MHAWOTransposeEnforceBF16.*)");
@@ -638,7 +639,7 @@ std::vector<std::string> disabledTestPatterns() {
638639
retVector.emplace_back(R"(.*smoke_Deconv_(2|3)D_NSPC_INT8_AMX/DeconvolutionLayerCPUTest.*)");
639640
}
640641

641-
if (ov::with_cpu_x86_float16()) {
642+
if (ov::with_cpu_x86_avx512_core_fp16() || CPUTestUtils::with_cpu_x86_avx2_vnni_2()) {
642643
// Issue: 143852
643644
retVector.emplace_back(R"(smoke_ConvertRangeSubgraphCPUTest/ConvertRangeSubgraphCPUTest\.CompareWithRefs.*Prc=f16.*)");
644645
retVector.emplace_back(R"((smoke|nightly)_FC_3D_FP16/.*_Fused=Multiply\(PerChannel\).*)");
@@ -649,7 +650,7 @@ std::vector<std::string> disabledTestPatterns() {
649650
retVector.emplace_back(R"(smoke_Conv_Sum_Broadcast_FP16/ConvSumInPlaceTest.*Relu\.Multiply\(PerChannel\)\.Add\(PerChannel\).*)");
650651
}
651652

652-
if (ov::with_cpu_x86_avx2_vnni_2()) {
653+
if (CPUTestUtils::with_cpu_x86_avx2_vnni_2()) {
653654
// jit_gemm_BF16 kernels are not supported for conv,inner_product,matmul on avx2_vnni_2 platforms
654655
retVector.emplace_back(R"(smoke_Conv_.*D_GEMM_BF16.*)");
655656
retVector.emplace_back(
@@ -658,9 +659,6 @@ std::vector<std::string> disabledTestPatterns() {
658659
// Issue: 163147
659660
retVector.emplace_back(
660661
R"(smoke_CompareWithRefs_4D.*[Ff]using.*EltwiseLayerCPUTest\.CompareWithRefs.*INFERENCE_PRECISION_HINT=f16.*enforceSnippets=1.*)");
661-
// Issue: 163144
662-
retVector.emplace_back(
663-
R"(smoke_ScaledAttn_CPU/ScaledAttnLayerCPUTest.CompareWithRefs/netPRC=bf16.*_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\).*)");
664662
}
665663

666664
return retVector;

src/plugins/intel_cpu/tests/functional/shared_tests_instances/snippets/fully_connected.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ static inline std::vector<std::vector<element::Type>> precisions(bool only_fp32
3131
auto quant = quantized_precisions();
3232
std::copy(quant.begin(), quant.end(), std::back_inserter(prc));
3333
// In Snippets MatMul BF16 is supported only on bf16/AMX platforms
34-
if ((ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) ||
35-
ov::with_cpu_x86_avx512_core_amx_bf16()) {
34+
if (ov::with_cpu_x86_bfloat16() || ov::with_cpu_x86_avx512_core_amx_bf16()) {
3635
prc.emplace_back(std::vector<element::Type>{element::bf16, element::bf16});
3736
}
3837
}

src/plugins/intel_cpu/tests/functional/shared_tests_instances/snippets/transpose_matmul.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ static inline std::vector<std::vector<element::Type>> precisions(bool only_fp32
179179
prc.emplace_back(std::vector<element::Type>{element::u8, element::i8});
180180
}
181181
// In Snippets MatMul BF16 is supported only on bf16/AMX platforms
182-
if ((ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) ||
183-
ov::with_cpu_x86_avx512_core_amx_bf16()) {
182+
if (ov::with_cpu_x86_bfloat16() || ov::with_cpu_x86_avx512_core_amx_bf16()) {
184183
prc.emplace_back(std::vector<element::Type>{element::bf16, element::bf16});
185184
}
186185
}

src/plugins/intel_cpu/tests/functional/shared_tests_instances/snippets/utils.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace snippets {
1313
#define SNIPPETS_TESTS_STATIC_SHAPES(...) static_shapes_to_test_representation(std::vector<std::vector<ov::Shape>>{__VA_ARGS__})
1414

1515
static inline bool is_bf16_supported_by_brgemm() {
16-
return (ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) || ov::with_cpu_x86_avx512_core_amx_bf16();
16+
return ov::with_cpu_x86_bfloat16() || ov::with_cpu_x86_avx512_core_amx_bf16();
1717
}
1818

1919
static inline bool is_fp16_supported_by_brgemm() {

src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp

+25-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#include "transformations/rt_info/primitives_priority_attribute.hpp"
1313
#include "utils/general_utils.h"
1414
#include "utils/rt_info/memory_formats_attribute.hpp"
15+
#if defined(OPENVINO_ARCH_X86) || defined(OPENVINO_ARCH_X86_64)
16+
# include <xbyak/xbyak_util.h>
17+
#endif
1518

1619
namespace CPUTestUtils {
1720
const char* CPUTestsBase::any_type = "any_type";
@@ -45,6 +48,22 @@ const char* CPUTestsBase::cpu_fmt2str(cpu_memory_format_t v) {
4548
return "undef";
4649
}
4750

51+
#if defined(OPENVINO_ARCH_X86) || defined(OPENVINO_ARCH_X86_64)
52+
static Xbyak::util::Cpu& get_cpu_info() {
53+
static Xbyak::util::Cpu cpu;
54+
return cpu;
55+
}
56+
bool with_cpu_x86_avx2_vnni_2() {
57+
return get_cpu_info().has(Xbyak::util::Cpu::tAVX2 | Xbyak::util::Cpu::tAVX_VNNI) &&
58+
get_cpu_info().has(Xbyak::util::Cpu::tAVX_VNNI_INT8) &&
59+
get_cpu_info().has(Xbyak::util::Cpu::tAVX_NE_CONVERT);
60+
}
61+
#else // OPENVINO_ARCH_X86 || OPENVINO_ARCH_X86_64
62+
bool with_cpu_x86_avx2_vnni_2() {
63+
return false;
64+
}
65+
#endif // OPENVINO_ARCH_X86 || OPENVINO_ARCH_X86_64
66+
4867
cpu_memory_format_t CPUTestsBase::cpu_str2fmt(const char* str) {
4968
#define CASE(_fmt) \
5069
do { \
@@ -473,8 +492,9 @@ CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision,
473492
auto inferencePrecisionConfig = it->second.as<ov::element::Type>();
474493
inferencePrecisionSetExplicitly = true;
475494
if ((inferencePrecisionConfig == ov::element::bf16 &&
476-
(ov::with_cpu_x86_avx512_core() || ov::with_cpu_x86_avx2_vnni_2())) ||
477-
(inferencePrecisionConfig == ov::element::f16 && ov::with_cpu_x86_float16()) ||
495+
(ov::with_cpu_x86_avx512_core() || with_cpu_x86_avx2_vnni_2())) ||
496+
(inferencePrecisionConfig == ov::element::f16 &&
497+
(ov::with_cpu_x86_avx512_core_fp16() || with_cpu_x86_avx2_vnni_2())) ||
478498
(inferencePrecisionConfig == ov::element::f32) || (inferencePrecisionConfig == ov::element::dynamic)) {
479499
inferencePrecision = inferencePrecisionConfig;
480500
}
@@ -484,7 +504,7 @@ CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision,
484504
const auto& configIt = configuration.find(executionModeKey);
485505
if (configIt != configuration.end() && configIt->second.as<ov::hint::ExecutionMode>() == ov::hint::ExecutionMode::PERFORMANCE) {
486506
inferencePrecision = ov::element::f32;
487-
if (ov::with_cpu_x86_bfloat16() && !ov::with_cpu_x86_avx2_vnni_2()) {
507+
if (ov::with_cpu_x86_bfloat16()) {
488508
inferencePrecision = ov::element::bf16;
489509
}
490510
} else {
@@ -496,7 +516,7 @@ CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision,
496516
// enforceInferPrecision stage
497517
if (inferencePrecision == ov::element::bf16) {
498518
deducedType =
499-
(ov::with_cpu_x86_avx512_core() || ov::with_cpu_x86_avx2_vnni_2()) ? ov::element::bf16 : ov::element::f32;
519+
(ov::with_cpu_x86_avx512_core() || with_cpu_x86_avx2_vnni_2()) ? ov::element::bf16 : ov::element::f32;
500520
}
501521

502522
// ngraph transform pipeline stage
@@ -507,7 +527,7 @@ CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision,
507527
}
508528
if (deducedType == ov::element::bf16) {
509529
deducedType =
510-
(ov::with_cpu_x86_avx512_core() || ov::with_cpu_x86_avx2_vnni_2()) ? ov::element::bf16 : ov::element::f32;
530+
(ov::with_cpu_x86_avx512_core() || with_cpu_x86_avx2_vnni_2()) ? ov::element::bf16 : ov::element::f32;
511531
} else if (deducedType == ov::element::f16) {
512532
if (inferencePrecision != ov::element::f16 && inferencePrecision != ov::element::dynamic) {
513533
deducedType = ov::element::f32;

src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ inline std::string nodeType2str(nodeType nt) {
113113
return "GroupConvolutionBackpropData";
114114
throw std::runtime_error("Undefined node type to convert to string!");
115115
}
116-
116+
bool with_cpu_x86_avx2_vnni_2();
117117
class CPUTestsBase {
118118
public:
119119
typedef std::map<std::string, ov::Any> CPUInfo;

src/plugins/intel_cpu/tests/unit/brgemm_executor_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void run_test(ov::element::Type rtPrec) {
7070

7171
TEST_P(BrgemmKernelTest, simpleGemmTest) {
7272
ov::element::Type rtPrec = this->GetParam();
73-
if (rtPrec == ov::element::bf16 && (!ov::with_cpu_x86_bfloat16() || ov::with_cpu_x86_avx2_vnni_2()))
73+
if (rtPrec == ov::element::bf16 && !ov::with_cpu_x86_bfloat16())
7474
GTEST_SKIP();
7575
if (rtPrec == ov::element::f32 && !ov::with_cpu_x86_avx512_core())
7676
GTEST_SKIP();

0 commit comments

Comments
 (0)