vllm.v1.worker.gpu.sample.output ¶
Classes:
-
SamplingMaskTensors–Device-side masks pending async D2H: compact ids, plus the bitmask as
SamplingMaskTensors ¶
Bases: NamedTuple
Device-side masks pending async D2H: compact ids, plus the bitmask as the exact fallback for rows wider than max_num_kept.
Methods:
-
from_logits–Capture the finite-logit support of every row with a sampled token.
-
tolists–CSR over all requests; rows without a sampled token are empty.
Source code in vllm/v1/worker/gpu/sample/output.py
from_logits(logits, num_sampled_tokens, max_num_kept) classmethod ¶
Capture the finite-logit support of every row with a sampled token.
Source code in vllm/v1/worker/gpu/sample/output.py
tolists() ¶
CSR over all requests; rows without a sampled token are empty.
Source code in vllm/v1/worker/gpu/sample/output.py
_compact_sampling_mask_kernel(logits_ptr, logits_row_stride, logits_col_stride, num_sampled_tokens_ptr, token_ids_ptr, token_ids_row_stride, packed_mask_ptr, packed_mask_row_stride, counts_ptr, vocab_size, max_num_kept, BLOCK_SIZE) ¶
Per row: first max_num_kept finite-logit ids, the full count, the bitmask.