refactor: route disagg prefill checkpoints through checkpoint_disagg_prefill shim

Upstream #42035's tests and call structure expect Scheduler.checkpoint_disagg_prefill
(introduced upstream with #41520's checkpoint_kv_cache / insert_req cache API).
This branch still uses maybe_cache_unfinished_req (old cache_unfinished_req API),
so add a thin shim with the upstream name and route the three call sites through it.
No behavior change.
This commit is contained in:
2026-10-09 11:22:42 +08:00
parent 9ef65b51c2
commit c4f3e3be33
+14 -3
View File
@@ -969,7 +969,7 @@ class SchedulerDisaggregationPrefillMixin:
advance_logprob_pt(i, req)
continue
maybe_cache_unfinished_req(req, self.tree_cache)
self.checkpoint_disagg_prefill(req)
self.disagg_prefill_inflight_queue.append(req)
if self.spec_algorithm.is_eagle() and draft_input is not None:
req.output_topk_p = draft_input.topk_p[i]
@@ -1326,7 +1326,7 @@ class SchedulerDisaggregationPrefillMixin:
chunked_req_to_exclude = set()
if (req := self.chunked_req) is not None:
chunked_req_to_exclude.add(req)
maybe_cache_unfinished_req(req, self.tree_cache, chunked=True)
self.checkpoint_disagg_prefill(req, chunked=True)
if not self.check_bootstrap(req):
if is_aborted(req):
@@ -1622,10 +1622,21 @@ class SchedulerDisaggregationPrefillMixin:
else:
self.disagg_prefill_pending_chunk_rids.add(req.rid)
def checkpoint_disagg_prefill(
self: Scheduler, req: Req, chunked: bool = False
) -> None:
"""Publish the request's computed prefix to the tree cache.
Name shim for the #42035-era call structure: this branch predates
#41520's ``checkpoint_kv_cache`` / ``insert_req`` cache API, so the
equivalent here is ``maybe_cache_unfinished_req``.
"""
maybe_cache_unfinished_req(req, self.tree_cache, chunked=chunked)
def optimistic_release_and_requeue(self: Scheduler, req: Req) -> None:
"""Release KV cache and requeue an optimistic prefill request."""
max_attempts = get_disagg().optimistic_prefill_attempts
maybe_cache_unfinished_req(req, self.tree_cache)
self.checkpoint_disagg_prefill(req)
# The cached prefix is evictable once the KV is released. Its length
# (capped at what a retry can match) seeds the retry's storage baseline,
# so an evicted prefix is looked up in L3 once before it is recomputed.