Minor code cleanup / improvement for PREBUILT_EXTEND mode (#12948)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user