Separate swa and local attention chunk cache eviction (#15820)

This commit is contained in:
Ke Bao
2025-12-26 09:34:22 +08:00
committed by GitHub
parent 2f66b0671b
commit 7b7e357f61
8 changed files with 50 additions and 29 deletions
@@ -82,9 +82,7 @@ class EagleDraftInputV2Mixin:
def prepare_for_decode(self: EagleDraftInput, batch: ScheduleBatch):
if isinstance(batch.tree_cache, SWAChunkCache):
for req in batch.reqs:
batch.tree_cache.evict_swa(
req, req.seqlen - 1, batch.model_config.attention_chunk_size
)
batch.tree_cache.evict_swa(req, req.seqlen - 1)
from sglang.srt.speculative.spec_utils import assign_req_to_token_pool_func
@@ -368,9 +368,7 @@ class EAGLEWorker(TpModelWorker):
def _draft_preprocess_decode(self, batch: ScheduleBatch):
if isinstance(batch.tree_cache, SWAChunkCache):
for req in batch.reqs:
batch.tree_cache.evict_swa(
req, req.seqlen - 1, batch.model_config.attention_chunk_size
)
batch.tree_cache.evict_swa(req, req.seqlen - 1)
# Parse args
num_seqs = batch.batch_size()
@@ -348,9 +348,7 @@ class MultiLayerEagleWorker(TpModelWorker):
def _draft_preprocess_decode(self, batch: ScheduleBatch):
if isinstance(batch.tree_cache, SWAChunkCache):
for req in batch.reqs:
batch.tree_cache.evict_swa(
req, req.seqlen - 1, batch.model_config.attention_chunk_size
)
batch.tree_cache.evict_swa(req, req.seqlen - 1)
# Parse args
num_seqs = batch.batch_size()