Minor code cleanup / improvement for PREBUILT_EXTEND mode (#12948)

This commit is contained in:
Liangsheng Yin
2025-11-10 11:59:54 +08:00
committed by GitHub
parent 83f89cc615
commit 61c7fe7aed
7 changed files with 50 additions and 55 deletions
@@ -42,21 +42,20 @@ class SchedulerOutputProcessorMixin:
We put them into a separate file to make the `scheduler.py` shorter.
"""
def process_batch_result_prebuilt_extend(self: Scheduler, batch: ScheduleBatch):
def process_batch_result_prebuilt(self: Scheduler, batch: ScheduleBatch):
assert self.disaggregation_mode == DisaggregationMode.DECODE
for req in batch.reqs:
for req in batch.reqs:
req.check_finished()
if req.finished():
req.time_stats.forward_entry_time = (
req.time_stats.completion_time
) = time.perf_counter()
trace_slice_end(
RequestStage.DECODE_QUICK_FINISH,
req.rid,
thread_finish_flag=True,
)
self.tree_cache.cache_finished_req(req)
req.check_finished()
if req.finished():
req.time_stats.forward_entry_time = req.time_stats.completion_time = (
time.perf_counter()
)
trace_slice_end(
RequestStage.DECODE_QUICK_FINISH,
req.rid,
thread_finish_flag=True,
)
self.tree_cache.cache_finished_req(req)
# Note: Logprobs should be handled on the prefill engine.
trace_slice_batch(RequestStage.DECODE_FAKE_OUTPUT, batch.reqs)