fix: fix prefill-aware SWA floor tracking (#29520)

This commit is contained in:
Mick
2026-06-28 14:18:28 +08:00
committed by GitHub
parent ddc389cf09
commit 643e1cc779
4 changed files with 96 additions and 111 deletions
+2 -2
View File
@@ -723,8 +723,8 @@ class Req(ReqDllmMixin):
# that preserve length would silently corrupt fill_ids.
self.output_ids = array("q")
# Full untruncated sequence: origin + output (+ DLLM mask block).
# Kept in sync by _refresh_fill_ids; admission only updates fill_len,
# never mutates this array's length.
# Kept in sync by _refresh_fill_ids; admission only updates
# extend_range, never mutates this array's length.
self.full_untruncated_fill_ids = array("q")
self.extend_range: Optional[Range] = None
self.dllm_initialized: bool = False
+4 -3
View File
@@ -2622,8 +2622,9 @@ class Scheduler(
# Stash (cache) the previous chunk only when it produced new KV
# beyond what is already cached. A parked chunk (add_chunked_req
# hybrid-SWA early-return) leaves fill_len == len(prefix_indices),
# so there is nothing new to cache and stashing would be a no-op.
# hybrid-SWA early-return) leaves extend_range.end ==
# len(prefix_indices), so there is nothing new to cache and
# stashing would be a no-op.
if self.chunked_req.extend_range.end > len(self.chunked_req.prefix_indices):
self.stash_chunked_request(self.chunked_req)
@@ -2970,7 +2971,7 @@ class Scheduler(
if self.tp_worker.model_runner.prefill_aware_swa:
for req in can_run_list:
req.swa_evict_floor = req.fill_len
req.swa_evict_floor = req.extend_range.end
# Record prefill stats for logging after forward.
new_batch.prefill_stats = PrefillStats.from_adder(