diff --git a/python/sglang/kernels/ops/kvcache/triton_store_cache.py b/python/sglang/kernels/ops/kvcache/triton_store_cache.py index 509171e58d..1261720610 100644 --- a/python/sglang/kernels/ops/kvcache/triton_store_cache.py +++ b/python/sglang/kernels/ops/kvcache/triton_store_cache.py @@ -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