[PD-Disagg] Check finish after pop tranferred (#12638)

This commit is contained in:
Liangsheng Yin
2025-11-05 11:18:09 +08:00
committed by GitHub
parent 0711d1509b
commit 44b1b394a4
2 changed files with 50 additions and 7 deletions

View File

@@ -773,17 +773,12 @@ class DecodeTransferQueue:
indices_to_remove.add(i)
decode_req.req.time_stats.wait_queue_entry_time = time.perf_counter()
# special handling for corner cases
should_finish = decode_req.req.sampling_params.max_new_tokens == 1 or (
not decode_req.req.sampling_params.ignore_eos
and decode_req.req.output_ids[-1] in decode_req.req.eos_token_ids
)
if should_finish:
decode_req.req.check_finished()
if decode_req.req.finished():
# finish immediately
decode_req.req.time_stats.forward_entry_time = (
decode_req.req.time_stats.completion_time
) = time.perf_counter()
decode_req.req.check_finished()
self.scheduler.stream_output(
[decode_req.req], decode_req.req.return_logprob
)