vllm.v1.worker.gpu.sample.logprob
¶
Classes:
-
LogprobTokenIdsState–Per-request override of which token ids' logprobs to return.
Functions:
-
concat_logprob_stashes–Join the logprobs stashed for the requests committing this step.
-
masked_stash_write–Write
new([n * W] rows) into the per-slot stash wherekeep.
LogprobTokenIdsState
¶
Per-request override of which token ids' logprobs to return.
See SamplingParams.logprob_token_ids.
Source code in vllm/v1/worker/gpu/sample/logprob.py
concat_logprob_stashes(parts, cu_num_generated_tokens)
¶
Join the logprobs stashed for the requests committing this step.
Each stash is as wide as the widest logprobs request in the batch at the step that request converged, so stashes from different steps can differ in width. Pad the narrow ones the way compute_topk_scores pads a mixed batch: token id 0 at -inf, which the output processor never reports.
Source code in vllm/v1/worker/gpu/sample/logprob.py
masked_stash_write(stash, slots, keep, new)
¶
Write new ([n * W] rows) into the per-slot stash where keep.
The PyTorch counterpart of DiffusionGemma's stash_converged_logprobs.