[Bugfix][Model Runner V2][Spec Decode] Decouple the draft's gumbel noise stream from the target's (#54282)

Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
This commit is contained in:
Giancarlo Delfin
2026-08-29 09:58:29 -07:00
committed by GitHub
parent 7fbfca2670
commit fe755c8899
11 changed files with 232 additions and 30 deletions
@@ -51,15 +51,17 @@ def _selector_walk_kernel(
other=0,
)
# Candidate ids key the noise, matching the target's own sampling.
position = tl.load(sample_pos_ptr + flat) - 1
# sample_pos is the predicted token's position P. Sampling keys a draw
# by the position before the sampled token, P-1.
sample_pos = tl.load(sample_pos_ptr + flat) - 1
_, index = gumbel_noised_argmax(
scores,
candidates,
mask & valid,
seed,
position,
sample_pos,
temperature if SAMPLE_PROBABILISTIC else 0.0,
IS_DRAFTING=True,
USE_FP64=USE_FP64,
)