Skip to content

Commit e4f5533

Browse files
committed
xe: sdpa: Fix KQ gemm alignment for the K tensor
1 parent 6fec1cd commit e4f5533

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gpu/intel/ocl/micro_sdpa.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,10 @@ status_t micro_sdpa_t::pd_t::init_microkernels(impl::engine_t *engine) {
264264

265265
problem_kq.B.layout = MatrixLayout::Pr;
266266
problem_kq.C.layout = MatrixLayout::T;
267-
problem_kq.A.setAlignment(alignmentForLD(d->head_size() * problem.Ta));
267+
const memory_desc_wrapper key_mdw(key_md());
268+
auto ldk = static_cast<int>(
269+
gemm_desc_t::get_ld(*key_md()) * key_mdw.data_type_size());
270+
problem_kq.A.setAlignment(alignmentForLD(ldk));
268271
problem_kq.B.setAlignment(64); // Q is packed in VNNI format in SLM
269272
problem_kq.B.crosspack = 2;
270273
problem_kq.B.tileR = into<uint16_t>(d_max());

0 commit comments

Comments
 (0)