Skip to content

Commit

Permalink
x64: ip: bwd_d, bwd_w: disable execution of unsupported wei tags
Browse files Browse the repository at this point in the history
  • Loading branch information
msotoflo authored and tprimak committed Apr 21, 2023
1 parent ab2041d commit c0f4e93
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/cpu/x64/jit_brgemm_inner_product_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,16 @@ status_t init_ip_conf_bwd_d(jit_brgemm_primitive_conf_t &jbgp) {

jbgp.oc_block = ip_fwd_get_adjusted_oc_block(jbgp);

const int n_sp_dims = jbgp.ndims - 2;
const format_tag_t wei_blk_8
= pick(n_sp_dims, OI8i8o2i, OIw8i8o2i, OIhw8i8o2i, OIdhw8i8o2i);
const format_tag_t wei_blk_24
= pick(n_sp_dims, OI8i24o2i, OIw8i24o2i, OIhw8i24o2i, OIdhw8i24o2i);
// Note: these wei tags are currently unsupported in the transform JIT
// kernels.
if (one_of(jbgp.wei_tag, wei_blk_8, wei_blk_24))
return status::unimplemented;

// Optimization: for small shape we avoid large ic_block
// Thinking of os, ic, and oc as three dimensions, the boundary for small
// shapes is heuristically chosen via the following constraints:
Expand Down Expand Up @@ -940,6 +950,16 @@ status_t init_ip_conf_bwd_w(jit_brgemm_primitive_conf_t &jbgp) {
: ip_fwd_get_adjusted_oc_block(jbgp);
jbgp.oc_block_ext = ip_fwd_get_adjusted_oc_block(jbgp);

const int n_sp_dims = jbgp.ndims - 2;
const format_tag_t wei_blk_8
= pick(n_sp_dims, OI8i8o2i, OIw8i8o2i, OIhw8i8o2i, OIdhw8i8o2i);
const format_tag_t wei_blk_24
= pick(n_sp_dims, OI8i24o2i, OIw8i24o2i, OIhw8i24o2i, OIdhw8i24o2i);
// Note: these wei tags are currently unsupported in the transform JIT
// kernels.
if (one_of(jbgp.wei_tag, wei_blk_8, wei_blk_24))
return status::unimplemented;

jbgp.os_block = get_os_block(jbgp, false, false);
jbgp.nb_os = div_up(jbgp.os, jbgp.os_block);

Expand Down

0 comments on commit c0f4e93

Please sign in to comment.