Fix SWA double-free in disagg decode with MTP speculation (#25805)

Co-authored-by: Ke Bao <ispobaoke@gmail.com>
This commit is contained in:
Yuhao Yang
2026-05-22 00:28:54 -07:00
committed by GitHub
co-authored by Ke Bao
parent a7555fc997
commit c9153da5dc
@@ -561,6 +561,8 @@ class SWATokenToKVPoolAllocator(BaseTokenToKVPoolAllocator):
self.full_to_swa_index_mapping[alloc_full_indices[-swa_tail_len:]] = (
alloc_swa_indices
)
if swa_tail_len < extend_num_tokens:
self.full_to_swa_index_mapping[alloc_full_indices[:-swa_tail_len]] = 0
return alloc_full_indices
def alloc_decode(