From 183a430c137db3d5cd0b9025b816f26ee87328e7 Mon Sep 17 00:00:00 2001 From: Ting SUN Date: Sun, 21 Jun 2026 12:06:49 +0700 Subject: [PATCH] [Bugfix][Model Runner V2] Fix min_tokens off-by-one in the V2 GPU sampler (#46243) Signed-off-by: Ting Sun --- vllm/v1/worker/gpu/sample/logit_bias.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/v1/worker/gpu/sample/logit_bias.py b/vllm/v1/worker/gpu/sample/logit_bias.py index cabb3fc11f..396f9f509c 100644 --- a/vllm/v1/worker/gpu/sample/logit_bias.py +++ b/vllm/v1/worker/gpu/sample/logit_bias.py @@ -222,7 +222,7 @@ def _bias_kernel( num_stop_token_ids = tl.load(num_stop_token_ids_ptr + req_state_idx) pos = tl.load(pos_ptr + token_idx) min_len = tl.load(min_lens_ptr + req_state_idx) - if num_stop_token_ids > 0 and pos < min_len: + if num_stop_token_ids > 0 and pos + 1 < min_len: mask = block < num_stop_token_ids stop_token_ids = tl.load( stop_token_ids_ptr + req_state_idx * stop_token_ids_stride + block,