Skip to content

Commit 87afbaa

Browse files
dmitry-gorokhovazhai219
authored andcommitted
[FORK][FEATURE] Enable avx2 jit reorder for bf16 data type
3.5 squash list: [Fork][Fix] Fix avx2 bf16 reorder
1 parent 4aed5ec commit 87afbaa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cpu/x64/jit_uni_reorder.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ struct jit_uni_reorder_kernel_f32_t : public kernel_t, public jit_generator {
211211
&& utils::everyone_is(0, p.ioff, p.ooff) /* do we need this? */
212212
&& utils::one_of(p.beta, 0.f, 1.f) /* anything else? */
213213
&& simple_impl_desc_init(p, nullptr) && mayiuse(sse41)
214-
&& IMPLICATION(utils::one_of(bf16, p.itype, p.otype),
214+
&& IMPLICATION(bf16 == p.itype, mayiuse(avx2))
215+
&& IMPLICATION((bf16 == p.otype) && (bf16 != p.itype),
215216
mayiuse(avx512_core) || mayiuse(avx2_vnni_2))
216217
&& IMPLICATION(utils::one_of(f16, p.itype, p.otype),
217218
mayiuse(avx512_core_fp16) || mayiuse(avx2))
@@ -1657,7 +1658,7 @@ struct jit_uni_reorder_kernel_f32_t : public kernel_t, public jit_generator {
16571658
otype_sz_ = data_type_size(prb_.otype);
16581659
stype_sz_ = sizeof(float);
16591660
if (prb_.otype == data_type::bf16 && !mayiuse(avx512_core_bf16)
1660-
&& !mayiuse(avx2_vnni_2)) {
1661+
&& !mayiuse(avx2_vnni_2) && mayiuse(avx512_core)) {
16611662
bf16_emu_ = utils::make_unique<bf16_emulation_t>(this,
16621663
bf16_emu_reserv_1_, bf16_emu_reserv_2_, bf16_emu_reserv_3_,
16631664
bf16_emu_scratch_, bf16_emu_reserv_4_);

0 commit comments

Comments
 (0)