[Bugfix][Model Runner V2] Fix min_tokens off-by-one in the V2 GPU sampler (#46243)

Signed-off-by: Ting Sun <suntcrick@gmail.com>
This commit is contained in:
Ting SUN
2026-06-21 05:06:49 +00:00
committed by GitHub
parent a346d589f5
commit 183a430c13
+1 -1
View File
@@ -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,