Skip to content

Commit

Permalink
gpu: jit: conv: decrease bn_blk size when low # of threads
Browse files Browse the repository at this point in the history
  • Loading branch information
dyoussif authored and karturov committed Oct 25, 2022
1 parent a96c94f commit 8b08a07
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gpu/jit/conv/block_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,18 @@ void block_helper_t::init_bmnk_blocks() {
bn_inst_blk = 8;
k_inst_blk = is_x8x8s32() ? 32 : 16;
bn_blk = is_ge_hpc ? 64 : 32;
int est_bmn_threads = 1;
est_bmn_threads *= utils::div_up(m_dim().size(), m_blk);
est_bmn_threads *= utils::div_up(bn_dim.size(), bn_blk);
auto thread_factor
= utils::div_up(hw_cfg_.eu_count(), est_bmn_threads);
if (thread_factor > (is_ge_hpc ? 6 : 2) && !allow_k_grid_slicing_) {
if (m_inst_blk % 2 == 0 && bn_blk != bn_dim.size()) {
m_blk /= 2;
if (m_blk % m_inst_blk != 0) m_inst_blk /= 2;
}
}

k_blk = k_inst_blk;
break;
}
Expand Down

0 comments on commit 8b08a07

Please sign in to comment.