Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions mlx/backend/metal/kernels/steel/attn/kernels/steel_attention_nax.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,20 @@ template <
const short col_pos = base_col + ik * UK + sn;

MSubTile mfrag;
mfrag.load_safe(
mask,
int64_t(mask_params->M_strides[2]),
Int<1>{},
params->qL,
params->kL,
row_pos,
col_pos);
if ((!align_Q && is_last_q) || (!align_K && is_last_k)) {
mfrag.load_safe(
mask,
int64_t(mask_params->M_strides[2]),
Int<1>{},
params->qL,
params->kL,
row_pos,
col_pos);
} else {
const int M_str = int(mask_params->M_strides[2]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That changed to int from int64_t. Is that reasonable?

const int M_load_off = row_pos * M_str + col_pos;
mfrag.load(mask + M_load_off, M_str, Int<1>{});
}

thread auto& fg = Ptile.subtile_at(iq, ik).frag_at(0, 0);

Expand Down
Loading