From 87afbaa64739dc7fd4a624d5b2cad920036cd9af Mon Sep 17 00:00:00 2001 From: dmitrygo Date: Wed, 22 May 2024 17:14:39 +0400 Subject: [PATCH] [FORK][FEATURE] Enable avx2 jit reorder for bf16 data type 3.5 squash list: [Fork][Fix] Fix avx2 bf16 reorder --- src/cpu/x64/jit_uni_reorder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cpu/x64/jit_uni_reorder.cpp b/src/cpu/x64/jit_uni_reorder.cpp index c541c22a219..71c01b5e789 100644 --- a/src/cpu/x64/jit_uni_reorder.cpp +++ b/src/cpu/x64/jit_uni_reorder.cpp @@ -211,7 +211,8 @@ struct jit_uni_reorder_kernel_f32_t : public kernel_t, public jit_generator { && utils::everyone_is(0, p.ioff, p.ooff) /* do we need this? */ && utils::one_of(p.beta, 0.f, 1.f) /* anything else? */ && simple_impl_desc_init(p, nullptr) && mayiuse(sse41) - && IMPLICATION(utils::one_of(bf16, p.itype, p.otype), + && IMPLICATION(bf16 == p.itype, mayiuse(avx2)) + && IMPLICATION((bf16 == p.otype) && (bf16 != p.itype), mayiuse(avx512_core) || mayiuse(avx2_vnni_2)) && IMPLICATION(utils::one_of(f16, p.itype, p.otype), mayiuse(avx512_core_fp16) || mayiuse(avx2)) @@ -1657,7 +1658,7 @@ struct jit_uni_reorder_kernel_f32_t : public kernel_t, public jit_generator { otype_sz_ = data_type_size(prb_.otype); stype_sz_ = sizeof(float); if (prb_.otype == data_type::bf16 && !mayiuse(avx512_core_bf16) - && !mayiuse(avx2_vnni_2)) { + && !mayiuse(avx2_vnni_2) && mayiuse(avx512_core)) { bf16_emu_ = utils::make_unique(this, bf16_emu_reserv_1_, bf16_emu_reserv_2_, bf16_emu_reserv_3_, bf16_emu_scratch_, bf16_emu_reserv_4_);