[Bugfix] Drop out-of-vocabulary stop ids from min-tokens masking (qwen3-tts min_tokens engine crash) (#4971)

Signed-off-by: Yueqian Lin <linyueqian@outlook.com>
This commit is contained in:
Yueqian Lin authored and GitHub committed 2026-07-08 11:24:31 -07:00
1 parent 267b49b880
commit da15a4cb1c
6 files changed
+201

No files matched your search

+10
View File
@@ -47,6 +47,7 @@ from vllm_omni.utils.mm_outputs import build_mm_cpu, partition_payload_list, to_
from vllm_omni.worker.gpu_model_runner import OmniGPUModelRunner
from vllm_omni.worker.omni_connector_model_runner_mixin import OmniConnectorModelRunnerMixin
from vllm_omni.worker.runner_assisted_metadata import RunnerAssistedFullAttentionMetadataRequest
from vllm_omni.worker.sampling_utils import sanitize_min_tokens_stop_ids
logger = init_logger(__name__)
@@ -1892,6 +1893,15 @@ class GPUARModelRunner(OmniGPUModelRunner, OmniConnectorModelRunnerMixin):
if self.input_batch.vocab_size > logits_vocab:
smd.prompt_token_ids = smd.prompt_token_ids.clamp(max=logits_vocab)
# Drop min-tokens stop ids the head cannot emit (e.g. the text
# tokenizer EOS folded into all_stop_token_ids on a narrow codec
# talker head); they would index_put_ out of bounds (#4962).
if logits is not None:
sanitize_min_tokens_stop_ids(
self.input_batch.sampling_metadata.logitsprocs,
logits.shape[-1],
)
with record_function_or_nullcontext("gpu_model_runner: sample"):
sampler_output = self._sample(logits, spec_decode_metadata)