Speculative decoding
Use this reference to configure draft models, draft trees, rejection sampling, and benchmark-only synthetic acceptance. The following table summarizes the command-line parameters and their requirements. For the experimental support scope, see Block verification (experimental).
| Parameter | Purpose |
|---|---|
--speculative-config | JSON speculative decoding configuration. |
--speculative-algorithm | Speculative algorithm, such as EAGLE3, EAGLE4, MTP, DFLASH, DSPARK, or DUMMY. DUMMY generates deterministic candidates without a draft checkpoint; it tests target multi-token verification, not draft-model quality. Set --speculative-num-draft-tokens above 1 and do not pass a draft model path. |
--speculative-draft-model-path | Draft model path or repo ID. |
--speculative-draft-model-revision | Branch, tag, or commit of a draft in its own repo. Defaults to the repo's default branch. A draft inside the target checkpoint uses --revision. |
--speculative-draft-model-quantization | Draft model quantization. Defaults to unquant. |
--speculative-draft-lm-head-quantization {none,fp8_weight_only} | Qwen3.8 and Qwen4 MoE MTP: fp8_weight_only makes a copy of the target's 16-bit LM head with E4M3 rows and one FP32 scale per vocabulary row at startup (allocated with the draft's weights, counted before the KV-cache budget; releasing weights releases it), and the draft steps project through it (gemm.mv_fp8_weight, half the bytes of the BF16 head); the target's verify keeps the BF16 head, so target outputs are unchanged. A draft numerics change: it can change acceptance, refused under --numerics rl-bitwise and --model-update-config. none (default) shares the target's head. |
--speculative-draft-moe-quantization {none,mxfp4} | Qwen3.8 and Qwen4 MoE MTP: mxfp4 quantizes the draft layer's BF16 routed experts to MXFP4 while they load, with the target's AMD Quark scheme (E8M0 scales from the group amax rounded to E2M1's mantissa, round-half-even codes; a serialized Quark expert re-quantizes to the same bits), so the draft runs the target's MXFP4 MoE kernels; the draft's other modules stay BF16. A draft numerics change, refused under --numerics rl-bitwise, --model-update-config, and --decode-monokernel. none (default) keeps them BF16. |
--speculative-num-steps | Number of draft model steps. Defaults to 3. |
--speculative-num-draft-tokens | Number of draft tokens. Defaults to --speculative-num-steps + 1; required for draft trees. |
--synthetic-acceptance-length | Benchmark-only mean emitted tokens per speculative verification, including the guaranteed target token. Unset disables it. |
--speculative-eagle-topk | Children each draft node expands to per step. Defaults to 1 (a chain); above 1 the draft is a tree. |
--enable-speculative-sampling | Draft-prob rejection sampling for the chain drafters, EAGLE-Harness trees and chains, and DFLASH with a base draft or DFlash2 draft. Off by default. |
--enable-draft-forward-batch-invariant | Make a DFLASH draft's rows independent of the batch they run in: its decode attention folds a row's keys in index order and its context K|V write uses a batch-invariant GEMM plan and takes the per-layer path in every round (the stacked fused write is off). Needs --numerics rl-bitwise (refused under auto, where the draft's other GEMMs are not batch-invariant) and a batch-invariant gemm.mm leaf with BF16 output, which the kernel tree does not provide (its gfx950 leaf writes FP32), so a provider from outside the tree is required on every platform; without one the launch stops when the draft is built. Supported and verified only for a DFLASH GQA draft whose layers all use a sliding window, unquantized, with a drafter attention backend of mha or triton (the only decode kernel declaring batch invariance is Triton's, so a pin to fa3, fa4, or flashinfer fails); any other draft or backend (for example trtllm) fails at startup. Off by default, also under --numerics rl-bitwise. See Draft forward batch invariance. |
--speculative-rejection-sample-method | Verify rule, named as vLLM's rejection_sample_method: standard (default, token-wise), block (block verification; see Block verification), or synthetic (set by --synthetic-acceptance-length). |
--spec-reject-draft-prob-threshold | With --enable-speculative-sampling, recorded draft probabilities above this value mark a request with no proposal yet and always reject. Defaults to 2.0; must lie within [1.0, 2**20]. No effect on DFLASH with a DFlash2 draft under token-wise verification, where it records a sparse q. |
--eagle3-layers-to-capture | Target layers whose hidden states feed an EAGLE3 or EAGLE4 draft. A target whose forward returns no layer taps (for example Qwen3, Qwen3-MoE, or DeepSeek V4.1) refuses these drafts and DFLASH at startup. |
--speculative-exec-mode | EAGLE4 drafting (see EAGLE-4): -1 (default) static chains and trees, 0 EAGLE-Harness dynamic chains and trees, 1 the same for evaluation runs, 2 measures the EAGLE-Harness cost data. |
--speculative-data-path | EAGLE-Harness run directory: the cost data exec modes 0 and 1 read, which exec mode 2 writes. |
--speculative-compute-intensity | EAGLE-Harness policy tier: high_intensity (default) or low_intensity for trees, chain_intensity for chains (--speculative-eagle-topk 1). |
--speculative-chain-width-table | EAGLE-Harness chains in exec modes 0 and 1: MIN_BS:WIDTH,... fixes the verify width of rounds with at least MIN_BS live requests. off (default) lets the confidence rule decide every round. |
--disable-replay-ssm | Stage every verify position's recurrent state instead of replaying the accepted tokens. ReplaySSM is on by default for supported Qwen GDN and Nemotron-H Mamba2 targets; --enable-replay-ssm is accepted as a deprecated no-op. |
Prefer --speculative-config for recipe-style launches because it keeps method, draft model, and token count together.
Draft graph overlap
Where the configuration supports it (an MTP greedy chain of at least two steps on NVIDIA decode graphs with DP1/PP1 and a draft model that declares support; today the Qwen4-Exp MTP head), the decode graph releases the execution stream after its first draft step, so the verified-state commit, output copies and the next round's metadata refresh run beside the rest of the draft chain. Rank 0 logs whether it is on. TOKENSPEED_DRAFT_GRAPH_OVERLAP=0 turns it off; =1 requires it and fails at startup when the configuration does not support it. For more information, see Whole-graph draft overlap.
Synthetic acceptance length
The greedy and sonic sampling backends accept it, and the flashinfer backend only over sampled drafts (--enable-speculative-sampling). Speculative decoding must be enabled, and --dp-sampling, --enable-output-logprobs, and draft trees are rejected at startup, as are the other sampling backends. On the greedy backend, token selection is always argmax, so stochastic sampling and penalties do not apply there; use unconstrained greedy requests (temperature: 0) with it.
Use --synthetic-acceptance-length L to benchmark speculative execution at a fixed mean acceptance length (AL). AL includes the guaranteed target token, so 1 <= L <= --speculative-num-draft-tokens (the verify width). AL 1 rejects every draft; AL equal to the verify width accepts every draft. A fractional AL emits either floor(L) or ceil(L) tokens per verification, with probability L - floor(L) of the larger length. For example, AL 2.6 accepts one draft token on 40% of steps and two on 60%, plus a target token.
The draft and target models and the normal verification kernel still execute. The verification result is then overridden with synthetic acceptance before committing tokens and updating request state, preserving verification overhead. The override copies the forced draft prefix and selects the existing target argmax at the cutoff, in one launch. It adds no second verification or target-resampling pass. Do not use generated text for correctness or accuracy evaluation. Request termination can truncate the last verification's output.
Either of the following argument forms configures three draft slots (verify width four) and AL 2.6:
--sampling-backend greedy --speculative-algorithm MTP --speculative-num-steps 3 --synthetic-acceptance-length 2.6
--sampling-backend greedy --speculative-config '{"method":"mtp","num_speculative_tokens":3,"synthetic_acceptance_length":2.6}'Conflicting values between the flag and JSON configuration are rejected. The value must be finite and speculative decoding must be enabled. It selects the synthetic rejection method. The greedy and sonic backends accept it; the flashinfer backend only over sampled drafts (--enable-speculative-sampling); see Block verification. On sonic the token at the cutoff is the target's draw there, taken from the candidates the verify kernel already selected: a greedy request's argmax, otherwise the draw sonic makes past a fully accepted window, with the same per-request noise. For block drafters with implicit widths, the upper bound is checked against the checkpoint's resolved verify width when the sampler is initialized.
Draft chains and trees
EAGLE3 and MTP drafts are chains by default: --speculative-num-draft-tokens must equal --speculative-num-steps + 1. With --speculative-eagle-topk above 1 they draft a tree instead, and --speculative-num-draft-tokens is its node budget (root included). Set it explicitly: topk 1..16, steps 1..10, (steps - 1) * topk lane slots within the node budget, and at most 64 nodes. Trees need the trtllm attention backends (trtllm_mla or tokenspeed_mla for MLA models) and the greedy, triton, flashinfer, or sonic sampling backend; see draft-tree speculation for the full scope.
MTP head shapes
MTP serves two head shapes under one flag. An Eagle-like head (one MTP layer chained on its own hidden, such as DeepSeek NextN) runs the Eagle chain. A multi-depth head (one distinct depth layer per draft step over the same window, such as Inkling, or an out-of-tree draft registered for the multi-depth drafter) runs every depth 0..--speculative-num-steps-1 each round, so the draft checkpoint needs at least that many depths. Both shapes run under attention data parallelism (idle ranks mirror the depth loop with empty forwards) and with PD layerwise transfer (--disaggregation-layerwise-interval), where the draft's per-depth cache planes become ready together after the drafter's run. Known PD limitation of the multi-depth head: the PD transfer does not carry the drafter's cross-round stash (the last k-1 committed tokens and their target hiddens per request) with the KV, so for up to k-1 decode rounds after a request lands on the decode node the draft rewrites prompt-tail draft-KV positions from an unfilled stash. Draft acceptance may dip for those rounds. Verification stays exact. Shipping the stash with the bootstrap payload is a planned follow-up.
EAGLE-4
EAGLE4 serves an EAGLE-4 draft, whose candidate head scores a short list of candidate tokens per draft row instead of the whole vocabulary. With the default --speculative-exec-mode -1 it drafts static chains and trees under the preceding EAGLE3 rules.
The draft config selects its layer's structure: attn_norm merges the embedding and hidden inputs through eh_proj, use_rope: false attends without rotary embeddings, and enable_moe with moe_architecture: nemotron_latent_relu2 routes Nemotron-H's latent MoE (without expert parallelism). Loading refuses a draft config key or checkpoint tensor the model does not build.
With exec mode 0, EAGLE-Harness sizes each round on the device from measured cost data (or, for chains, from the width table where it applies): how deep the draft grows and how many nodes the target verifies. Measure the cost data with the exec mode 2 driver (python -m tokenspeed.runtime.execution.drafter.eagle_harness.measure_run --help), then serve with --speculative-data-path set to its run directory and the same draft shape, TP size, attention backends, KV-cache dtype (--kv-cache-dtype), and state dtype. Exec mode 1 serves evaluation clients that write their batch size to <data path>/config/benchmark_config.json: it runs like exec mode 0, except that a tree round far smaller than that batch drafts only the root's children and verifies narrowly. Harness rounds, chains included, run on the draft-tree path and share its requirements, with these limits:
- Trees:
--speculative-eagle-topk2, 4 or 8 withhigh_intensityorlow_intensity, at most 32 requests per rank. - Chains:
--speculative-eagle-topk 1withchain_intensity, at most 15 steps and 16 draft tokens, and at most 512 requests per rank (256 when measuring). The confidence rule decides rounds of up to 256 requests (the cost data's range);--speculative-chain-width-tablemust cover larger rounds. To calibrate a table,TOKENSPEED_EAGLE_HARNESS_ROUND_STATS=Nlogs rank 0's round counts per batch size everyNrounds. --speculative-num-steps2 to 32 (64 when measuring), with(steps - 1) * topkat most 128 and1 + topk + (steps - 1) * topk^2at most 1024.--enable-speculative-samplingsamples harness trees and chains (not when measuring) and needs--sampling-backend flashinferortriton, which accept them by tree rejection sampling (tritonon its no-filter and top-k routes; its top-p-only and mixed routes keep the target-sampled walk). A node's children are drawn without replacement from the draft'ssoftmax(logits / T)over its candidates; like the chains'q, it is not cut to the request's top-k / top-p, which would leave children past the cut that can never be accepted. StaticEAGLE4drafts do not take it. The sampled-tree kernels have CUDA and Triton builds.
Draft-prob rejection sampling
By default the chain drafters (EAGLE3, MTP) propose the argmax of their logits and the verifier runs the target-only rule: it accepts draft x with probability p(x), and a rejection samples the target with x removed. The served distribution is the target's p whatever the drafter proposed, so the verifier needs no draft distribution. --enable-speculative-sampling switches to the standard rule: each draft step samples its token from the drafter's own distribution q = softmax(draft logits / T) at the request's temperature (greedy requests keep the argmax and a one-hot q), records q, and the next round's verify accepts with coin * q(x) < p(x) and resamples from norm(relu(p - q)). Both rules serve p. The draft-prob rule accepts 1 - TV(p, q) of the drafts, which is markedly higher than p(argmax q) when requests sample at temperature. Greedy requests behave identically under both rules. top_k, top_p, min_p, penalties, and logit_bias stay on the verifier's side. q only follows the temperature.
A request admitted has no recorded q for its first chain: its rows hold a sentinel above --spec-reject-draft-prob-threshold, which rejects at the first draft and samples the first token from the full target. A request a capacity retraction suspends keeps its q: the recorded distributions travel in its slot-state image and come back with the restore, so its first verify after resuming accepts drafts exactly as the uninterrupted run would. The sentinel is written as threshold + 1.0 in fp32, hence the range: below 1.0 a real probability would read as the sentinel, and the cap keeps the + 1.0 representable. Under PD disaggregation the prefill node's candidates land the same way, so the decode node's first verify of a landed request accepts nothing. TokenSpeed refuses the flag on the prefill role (--disaggregation-mode prefill): that role never verifies a chain and its candidates ship without q, so it would only allocate the distribution buffer. Pass it to the decode role only.
Requirements: --speculative-algorithm EAGLE3, MTP, DSPARK (each DSpark Markov step samples its token), or DFLASH (described in the following sections), --speculative-eagle-topk 1, and --sampling-backend flashinfer, flashinfer_full, sonic, or triton (sonic reads q at its top-128 target candidates; triton runs the rule over whole rows on its no-filter and top-k routes and keeps the target-sampled exact match on the top-p-only and mixed routes; greedy verifies by exact match and triton_full by target-sampled exact match; neither reads the dense q). The drafter switches its draft model's fused TP-sharded argmax off so the full-vocab logits reach it, which adds the logits all-gather to every draft step under tensor parallelism. With sonic sampling vocabulary shards (the server logs Sampled rows stay vocab-sharded) and an MTP, EAGLE3, or DSpark draft head spanning the target vocabulary, the draft steps stay sharded too (Draft steps stay vocab-sharded; a DSpark step adds its Markov bias to the shard of the target head's logits, unless the head scales or softcaps them): each rank samples its shard of the draft logits, the ranks exchange a few values per request instead of the logits, every rank draws the same token, and each records q over its own vocabulary columns; its verify candidates carry that q through their gather. An EAGLE3 head with a smaller hot-token vocabulary (d2t) still gathers its draft logits, because its columns do not line up with the target's shards, but each rank records q over its own vocabulary columns only (Draft steps gather the hot-token head's logits and each rank records q over its own columns).
Known limits, kept as in the reference engine for now: a landed PD request's first verify always rejects its shipped candidates (sentinel rows) rather than verifying them target-only, and the verifier gathers the full [bs, N, vocab] block of recorded rows per step instead of only the entries the accept test reads. A draft step whose logits give no finite distribution (all NaN, or an overflow) proposes a junk token and records the sentinel for that row, so verify rejects the token and samples from the full target. It never raises a device error.
Memory: with rank-local execution capacity B and resident capacity C, dense recorded distributions take (C + 2) x num_draft_tokens x V x 4 bytes, where V is the full vocabulary size or, for vocabulary-sharded Sonic, this rank's vocabulary columns. Backends that gather dense q also allocate a batch-ordered buffer of B_pad x num_draft_tokens x vocab_size x 4 bytes, where B_pad is B rounded up for the backend's sampling padding; E does not increase it. With full-vocabulary q, B_pad=B=C=80, 4 draft tokens and a 129K vocabulary, the two buffers total about 330 MB. On CUDA, when the CUDA-graph memory reserve is on, the runtime charges both to it as startup residue, out of the KV-cache budget. Otherwise they come out of the --gpu-memory-utilization headroom.
DFLASH with a base draft
A base DFLASH draft (no candidate selector) proposes a whole block from one forward. Under the flag it samples every block row from the target head's distribution q = softmax(logits / T) at the request's temperature and records that dense q, as the step drafters do; verify then runs the same draft-prob rule (coin * q(x) < p(x), residual norm(relu(p - q))), so the served distribution is the target's p. The rows share no token dependency, so one GEMM projects all num_draft_tokens - 1 of them through the head, and each row draws with its own noise offset. Greedy requests keep the argmax and a one-hot q. The verifier is one of flashinfer, flashinfer_full, or sonic, or triton under block verification; token-wise triton reads only the DFlash2 q described in the following section, so that pairing is refused when the server loads the draft.
Both rules serve p, so the flag changes the acceptance rate and not the distribution. The draft-prob rule accepts 1 - TV(p, q) of the drafts and the target-only rule p(argmax q); which is higher for a draft trained to be read greedily is a measurement, not a given.
- Memory: the same dense rows as the step drafters,
(max_num_seqs + 2) x num_draft_tokens x vocab_size x 4bytes, plus the verifier's gather buffer. Those rows are persistent; the block's own peak is transient and sits in the drafting round: the one GEMM's whole-vocabulary logits over every block row,(num_draft_tokens - 1) x batch x vocab_size x 2bytes, which under tensor parallelism is the gathered vocabulary rather than this rank's shard, plus onebatch x vocab_sizefp32qper row. A greedy block keeps only the shard, so expect the drafting round's logits to grow by the head's TP size when the flag goes on. - No proposal: a fresh admission and a PD landing hold the sentinel, so their first verify rejects every draft and samples from the full target, as for the step drafters.
--spec-reject-draft-prob-thresholdapplies. Pass the flag to the decode role only. - The draft head: sampling needs the whole row, so the head's logits are gathered to full vocabulary rather than reduced to an argmax. Under
--lm-head-tp-sizewith attention DP the draft already holds a rank-local copy of the head, so this adds no collective.
DFLASH with a DFlash2 draft
DFLASH takes the flag with a DFlash2 draft (a checkpoint with candidate selector weights) and --sampling-backend triton only; a DFlash2 draft with any other backend is refused when the server loads it, except under block verification. The DFlash2 walk picks one of the selector's K candidates per draft step. Under the flag a sampling request draws that candidate from q = softmax(scores / T) over the K edges out of the previous pick, with noise keyed by the request's seed, the round, and the drawn token id, so every TP rank draws the same token. Greedy requests keep the best edge. Requests with top-k disabled and top_p < 1 also keep it (see the Routes entry in the following list), as does a step whose scores are not finite. None of these three records a proposal. The walk records q and the candidate ids per step, which is K entries instead of a vocabulary row. Verify accepts draft x with probability min(1, p'(x) / q(x)) and on rejection samples from norm(max(p' - q, 0)), where p' is the target distribution after the request's temperature, top-k, and top-p, the one the Triton backend serves.
- Memory:
qreuses the draft-tree q tables (RuntimeStates.future_draft_q), (C + 2) x (num_draft_tokens - 1) x K x 8 bytes, where C is the rank-local resident capacity, plus two int32 rows of num_draft_tokens per slot. That is under 1 MB at 512 slots, 8 draft tokens andK = 16. No dense per-vocab rows, no gather buffer, and the draft head keeps its shard-local top-K. - No proposal: a fresh admission, a PD landing, and a forced single-token verify record no
q. Their drafts are checked by the target-only rule, which keeps a draft exactly when it equals the target's own draw at that position. So a landed request's first verify can still accept drafts, unlike the step drafters' sentinel, which always rejects.--spec-reject-draft-prob-thresholdhas no effect here. - Routes: the Triton backend picks one sampling route per batch. The rejection rule runs on batches with no filter (top-k disabled,
top_p = 1) and on batches where every request has a finite top-k, with anytop_p. Under the flag those top-k batches always use the two-stage top-k kernel, at every row count. Batches with top-p only (top-k disabled,top_p < 1) and mixed batches (for example greedy next to no-filter requests) have no exactp'and verify every row by the target-only rule. There a sampled draft is kept with probabilitysum(p * q), which can be below the greedy draft'sp(argmax q). Keep sampling parameters uniform across a batch for the best acceptance.
Under --speculative-rejection-sample-method block the walk records a dense q instead: each step draws through the shared proposal sampler over a vocabulary row holding the K edges' scores, so q is a whole-vocabulary row, zero off the candidates, and flashinfer verifies it as well as triton. Block verification checks it against the exact filtered target, so requests with top-p only sample too, and --spec-reject-draft-prob-threshold applies. Memory is then the dense q rows, (max_num_seqs + 2) x num_draft_tokens x vocab_size x 4 bytes, plus one fp32 vocabulary row per batch row for the draws; the draft head still keeps its shard-local top-K.
Block drafters
DFLASH and DSPARK are block drafters: one draft forward proposes a whole block instead of one token per step, so their two token counts are coupled. --speculative-num-draft-tokens is the verify width -- one anchor row plus one row per drafted token -- and --speculative-num-steps must be one less. Left at their defaults, both come from the draft checkpoint's block_size. An explicit launch may draft fewer tokens than that block, except on DeepSeek V4.1 DSpark, whose drafter always drafts the whole block, and a DFLASH launch may also draft more, since its forward drafts every row of the block at once. Startup rejects any other mismatch. The two families spell that block_size differently:
- DSpark checkpoints store the drafted token count, so
block_size(dspark_block_sizeon same-checkpoint DSpark) equals--speculative-num-steps.block_size: 8wants--speculative-num-steps 8 --speculative-num-draft-tokens 9. - DFlash and DFlash2 checkpoints store the verify width, so
block_sizeequals--speculative-num-steps + 1.block_size: 8wants--speculative-num-steps 7 --speculative-num-draft-tokens 8.
A checkpoint that declares no block_size leaves both flags as given.
DFlash2 architectures
A checkpoint whose architecture is DFlash2DraftModel uses the same DFLASH launch method. TokenSpeed selects its grouped-convolution and candidate-selector runtime from the checkpoint architecture, so you need no separate algorithm flag. Draft proposals greedily follow the selector's transition-conditioned path. One Triton kernel per verify step walks it. The target's verification step applies a request's temperature, top_k, and top_p, never the proposal, so the served distribution is the target's whatever the drafter proposed. DFlash2BeamDraftModel, Beam's drafter, is a DFlash2 drafter as well. DFlash2DominoDraftModel, the v2 drafts' Domino corrector, is one too: a small transformer replaces the candidate selector and picks the block's tokens one at a time from a shared candidate pool. Greedy requests take each slot's best candidate. Under --enable-speculative-sampling the picks are drawn and record a dense q, zero off the pool, which flashinfer, flashinfer_full, and sonic read, or triton under block verification.
Pipeline-parallel prefill
On a prefill server with --pipeline-parallel-size > 1, TokenSpeed accepts speculation for MTP and DSPARK only. The drafter runs on the last stage, the only stage that samples. It writes the candidate block the remote decode carries to the decode server, which verifies it as usual. DSPARK also produces its draft context across stages and keeps requiring attention CP = 1 and matching dense/attention TP groups. An MTP (NextN) draft reads only the last stage's final hidden states: the other stages build and load no draft model at all, and the NextN checkpoint must ship its embed_tokens weight because the target embedding lives on the first stage. DFLASH and EAGLE3 read target taps from several stages, and TokenSpeed rejects them on a pipeline. The runtime decides layerwise transfer (--disaggregation-layerwise-interval) per stage: stages before the last own no draft cache and always allow it. The last stage allows it exactly when the same drafter would on a single-stage server (the Mtp and EAGLE-style drafters enqueue every depth's KV write inside their run, so they finalize layerwise; startup still rejects a drafter class without that guarantee there).
Draft attention backends
A block drafter writes its KV at the target's cache locations, so it shares the target's page table: the prefix granularity is the target cache recipe's and the draft follows it. Any sliding window the draft checkpoint declares is an attention mask that the draft's own layers apply, never a cache-retention policy of its own. Only the backends that forward that mask to their kernels can serve such a draft: mla and tokenspeed_mla (gluon on AMD) for MLA drafts, and mha/fa3/fa4/triton/flashinfer/trtllm_mha for GQA drafts. Startup rejects any other --drafter-attention-backend rather than quietly widening the draft's attention to the full history.
Use --attention-backend mha and --drafter-attention-backend mha for standard or grouped-query attention in the target and draft, respectively.
Block verification (experimental)
--speculative-rejection-sample-method block --enable-speculative-sampling --sampling-backend flashinfer verifies a sampled draft chain by block verification instead of token-wise rejection. --sampling-backend triton (the ROCm path) runs it too. Because block verification needs whole target rows, the Triton backend skips its vocabulary-shard candidate selection and, unless the batch's top-k bounds the candidates, sorts whole rows. The names follow vLLM: --enable-speculative-sampling is draft_sample_method=probabilistic, and --speculative-config also accepts the draft_sample_method and rejection_sample_method keys. It supports DSPARK (probabilistic Markov drafting), EAGLE3 with --speculative-eagle-topk 1, and DFLASH; block verification is defined on a single chain, so draft trees are refused. EAGLE3 already samples its chain under --enable-speculative-sampling, and its hot-token q is recorded over the full vocabulary with zeros outside the draft vocabulary. Every DFLASH draft records a dense, whole-vocabulary q here; a DFlash2 walk's is zero outside each step's K edges and a Domino corrector's outside its candidate pool. The feature is disabled by default; without it, the greedy DSpark path and the token-wise EAGLE3 and DFLASH verifiers are unchanged. The initial support scope is aggregate TP, including DCP, without attention DP, DP sampling, pipeline parallelism, or PD disaggregation. Other combinations fail at startup.
Draft probabilities follow the request temperature; greedy requests retain one-hot proposals. Target filtering and grammar masks still apply before verification. The verifier uses clipped prefix likelihood ratios, selects the longest accepted prefix, and samples a prefix-scaled positive residual (or a target bonus token). It is not a single whole-block likelihood-ratio test. The output uses the existing accepted-length and state rollback contract.
The existing per-request proposal RNG is reused. The accepted length depends on every prefix coin, so no two verify steps of a request share a coin: the FlashInfer backend draws fresh coins each step, and the Triton backend keys one step's coins by the request's seed and the step's first verify position. A stochastic output difference from greedy decoding is expected; validate the output distribution and accuracy, rather than requiring identical token IDs.
Replacing block with --synthetic-acceptance-length L (the synthetic method) gives a benchmark-only mode, the equivalent of vLLM's probabilistic draft sampling with synthetic rejection; for DSPARK it also turns on sampled Markov drafting. Unlike block, it needs --sampling-backend flashinfer. The drafter still samples: the full-vocabulary draft logits (and DSpark's Markov steps) and the recorded fp32 draft probabilities all stay on the path. Verify gathers those probabilities and runs the standard draft-probability chain rule for its cost; the synthetic length then replaces its outcome, as in the preceding greedy synthetic mode. The block verifier itself is not run because synthetic rejection replaces it. The token at the cutoff is drawn from the target probabilities at that position (the argmax for greedy requests); this costs one full-vocabulary pass per request. Do not use generated text for correctness or accuracy evaluation; validate the algorithm and its natural acceptance length without this flag. Full-vocabulary draft gathering, probability storage, and verification reductions all add work; measure their cost and natural acceptance length before drawing performance conclusions.