Skip to content

Commit

Permalink
[FORK][FEATURE] Enable avx2 jit reorder for bf16 data type
Browse files Browse the repository at this point in the history
3.5 squash list:

[Fork][Fix] Fix avx2 bf16 reorder
  • Loading branch information
dmitry-gorokhov authored and xczhai committed Dec 4, 2024
1 parent 4aed5ec commit 87afbaa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cpu/x64/jit_uni_reorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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<bf16_emulation_t>(this,
bf16_emu_reserv_1_, bf16_emu_reserv_2_, bf16_emu_reserv_3_,
bf16_emu_scratch_, bf16_emu_reserv_4_);
Expand Down

0 comments on commit 87afbaa

Please sign in to comment.