[AMD] Fix int32 offset overflow in Triton DSv4 KV store kernels (#41159)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user