Skip to content

vllm.v1.worker.gpu.spec_decode.rejection_sampler

Functions:

_iter_request_chunks(cu_num_logits, max_chunk_logits)

Yield maximally packed request ranges without splitting requests.

gather_draft_sampled(input_ids, positions, logits_indices, expanded_idx_mapping, expanded_local_pos, prefill_len)

Gather the input token and position of each logits row.

Draft rows of requests that have not yet sampled past their prefill are set to -1 so that the rejection kernels reject them.

get_max_chunk_logits(vocab_size)

Largest number of logits rows one verification chunk may hold.

unconditional_to_conditional_rates(rates)

Convert per-position unconditional rates to per-position conditional rates for the early-terminating rejection loop (c_i = p_i / p_{i-1}).