Commit 93d94a1 1 parent 95bf159 commit 93d94a1 Copy full SHA for 93d94a1
File tree 4 files changed +25
-5
lines changed
tests/functional/custom/single_layer_tests
4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 18
18
#include " onednn/dnnl.h"
19
19
#include " openvino/core/parallel.hpp"
20
20
#include " openvino/op/topk.hpp"
21
+ #include " utils/cpu_utils.hpp"
21
22
#include " utils/ngraph_utils.hpp"
22
23
23
24
using namespace dnnl ;
@@ -1985,11 +1986,14 @@ void TopK::initSupportedPrimitiveDescriptors() {
1985
1986
ov::element::u8};
1986
1987
1987
1988
ov::element::Type dataPrecision = getOriginalOutputPrecisionAtPort (TOPK_DATA);
1988
- if (dataPrecision == ov::element::bf16 && !mayiuse (avx512_core )) {
1989
- THROW_CPU_NODE_ERR (" gets incorrect isa for BF16! AVX512 must be supported! " );
1989
+ if (dataPrecision == ov::element::bf16 && !hasHardwareSupport (ov::element::bf16 )) {
1990
+ THROW_CPU_NODE_ERR (" gets incorrect isa for BF16!" );
1990
1991
}
1991
1992
bool precisionSupported = std::find (std::begin (supportedPrecision), std::end (supportedPrecision), dataPrecision) !=
1992
1993
std::end (supportedPrecision);
1994
+ // BF16 is not supported for AVX2_VNNI_2 platforms
1995
+ precisionSupported =
1996
+ (dataPrecision == ov::element::bf16 && mayiuse (cpu::x64::avx2_vnni_2)) ? false : precisionSupported;
1993
1997
if (!precisionSupported) {
1994
1998
if (dataPrecision.is_real ()) {
1995
1999
dataPrecision = ov::element::f32;
Original file line number Diff line number Diff line change @@ -64,7 +64,13 @@ class NormalizeL2LayerCPUTest : public testing::WithParamInterface<NormalizeL2La
64
64
if (selectedType.empty ()) {
65
65
selectedType = getPrimitiveType ();
66
66
}
67
- selectedType = makeSelectedTypeStr (" unknown" , inType);
67
+ // BF16 is not supported for NormalizeL2 on AVX2_VNNI_2 platforms
68
+ if (ov::with_cpu_x86_avx2_vnni_2 () && inType == ElementType::bf16) {
69
+ selectedType = makeSelectedTypeStr (" unknown" , ElementType::f32);
70
+ } else {
71
+ selectedType = makeSelectedTypeStr (" unknown" , inType);
72
+ }
73
+
68
74
targetDevice = ov::test::utils::DEVICE_CPU;
69
75
init_input_shapes ({shapes});
70
76
Original file line number Diff line number Diff line change @@ -194,7 +194,12 @@ class ROIPoolingCPULayerTest : public testing::WithParamInterface<ROIPoolingCPUT
194
194
selectedType = getPrimitiveType ();
195
195
}
196
196
selectedType.push_back (' _' );
197
- selectedType += netPrecision.to_string ();
197
+ // BF16 is not supported for ROIPooling on AVX2_VNNI_2 platforms
198
+ if (ov::with_cpu_x86_avx2_vnni_2 () && netPrecision == ElementType::bf16) {
199
+ selectedType += ov::element::f32.to_string ();
200
+ } else {
201
+ selectedType += netPrecision.to_string ();
202
+ }
198
203
199
204
if (netPrecision == ov::element::bf16) {
200
205
rel_threshold = 1e-2 ;
Original file line number Diff line number Diff line change @@ -102,7 +102,12 @@ class TopKLayerCPUTest : public testing::WithParamInterface<TopKLayerCPUTestPara
102
102
inPrc = outPrc = netPrecision;
103
103
configuration.insert (additionalConfig.begin (), additionalConfig.end ());
104
104
105
- selectedType = getPrimitiveType () + " _" + ov::element::Type (netPrecision).get_type_name ();
105
+ // BF16 is not supported for TopK on AVX2_VNNI_2 platforms
106
+ if (ov::with_cpu_x86_avx2_vnni_2 () && netPrecision == ElementType::bf16) {
107
+ selectedType = makeSelectedTypeStr (getPrimitiveType (), ElementType::f32);
108
+ } else {
109
+ selectedType = makeSelectedTypeStr (getPrimitiveType (), netPrecision);
110
+ }
106
111
107
112
staticShape = inputShape.first .rank () == 0 ;
108
113
if (staticShape) {
You can’t perform that action at this time.
0 commit comments