Skip to content

Commit

Permalink
metal : prevent int overflows [no ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Nov 8, 2024
1 parent 486a5eb commit 5d1a10d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ggml/src/ggml-metal.metal
Original file line number Diff line number Diff line change
Expand Up @@ -3613,7 +3613,7 @@ kernel void kernel_flash_attn_ext_vec(
const float S = ss[0];

for (short i = tiisg; i < D16; i += NW) {
dst44[(iq3*ne2*ne1 + iq2 + (iq1)*ne1)*D16 + i] = (float4x4) sr4x4[i]/S;
dst44[((int64_t)iq3*ne2*ne1 + iq2 + (iq1)*ne1)*D16 + i] = (float4x4) sr4x4[i]/S;
}
}
}
Expand Down

0 comments on commit 5d1a10d

Please sign in to comment.