[AMD] Fix int32 offset overflow in Triton DSv4 KV store kernels (#41159)

This commit is contained in:
Xinyi Song
2026-09-24 23:11:59 -07:00
committed by GitHub
parent 3e7e652900
commit ec070ec8c8
@@ -61,7 +61,8 @@ def _triton_fused_store_flashmla_kernel(
if token_id >= N:
return
loc = tl.load(indices_ptr + token_id).to(tl.int32)
# Per-layer caches exceed 2 GiB; int32 byte offsets wrap and write outside the buffer.
loc = tl.load(indices_ptr + token_id).to(tl.int64)
page = loc // PAGE_SIZE
slot = loc % PAGE_SIZE
@@ -169,7 +170,7 @@ def _triton_fused_store_indexer_kernel(
if token_id >= N:
return
loc = tl.load(indices_ptr + token_id).to(tl.int32)
loc = tl.load(indices_ptr + token_id).to(tl.int64)
page = loc // PAGE_SIZE
slot = loc % PAGE_SIZE