Skip to content

Commit 5d1a10d

Browse files
committed
metal : prevent int overflows [no ci]
1 parent 486a5eb commit 5d1a10d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/ggml-metal.metal

+1-1
Original file line numberDiff line numberDiff line change
@@ -3613,7 +3613,7 @@ kernel void kernel_flash_attn_ext_vec(
36133613
const float S = ss[0];
36143614

36153615
for (short i = tiisg; i < D16; i += NW) {
3616-
dst44[(iq3*ne2*ne1 + iq2 + (iq1)*ne1)*D16 + i] = (float4x4) sr4x4[i]/S;
3616+
dst44[((int64_t)iq3*ne2*ne1 + iq2 + (iq1)*ne1)*D16 + i] = (float4x4) sr4x4[i]/S;
36173617
}
36183618
}
36193619
}

0 commit comments

Comments
 (0)