[Fix] Assert the page-aligned SWA evict floor on both PD decode prealloc paths (#35396)

This commit is contained in:
Liangsheng Yin
2026-08-18 15:48:55 -07:00
committed by GitHub
parent b814a7e812
commit 7ebaa98f81
2 changed files with 11 additions and 3 deletions
+6 -1
View File
@@ -1766,7 +1766,12 @@ def alloc_for_decode_prealloc(
swa_tail_len=swa_tail_len,
**extra_kwargs,
)
req.kv.swa_evicted_seqlen = fill_len - swa_tail_len
swa_evicted_seqlen = fill_len - swa_tail_len
assert (
swa_evicted_seqlen >= 0
and swa_evicted_seqlen % allocator.page_size == 0
)
req.kv.swa_evicted_seqlen = swa_evicted_seqlen
else:
kv_loc = allocator.alloc_extend(
prefix_lens=torch.tensor(