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:
-
cat–Join request-contiguous chunks that share one output layout.
-
from_logits–Capture the finite-logit support of every row with a sampled token.
-
tolists–Convert fixed output rows to the scheduler's CSR representation.
Source code in vllm/v1/worker/gpu/sample/output.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
cat(chunks)
classmethod
¶
Join request-contiguous chunks that share one output layout.
Source code in vllm/v1/worker/gpu/sample/output.py
from_logits(logits, cu_num_logits, num_sampled_tokens, max_num_kept, rows_per_request=1)
classmethod
¶
Capture the finite-logit support of every row with a sampled token.
Source code in vllm/v1/worker/gpu/sample/output.py
tolists(num_sampled_tokens=None)
¶
Convert fixed output rows to the scheduler's CSR representation.
Source code in vllm/v1/worker/gpu/sample/output.py
_compact_sampling_mask_kernel(logits_ptr, logits_row_stride, logits_col_stride, cu_num_logits_ptr, 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, ROWS_PER_REQUEST, BLOCK_SIZE)
¶
Per row: first max_num_kept finite-logit ids, the full count, the bitmask.