Fix potential eos bug on decode instance when PD is enabled (#12206)
Signed-off-by: Shangming Cai <csmthu@gmail.com>
This commit is contained in:
@@ -773,8 +773,12 @@ class DecodeTransferQueue:
|
|||||||
indices_to_remove.add(i)
|
indices_to_remove.add(i)
|
||||||
decode_req.req.time_stats.wait_queue_entry_time = time.perf_counter()
|
decode_req.req.time_stats.wait_queue_entry_time = time.perf_counter()
|
||||||
|
|
||||||
# special handling for sampling_params.max_new_tokens == 1
|
# special handling for corner cases
|
||||||
if decode_req.req.sampling_params.max_new_tokens == 1:
|
should_finish = (
|
||||||
|
decode_req.req.sampling_params.max_new_tokens == 1
|
||||||
|
or output_id in decode_req.req.eos_token_ids
|
||||||
|
)
|
||||||
|
if should_finish:
|
||||||
# finish immediately
|
# finish immediately
|
||||||
decode_req.req.time_stats.forward_entry_time = (
|
decode_req.req.time_stats.forward_entry_time = (
|
||||||
decode_req.req.time_stats.completion_time
|
decode_req.req.time_stats.completion_time
|
||||||
|
|||||||
Reference in New Issue
Block a user