Skip to content

Commit

Permalink
cpu: x64: disable MM IP for unsupported ISAs
Browse files Browse the repository at this point in the history
We don't support avx2 IP for training. The only exception is
f32 data type.
  • Loading branch information
densamoilov committed Jan 30, 2025
1 parent c509501 commit d34c740
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/cpu/x64/matmul_inner_product.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ struct matmul_inner_product_bwd_data_t : public primitive_t {
const auto diff_dst_dt = invariant_dst_md()->data_type;
const auto wei_dt = invariant_wei_md()->data_type;

const bool is_f32
= utils::everyone_is(f32, diff_src_dt, wei_dt, diff_dst_dt);

VDISPATCH_INNER_PRODUCT(mayiuse(avx2), VERBOSE_UNSUPPORTED_ISA);
VDISPATCH_INNER_PRODUCT(IMPLICATION(!is_f32, mayiuse(avx512_core)),
VERBOSE_UNSUPPORTED_DT_CFG);

VDISPATCH_INNER_PRODUCT(get_prop_kind() == prop_kind::backward_data,
VERBOSE_BAD_PROPKIND);
VDISPATCH_INNER_PRODUCT_SC(set_formats(), VERBOSE_UNSUPPORTED_TAG);
Expand Down Expand Up @@ -199,6 +206,13 @@ struct matmul_inner_product_bwd_weights_t : public primitive_t {
const auto diff_wei_dt = invariant_wei_md()->data_type;
const auto diff_dst_dt = invariant_dst_md()->data_type;

const bool is_f32
= utils::everyone_is(f32, src_dt, diff_wei_dt, diff_dst_dt);

VDISPATCH_INNER_PRODUCT(mayiuse(avx2), VERBOSE_UNSUPPORTED_ISA);
VDISPATCH_INNER_PRODUCT(IMPLICATION(!is_f32, mayiuse(avx512_core)),
VERBOSE_UNSUPPORTED_DT_CFG);

VDISPATCH_INNER_PRODUCT(
get_prop_kind() == prop_kind::backward_weights,
VERBOSE_BAD_PROPKIND);
Expand Down

0 comments on commit d34c740

Please sign in to comment.