Skip to content

vllm.v1.worker.gpu.sample.gumbel

Functions:

  • gumbel_noised_argmax –

    Argmax of logits under Gumbel-max sampling, or plain argmax at temp 0.

  • spec_step_seed –

    Mix a speculative step into the high bits of a request seed.

gumbel_noised_argmax(logits, keys, mask, seed, pos, temp, IS_DRAFTING, USE_FP64, APPLY_TEMPERATURE=True)

Argmax of logits under Gumbel-max sampling, or plain argmax at temp 0.

keys indexes the noise, so the same token draws the same noise wherever it appears; pos and seed place the draw in the request's stream, which is what lets a draft and its verification agree.

spec_step_seed(seed, step)

Mix a speculative step into the high bits of a request seed.