Repository navigation
[None][fix] MiniMax-M3.1 DSpark AL parity: non-causal draft blocks + opt-in golden sampling - #21
Merged
zheyuf merged 2 commits intoOct 28, 2026
Conversation
DSpark drafters are trained with a non-causal block and a two-sided sliding window, but the drafter resolved every windowed layer as causal. GQA DSpark layers now resolve non-causal (W-1, W-1). trtllm-gen windows only causal attention, so the TRTLLM backend serves such a layer as the causal windowed decode, which also returns its log-sum-exp, plus a compiled merge of the block keys after each query. The workspace holds the softmax stats flashinfer carves off for the log-sum-exp. The window validator, which refused these layers, is removed. Based on efa53ad by Pranav Shrestha. Signed-off-by: Zheyu Fu <zheyuf@nvidia.com>
…ection sampling
The DSpark Markov head biases block position k by the token at position
k-1. With use_rejection_sampling the worker chained the bias through the
argmax and then sampled each position on its own, so once a draw left the
argmax, later proposals were conditioned on tokens the block does not
contain: lossless, but with lower acceptance from position 2 on.
Sampled DSpark drafts are now drawn ancestrally: position k from
softmax((base_k + bias(d_{k-1})) / T), d_{k-1} being the token drawn before
it, with the temperature only (vLLM's probabilistic drafting), and that
distribution is stored as its proposal. Greedy requests keep the greedy
sentinel temperature and draft the argmax chain.
Add rejection_sample_method ("standard" | "block", prototype, default
"standard"). "block" replaces the chain kernel of the one-model rejection
path with block verification (Sun et al., 2024, arXiv:2403.10444): lossless,
equal to the token-level rule for one draft, and the rule vLLM serves as
rejection_sample_method="block". It runs on static shapes without host
synchronization inside the CUDA graphs; its uniforms are a counter hash of
each request's acceptance-slot (seed, offset), and the emitted token is
drawn by the seeded sampler. Ragged (confidence-scheduled) steps keep
token-level verification.
Signed-off-by: Zheyu Fu <zheyuf@nvidia.com>
zheyuf
force-pushed
the
zheyuf/brb-dspark-al-parity
branch
from
October 28, 2026 03:38
a92f134 to
9e0edee
Compare
zheyuf
merged commit Oct 28, 2026
5c33ae3
into
brb-nv:user/brb/m3.1-flash-gb300-initial
5 of 8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brings the MiniMax-M3.1-Flash DSpark acceptance length (AL) on this branch to the SemiAnalysis golden. Two commits.
1. Non-causal DSpark draft blocks on TRTLLM (default path)
DSpark drafters are trained with a non-causal block and a two-sided sliding window, but the drafter ran every windowed layer causally.
(W-1, W-1).Based on Pranav Shrestha's efa53ad (
feat/minimax-m3.1-flashin NVIDIA/TensorRT-LLM; the same change is in NVIDIA#20922), with the compiled merge from NVIDIA#21130.2. Golden sampling semantics (opt-in, off by default)
With
use_rejection_sampling: true, DSpark draws its drafts ancestrally.softmax((base_k + bias(d_{k-1})) / T), whered_{k-1}is the token drawn before it. Drafts use the temperature only, like vLLM's probabilistic drafting. Greedy requests still draft the argmax chain.A new prototype field
rejection_sample_method: standard | block(defaultstandard) selects the verification rule.blockreplaces the chain kernel of the one-model rejection path with block verification (Sun et al., 2024). Ragged (confidence-scheduled) steps keep token-level verification.Nothing changes with the default
use_rejection_sampling: false. Withstandard, verification is unchanged, including the branch's native chain-sampling override. Upstream counterpart: NVIDIA#21085.Results
GB300, TP4 EP4: 80 SPEED-Bench coding prompts,
/v1/completions, T=1, top_p 0.95, 4096 tokens, 64 concurrent requests. Each AL cell is one to three passes.use_rejection_sampling: false)The step times are device-step medians from the iteration log, with acceptance forced to AL 3.6 and
use_rejection_sampling: false. They come from one server restart per arm, and restarts vary by about ±2% at B1/B8. Earlier runs of the same merge with 5-10 restarts per arm measured +0.9 / +0.2 / +0.4%.minimax_m31_nvfp4__sm_103__tp4(modeling_v2: require, TP4 EP1), golden K7: 4.045.Test Coverage
test_dspark_noncausal_window.py(GPU, SM100 family):test_dspark_sampling.py(CPU):test_dflash2_semantics.py: 43 passed.api_stability: 38 passed. The regenerated golden manifest matches, apart from the existinggvr_deterministic_topkdrift.cleanup_stale_prs.test.jsand every pre-commit hook pass on the changed files.scripts/release_check.pyalso runs bandit over the whole package. It reports 10 issues, all in files this PR does not touch (the branch head has the same 10). Bandit on the changed files reports none.PR Checklist
rejection_sample_methodis a new prototype LLM-args field; the golden manifest is updated.🤖 Generated with Claude Code