Skip to content

Commit e4543be

Browse files
karturovCopilot
authored andcommitted
gpu: fix (avoid) jit matmul post-ops with layout not matching dst
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f0c6428 commit e4543be

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/gpu/intel/gemm/jit/gen_kernel.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,20 @@ status_t gen_desc_t::transfer_post_ops(
401401

402402
bool trans = is_multi_row && !src_rmd.inner_dim.is_innermost();
403403

404+
// Reject row-only or col-only binary post-ops where the
405+
// physically innermost dimension is not the varying one
406+
// (e.g. batch dim is innermost). Block access requires
407+
// contiguous elements along the varying dimension.
408+
{
409+
int rmd_ndims = src_rmd.ndims();
410+
bool row_only = is_multi_row && !is_multi_col;
411+
bool col_only = is_multi_col && !is_multi_row;
412+
if (row_only && !src_rmd.inner_dim.is_innermost())
413+
return status::unimplemented;
414+
if (col_only && !src_rmd.is_inner_dim(rmd_ndims - 2, rmd_ndims))
415+
return status::unimplemented;
416+
}
417+
404418
if (swap_ab) {
405419
trans = !trans;
406420
std::swap(is_multi_row, is_multi_col);

0 commit comments

Comments
 (0)