Skip to content

Commit f761c52

Browse files
committed
SDPA support bf16 type on avx2_vnni_2 platforms with CPU ref impl
1 parent 04e27b2 commit f761c52

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,11 @@ void ScaledDotProductAttention::createPrimitive() {
12031203
std::shared_ptr<Executor> executor = nullptr;
12041204
#ifdef OPENVINO_ARCH_X86_64
12051205
if (rtPrecision == ov::element::bf16) {
1206-
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::bfloat16>>(context);
1206+
if (ov::with_cpu_x86_bfloat16()) {
1207+
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::bfloat16>>(context);
1208+
} else {
1209+
executor = std::make_shared<AttentionExecutor<KT_REF, ov::bfloat16>>(context);
1210+
}
12071211
} else if (rtPrecision == ov::element::f16) {
12081212
if (with_cpu_x86_avx512_core_fp16()) {
12091213
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::float16>>(context);

0 commit comments

Comments
 (0)