Skip to content

Commit 4c2ab58

Browse files
committed
SDPA support bf16 type on avx2_vnni_2 platforms with CPU ref impl
1 parent 9366870 commit 4c2ab58

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
@@ -1201,7 +1201,11 @@ void ScaledDotProductAttention::createPrimitive() {
12011201
std::shared_ptr<Executor> executor = nullptr;
12021202
#ifdef OPENVINO_ARCH_X86_64
12031203
if (rtPrecision == ov::element::bf16) {
1204-
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::bfloat16>>(context);
1204+
if (ov::with_cpu_x86_bfloat16()) {
1205+
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::bfloat16>>(context);
1206+
} else {
1207+
executor = std::make_shared<AttentionExecutor<KT_REF, ov::bfloat16>>(context);
1208+
}
12051209
} else if (rtPrecision == ov::element::f16) {
12061210
if (with_cpu_x86_avx512_core_fp16()) {
12071211
executor = std::make_shared<AttentionExecutor<KT_ONEDNN, ov::float16>>(context);

0 commit comments

Comments
 (0)