Repository navigation
[rl] SGLang generator: MTP speculative decoding for Qwen3.5 - #6414
felipemello1 wants to merge 4 commits into
Conversation
SGLangEngine.Config.num_speculative_tokens turns the checkpoint's MTP head into an SGLang draft model (NEXTN, topk 1, rejection sampling, FlashInfer draft attention). GDN verify rows run SGLang's conv update and ReplaySSM recurrence on TorchTitan's state pool; the draft shares the model's embedding and LM head. - registry.py: the draft's config parse goes to SGLang's HF parser; patches for the draft runner's GDN backend and SGLang's ReplaySSM gate, each with a TODO. - engine.py: raises for untested setups (MoE, KDA, no GDN layers, another checkpoint architecture), enable_mixed_chunk and k > 5; RoPE caches CONTEXT_LENGTH_MARGIN rows longer with drafts; after the build, raises if SGLang built no ReplaySSM rings or keeps fewer running requests than asked. - generator/tokens_per_verify_step metric. - tests/rl/unit_tests/gpu/test_sglang_mtp.py, run in the B200 SGLang CI step.
|
Reply from claude: @claude please review |
|
Claude finished @felipemello1's task in 6m 1s —— View job Needs discussion: the maintainers need to decide whether the draft should be SGLang's own frozen MTP class or TorchTitan's MTP module; the other items are mechanical. Review |
There was a problem hiding this comment.
Verdict: Needs discussion -- the draft is SGLang's own frozen Qwen3.5 MTP class wired in through three patches of SGLang internals, not TorchTitan's MTP module. Maintainers need to make that call for both engines (this PR and the vLLM stack, #6287). The other items are mechanical.
What this PR does. It adds SGLangEngine.Config.num_speculative_tokens. With k > 0, SGLang builds its Qwen3.5 MTP model from the checkpoint's mtp.* weights as an EAGLE-chain draft, sharing TorchTitan's embedding and LM head. TorchTitan's model checks the drafts with rejection sampling. GDN verify rows run SGLang's conv-update and ReplaySSM kernels on TorchTitan's state pool. Unified memory is off with drafts, and many unsupported setups raise.
Example.
SGLangEngine.Config(num_speculative_tokens=3, cuda_graph="breakable")
before: 1 token per request per decode step
after: the draft proposes 3 tokens -> 4 verify rows -> 1-4 tokens per step
(27B agent load: 1,327 -> 1,929 tok/s, one run per arm)
GDN decode now runs SGLang's kernels, not Attention Gym's (not bitwise vs the trainer)
the draft's own mtp.* layer keeps the checkpoint weights while the policy trains
Must fix
-
Draft design (gate, maintainer call). Training and inference are supposed to share modules (
rules/models.md), andmodels/common/mtp.pyalready exists for DeepSeek. Here the draft is an SGLang-only model whose weights never follow the policy, sogenerator/tokens_per_verify_stepexists to watch acceptance decay. A TorchTitan-native draft (Qwen3.5 MTP built onmodels/common/mtp.py, served bySGLangModelWrapper) would delete:- the draft config-parse branch (
registry.py:358) and the reserveddecrypted_*_config_filekeys; _MTP_DRAFT_ARCHITECTURESand theconfig.jsonarchitecture check;- the aliasing of SGLang's draft embedding and LM head onto TorchTitan's (
get_embed_and_head), and probably_patch_draft_gdn_attention_backend; - the FlashInfer/
nvccbuild-time dependency.
The draft would also stay in sync with the policy after each weight load. It has real costs: SGLang's draft-worker API, and Qwen3.5 has no MTP in TorchTitan today. So please add a paragraph to the PR on why that can't work or is deferred, and the maintainers decide. The vLLM stack (#6287) makes the same choice, so whatever they decide applies to both engines.
- the draft config-parse branch (
-
engine.py:402-425-- patches the finished model config in the constructor. Fold it into_replace_sglang_layer_configsand apply it for every k, which leaves numerics unchanged (inline). -
gdn.py:238-- the Attention Gym verify-kernel gap needs aTODOwith an upstream link (inline). -
registry.py:196,228,361-- the SGLang TODOs need the filed issue links (inline). -
gdn.py:256--BandJare missing from the file's shape legend (inline). -
test_sglang_mtp.py:62-- the test imports another module's private_load_trainer_weights(inline).
Should consider
dispatcher.py:416-- tokens from a retracted request's second prefill may be counted as verify tokens (unverified, inline).
Questions
engine.py:695(your open question): raising when SGLang keeps fewer running requests thanmax_num_seqsfollows "errors over warnings" for every k. But at k = 0 that turns a working setup that only warns into a raise, so it's a maintainer call. I'd do it in its own PR.- Second-turn greedy argmax gap: 0.183 with drafts vs 0.039 without, while the mean |delta| stays the same. When a request finishes after verify steps, does the radix cache store the state with the ReplaySSM ring folded in (
cache_finished_req)? The unchanged mean suggests it does. Please confirm.
Details
- Overlap search:
MTP,SGLang generator. Found the vLLM MTP stack (#6287, #6364, #6402, #6403, #6365, #6366) and the SGLang PRs that edit the same files (#6318, #6200, #6021, #6379, #6018, #6413). All are already listed in the description; whichever PR lands second rebases. linear_attention.py:189: removing the verifyNotImplementedErroris safe. The only way into verify isnum_speculative_tokens, sinceextra_server_argsrejects everyspeculative_*key, and KDA layers raise at engine build.- RoPE:
max_context_lengthfeeds onlytorch.arange(...)in every RoPE variant, and the caches arepersistent=False(rope.py:198). So extending them never changes existing rows or checkpoints. - Build-time validation in
__init__(parallelism, model layers, debug, checkpoint) is fine where it can't be in__post_init__: those are build arguments, not fields ofSGLangEngine.Config.
Not verified: SGLang internals (hybrid_gdn_config uses being gated on the ReplaySSM flag, select_verify_intermediate_state_indices semantics, spec_verify_ct on retraction). The SGLang source was not available here, and the GPU tests were not run.
Before merge: fill in the human-written summary.
| # A verify step runs each request's drafts after its last token, so a request | ||
| # near max_context_length runs positions past it (SGLang's context is | ||
| # CONTEXT_LENGTH_MARGIN tokens longer). Their tokens are cut, but their RoPE | ||
| # lookups must stay inside the caches. | ||
| layers = [] | ||
| for layer in model.layers: | ||
| attention = layer.attention | ||
| # Softmax attention layers with RoPE: GDN layers (LinearAttention) have | ||
| # none. | ||
| if ( | ||
| isinstance(attention, Attention.Config) | ||
| and not isinstance(attention, LinearAttention.Config) | ||
| and attention.rope is not None | ||
| ): | ||
| rope = dataclasses.replace( | ||
| attention.rope, | ||
| max_context_length=attention.rope.max_context_length | ||
| + CONTEXT_LENGTH_MARGIN, | ||
| ) | ||
| layer = dataclasses.replace( | ||
| layer, attention=dataclasses.replace(attention, rope=rope) | ||
| ) | ||
| layers.append(layer) | ||
| model = dataclasses.replace(model, layers=layers) |
There was a problem hiding this comment.
This patches the finished generator model config in the engine constructor, which rules/config.md rules out ("Don't patch a finished config tree at runtime"). It also walks the layers a second time, after the walk that _replace_sglang_layer_configs (model_wrapper.py:60) already does to swap each layer's inner attention.
Smaller fix: in the softmax-attention branch of _replace_sglang_layer_configs (model_wrapper.py:168-182), also replace attention_cfg.rope with max_context_length + CONTEXT_LENGTH_MARGIN when it is not None, and do it for every k. That doesn't change numerics. RoPE caches read max_context_length only as the arange length (rope.py:312,474,524,614), and the cache is a non-persistent buffer. It also matches SGLang's context, which is already max_context_length + CONTEXT_LENGTH_MARGIN for every k (registry.py:83, engine.py:579). registry.py imports model_wrapper only lazily, so model_wrapper can import the constant at top level. This deletes this 20-line k > 0 branch.
There was a problem hiding this comment.
Reply from claude: Done in ef2eef3. _replace_sglang_layer_configs now gives every softmax layer's RoPE cache CONTEXT_LENGTH_MARGIN more rows, for every k. The engine no longer patches the built config. Configs without a rope field (Kimi K3's MLA) are left alone.
The existing rows keep their values: on Qwen3.5-0.8B's generator config, a cache built 6 rows longer matches the old one bitwise on its first 4,096 rows, on CPU and CUDA. test_sglang_mtp.py prints the same numbers as before (7 passed).
| commit: ring [t1 t2 x d1]; conv history <- the window after d1 | ||
|
|
||
| Each row's conv window goes to the request's scratch row, which the commit | ||
| reads. Attention Gym has no verify kernels, so these are SGLang's. |
There was a problem hiding this comment.
This is a workaround for a gap in a PyTorch library (Attention Gym is meta-pytorch), and it is the reason trainer and generator GDN decode numerics now differ with drafts. Principle 3 asks for a TODO with an upstream issue link here, e.g. TODO(<attention-gym issue>): run verify rows on Attention Gym's GDN kernels once it has a multi-token verify kernel, so trainer and generator share them.
There was a problem hiding this comment.
Reply from claude: Added in ef2eef3, at the top of _forward_target_verify. No Attention Gym issue exists yet, so the TODO has no link. The link goes in once one is filed.
| # ======== Convolution ======== | ||
| # SGLang's kernel takes [C, W - 1] conv histories with contiguous channels: | ||
| # transposed views of the pool's [W - 1, C]. | ||
| convolved_BCJ = causal_conv1d_update( |
There was a problem hiding this comment.
The file legend (line 9) defines T, C, H, V and W only. B and J aren't defined, and the shape-suffix rule needs one legend per file. Add them to the legend at the top, e.g. B = requests of a verify step, J = tokens per request (k + 1).
There was a problem hiding this comment.
Reply from claude: Done in ef2eef3. The legend now ends: "in an MTP verify step, B = requests and J = tokens per request (drafts + 1)."
| if "_configuration_file" in kwargs: | ||
| # Only an MTP draft's parse carries a config file (SGLangEngine sets | ||
| # decrypted_draft_config_file): the draft is SGLang's own model class. | ||
| # TODO: drop this branch once SGLang can give a draft its own config |
There was a problem hiding this comment.
This TODO and the two at lines 196 and 228 wait on SGLang changes but have no issue links. The description says the issues are drafted, not filed. File them and put the links in the three TODOs, as the other SGLang workarounds in this package do (e.g. TODO(https://github.com/sgl-project/sglang/issues/48474)). This branch also probes SGLang's kwargs (_configuration_file) to find out which parse it is in, so the issue link is what tells a reader when the probe can go.
There was a problem hiding this comment.
Reply from claude: The three SGLang issues are written, each with a repro at the pinned SGLang and a check of SGLang main. They are in review before filing. Their links go into these three TODOs once filed.
There was a problem hiding this comment.
Reply from claude: The three SGLang issues are now drafted on Felipe's SGLang fork, for his review:
registry.py:196(no linear attention backend for an MTP draft): felipemello1/sglang issue 4.registry.py:228(ReplaySSM gate for registered models): felipemello1/sglang issue 5.registry.py:361(a draft's own config parser): felipemello1/sglang issue 3.
The code keeps plain TODOs for now. When Felipe files them on SGLang's tracker, each TODO gets that upstream issue's link.
| from torchtitan_recipes.rl.model_configs import build_rl_model_configs | ||
|
|
||
| from tests.rl.unit_tests.gpu.test_bitwise_parity import build_trainer_model | ||
| from tests.rl.unit_tests.gpu.test_sglang_bitwise_parity import _load_trainer_weights |
There was a problem hiding this comment.
This imports another module's _private name, which CLAUDE.md (Naming) rules out. Now that a second module uses it, rename it to load_trainer_weights in test_sglang_bitwise_parity.py and import that.
There was a problem hiding this comment.
Reply from claude: Done in ef2eef3. load_trainer_weights is now public in test_sglang_bitwise_parity.py, and both test files call it by that name.
| "generator/inter_token_latency_ms" | ||
| ] = first_to_last_token_ms / (inputs.num_generation_tokens - 1) | ||
|
|
||
| if inputs.num_verify_steps > 0: |
There was a problem hiding this comment.
Should consider (unverified): a retracted request prefills again and samples one more token in that prefill. If SGLang's spec_verify_ct survives the retraction, this counts those tokens as verify tokens. In RL with reset_kv_cache_on_model_state_dict_load, every weight load retracts every running request. (num_generation_tokens - 1 - num_preemptions) / num_verify_steps would remove the bias, if SGLang works the way I think. Please check Req.reset_for_retract at the pinned SGLang.
There was a problem hiding this comment.
Reply from claude: Confirmed at the pinned SGLang, and fixed in ef2eef3.
spec_verify_ctis set to 0 once, when the request is made (schedule_batch.py:761).reset_for_retractdoes not reset it, and keepsoutput_ids.- Each verify step adds 1 (
batch_result_processor.py:924).
So each retraction adds one prefill token. The metric is now (num_generation_tokens - 1 - num_preemptions) / num_verify_steps, where num_preemptions is SGLang's retraction_count. test_tokens_per_verify_step gains a case: 9 tokens, 2 preemptions, 4 verify steps -> 1.5.
…ps re-prefill tokens - model_wrapper: _replace_sglang_layer_configs gives softmax layers' RoPE caches CONTEXT_LENGTH_MARGIN more rows, for every k; MLA configs without RoPE (Kimi K3) are left alone. The engine no longer patches the built config. - engine: TODO for a TorchTitan Qwen3.5 MTP draft. - dispatcher: tokens_per_verify_step drops one prefill token per preemption. - gdn: B and J in the legend; TODO for an Attention Gym verify kernel. - tests: load_trainer_weights is public; a preemption case for the metric.
|
Reply from claude: The fixes for the review are in ef2eef3. Answers to the two questions:
Draft design: the body now has a "Why SGLang's Qwen3.5 MTP model as the draft" item, and |
|
Reply from claude: @claude please review |
|
Claude finished @felipemello1's task in 2m 39s —— View job Needs discussion: the maintainers still need to decide on the draft design (SGLang's own frozen MTP class or TorchTitan's MTP module); the other earlier items are resolved except the missing upstream issue links. Review |
There was a problem hiding this comment.
Verdict: Needs discussion -- the maintainers still have to decide whether the draft can be SGLang's own frozen Qwen3.5 MTP class, wired in through patches of SGLang internals, or must be a TorchTitan module. That decision covers the vLLM stack (#6287) too. The rest is mechanical or resolved.
What this PR does. It adds SGLangEngine.Config.num_speculative_tokens. With k > 0, SGLang builds its Qwen3.5 MTP draft from the checkpoint's mtp.* weights, using TorchTitan's embedding and LM head. TorchTitan's model checks the drafts with rejection sampling, and GDN verify rows run SGLang's conv-update and ReplaySSM kernels on TorchTitan's state pool. Since the last review, the RoPE margin moved into _replace_sglang_layer_configs for every k, and the verify-step metric no longer counts the extra prefill token after a preemption.
Example.
SGLangEngine.Config(num_speculative_tokens=3, cuda_graph="breakable")
before: 1 token per request per decode step
after: 3 drafts -> 4 verify rows -> 1-4 tokens per step
RoPE caches: max_context_length + 6 rows for every k (existing rows unchanged, non-persistent)
generator/tokens_per_verify_step = (tokens - 1 - preemptions) / verify steps
e.g. 9 tokens, 2 preemptions, 4 verify steps -> 1.5
Earlier must-fix items
- Resolved: the RoPE config patch in the engine (now in
model_wrapper.py:169-181), theB/Jshape legend, the private_load_trainer_weightsimport, and the preemption bias in the verify-step metric (dispatcher.py:416). - Still open: draft design (maintainer call). The new "Why SGLang's Qwen3.5 MTP model" paragraph and the TODO at
engine.py:980state the trade-off. Only a maintainer can make the call. - Still open: the upstream TODOs at
gdn.py:662(Attention Gym) andregistry.py:1120,1152,1198(SGLang) still have no issue links. This is mechanical once the issues are filed.
Should consider
- #6417 ("decode CUDA graphs up to max_num_seqs", opened after this PR's description was written) sets
cuda_graph_config["decode"]["max_bs"] = max_num_seqsinengine.py. With drafts, SGLang captures the verify graphs on that same decode runner at k + 1 tokens per request, so the largest verify graph would grow to 4 xmax_num_seqstokens. Whichever PR lands second should check that capture memory and build time still fit, or capmax_bswhen drafts are on. #6419 addsRequestMetricsInputsfields and dispatcher metrics next tonum_verify_steps, so it needs a rebase too.
Details
- Re-review scope: c84ca4d (test comments only) and ef2eef3 (the fixes). I re-read the full diff at ef2eef3.
- RoPE margin for every k:
max_context_lengthonly sets thearangelength in every RoPE variant (rope.py:312,474,524,614). The cache ispersistent=False(rope.py:198). Scaling is a separate field, and the vision RoPE__post_init__s don't read the length. So k = 0 numerics and checkpoints don't change.getattr(attention_cfg, "rope", None)is needed:ropesits onGQAttention.Configand the per-model subclasses, not onAttention.Config, andKimiMLAAttention.Config(kimi_k3/attention.py:51) has none. Nothing else intorchtitan/rlreadsrope.max_context_length. model_wrapper.pynow importsCONTEXT_LENGTH_MARGINfromregistry.pyat module level.registry.pyhas no top-level import ofmodel_wrapper, so there is no cycle.- Overlap search:
MTP,SGLang generator. Found the vLLM MTP stack (#6287, #6364, #6365, #6366, #6402, #6403), the PRs already listed in the description (#6018, #6021, #6200, #6318, #6379, #6413, #6415), and #6417, #6418, #6419 (all opened 2026-11-27, after the description). #6418 editsengine.pyand the parity test.
Not verified: SGLang internals (reset_for_retract keeping spec_verify_ct, the ReplaySSM gate's uses); the SGLang source isn't available here. GPU tests were not run.
Before merge: fill in the human-written summary.
Summary (human-written)
Agent details
TLDR:
SGLangEngine.Config(num_speculative_tokens=3)turns the checkpoint's MTP head into a draft model for Qwen3.5 (GDN) generators. On Qwen3.5-27B (one GB300), it gives 1.45x the output tokens/s of no drafts on a multi-turn agent load. On the same load it is 1.05x the vLLM engine with MTP-3 (the open vLLM MTP stack at its top, one run per arm), though by each engine's own count vLLM holds 1.77x the KV tokens. Both engines give KV and GDN states about the same memory (see Results). The output follows the model's distribution (rejection sampling), and the logprobs are the model's.Problem
mtp.*weights), and SGLang can run it as a draft model for its own Qwen3.5 class.Solution
SGLangEngine.Config.num_speculative_tokens(the vLLM engine's name). With k > 0 the engine sets SGLang's draft server args;extra_server_argscannot set anyspeculative_*key.TorchTitanGDNAttnBackend._forward_target_verifyruns the verify rows of GDN layers with SGLang's two kernels: the conv update, then the ReplaySSM recurrence. ReplaySSM keeps, per request, a ring of the accepted tokens' records over the state slot, and SGLang's commit folds it. This needs no per-draft state copies.SGLangModelWrapper.get_embed_and_headshares the embedding and LM head with the draft, so model state dict loads reach it.registry.pyroutes the draft's config parse to SGLang's HF parser and patches two SGLang internals: the draft runner gets TorchTitan's GDN backend, and SGLang's ReplaySSM gate acceptsTorchTitanGDNConfig.CONTEXT_LENGTH_MARGIN(6) more rows, for every k, because verify rows nearmax_context_lengthrun positions past it. After the build, the engine raises if SGLang built no ReplaySSM rings, or keeps fewer running requests thanmax_num_seqs.Results
Numerics: Qwen3.5-0.8B,
test_sglang_mtp.py(16 prompts of 1,024 tokens of TorchTitan's RL docs, one GB300). The reference is the TorchTitan trainer on [prompt + completion].A sampler that favors the draft's tokens fails the log p + H check: greedy outputs score +0.25, 39 standard errors.
Speed (measured on main at bb79a81): Qwen3.5-27B, one GB300, TP 1, bf16. Agent load: 54 sessions in groups of 9 on a 27,000-token shared prompt, 100-1,500 output tokens per turn, 200-1,100-token tool replies after a ~1 s wait, sessions end at 30K-60K tokens, temperature 1, text from a 3.1M-token corpus of TorchTitan files.
max_num_seqs64,gpu_memory_limit0.85, 150 s window after 90 s warmup. One run per arm.The vLLM arms run the open vLLM MTP stack at its top, dc7d9c3: "MTP speculative decoding in the vLLM generator", then "MTP verify steps: verify rows on FA4's decode kernel, piecewise graphs for steps with prefill", "MTP: replay the verify CUDA graph only when every row verifies" and "MTP on GDN models: FULL CUDA graphs for steps with prefill" (with its fp8 KV parent; KV stays bf16 here). vLLM runs
cuda_graph.mode="FULL"with its session KV holder; SGLang runscuda_graph="breakable".KV tokens are each engine's own count, and they count different things. Without drafts, both engines give KV and GDN states about the same memory: SGLang's pool is 180.80 GiB, vLLM's 175.85 GiB.
max_total_num_tokens. Without drafts, KV and GDN states share one pool (unified memory). This count is the KV share thatmamba_full_memory_ratio(0.9) gives on paper; at run time the two share the bytes, and the pool holds 2,962,229 tokens if all of it holds KV. With drafts, the count is a KV-only pool, and the states sit in a separate pool.num_gpu_blocks x block_size, the whole block pool counted as KV. Its GDN states take blocks from the same pool.Build with drafts: +56.8 s on SGLang (151.5 vs 94.7 s; not split by phase: the draft's model load, FlashInfer's kernels and the draft's CUDA graphs all add to it), +12.4 s on vLLM (97.6 vs 85.2 s).
The load is closed loop: a session sends its next turn only after its tool wait. So the faster arm holds fewer requests per step (23.2 rows per verify step vs 41.2 per decode step without drafts; 20 vs 36 sessions alive at the end). 1.45x is this load's speedup, not one at full batch.
The verify rules differ: SGLang's draft samples its tokens; vLLM's proposes its argmax. That shows in acceptance (3.09 vs 2.70).
SGLang's verify step: 27.5 ms (70% of the time), prefill steps 141.6 ms (30%).
Decode only (no prefill in the timed round): one 27,000-token cached prompt, 1,024 output tokens per request, temperature 1,
max_num_seqs32,gpu_memory_limit0.8. One run per arm.Memory: Qwen3.5-27B, one GB300,
gpu_memory_limit0.8, 256 running requests asked.Without drafts, the KV count is unified memory's KV share on paper: KV can also use the memory that no state uses. SGLang caps running requests at (state slots) / 5, with or without drafts, and only warns. With drafts this PR raises instead, so a run asks for fewer.
You may ask:
MTPDecoder(models/common/mtp.py) trains DeepSeek V3's MTP layers. A TorchTitan draft would drop most of the draft wiring inregistry.py. Its own layer would still keep the checkpoint's weights unless the trainer trains an MTP loss; the shared embedding and LM head already follow the policy. The vLLM MTP stack makes the same choice. A TODO inengine.pymarks it. Open question for review: land this draft now, and a TorchTitan draft later?NOTE:
Configis made: k > 5,enable_mixed_chunk(its mixed steps would decode running requests from stale GDN states), andspeculative_*keys inextra_server_args. Raises at engine build with drafts: TP > 1, DP > 1, SGLang's hierarchical cache, MoE or KDA layers, a model without GDN layers, batch-invariant mode, and a checkpoint withoutmtp.*weights or of another architecture than SGLang's Qwen3.5 MTP draft takes. None of these has run with drafts.generator/tokens_per_verify_step: the draft's own layers stay frozen while the policy trains, so acceptance can fall. It leaves out the tokens that prefills sample: the first, and one after each preemption. Its field,RequestMetricsInputs.num_verify_steps, is the one the vLLM MTP stack's TODO asks for ("Needs new RequestMetricsInputs fields"), so vLLM can fill it too.TestSGLangMTPFp8KVCache(this test withkv_cache_dtype="fp8", about 40 lines, no production code). The two compose with no code change.gdn.py,linear_attention.py;engine.py,linear_attention.py. It lifts the raise that makes GDN models usecuda_graph="breakable". No run has used full prefill graphs with drafts, so the rebase onto it addscuda_graph="full"to the drafts' untested list;engine.py,registry.py,model_wrapper.py;engine.py;RequestMetricsInputsand the dispatcher;engine.py. With drafts, SGLang captures the verify graphs on the same decode runner at k + 1 tokens per request, so the largest verify graph holds 4 xmax_num_seqstokens at k = 3. The second to land checks capture memory and build time, or caps the graph batch size with drafts;engine.pyand the parity test;gdn.py,linear_attention.py._replace_sglang_layer_configsonly makes the RoPE caches longer (2,048 to 2,054 rows; Kimi K3's MLA layers have none). A cache 6 rows longer keeps its first rows bitwise, on CPU and CUDA. The B200 job runs those classes.test_sglang_mtp.py. FlashInfer and SGLang's verify sampler compile their kernels at engine build. The job's image,nvidia/cuda:13.0.3-cudnn-devel, hasnvccand the CUDA headers. The job runs only on pytorch/torchtitan, so the first signal comes from this PR'sciflow/b200run upstream. If FlashInfer fails there, the fallback is the Triton draft attention: 1,672.4 tok/s on the agent load (a prototype of this PR) vs 1,929.3.registry.py(the draft runner's GDN backend, the ReplaySSM gate, the draft's config parse keyed ondecrypted_draft_config_file). Each has a TODO that says what to drop and what SGLang change it waits for. The SGLang issues are drafted, not filed; their links go into the TODOs once filed.Test plan