[Feature] Per-row candidate IDs for prefill token scoring (M2 of #56860) (#56984)

Signed-off-by: aoshen02 <aoshen02@users.noreply.github.com>
Co-authored-by: aoshen02 <aoshen02@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aoshen02
2026-10-03 14:17:09 +00:00
committed by GitHub
co-authored by aoshen02 Claude Opus 5.5
parent bc21cba967
commit e319f86f15
17 changed files with 366 additions and 162 deletions
+12
View File
@@ -423,6 +423,18 @@ class InputProcessor:
parameter="routed_experts_prompt_start",
value=sampling_params.routed_experts_prompt_start,
)
rows = sampling_params.prompt_logprob_token_ids
if rows is not None:
start = sampling_params.prompt_logprob_start or 0
num_rows = max(prompt_len - 1 - start, 0)
if len(rows) != num_rows:
raise VLLMValidationError(
f"prompt_logprob_token_ids has {len(rows)} rows, but the "
f"prompt has {num_rows} scored rows "
f"(prompt_len - 1 - prompt_logprob_start).",
parameter="prompt_logprob_token_ids",
value=len(rows),
)
# If unset max tokens, then generate up to the max_model_len.
if sampling_params.max_tokens is None:
sampling_params.max_tokens = (