Skip to content

[TRTLLM-14093][feat] Eagle3 for M3 non-MSA path + overlap scheduler compatibility - #2

Merged
zheyuf merged 1 commit into
brb-nv:feat/branch_m3from
zheyuf:feat/m3-eagle3-brb-port
Jul 9, 2026
Merged

[TRTLLM-14093][feat] Eagle3 for M3 non-MSA path + overlap scheduler compatibility#2
zheyuf merged 1 commit into
brb-nv:feat/branch_m3from
zheyuf:feat/m3-eagle3-brb-port

Conversation

@zheyuf

@zheyuf zheyuf commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Squashed, re-validated port of NVIDIA#16021 onto feat/branch_m3: one-model Eagle3 speculative decoding for MiniMax-M3 on the reference (non-MSA) sparse backend, pairing with the Inferact/MiniMax-M3-EAGLE3 draft head.

Measured on this commit (4xB200, NVFP4 tp4/ep4, max_draft_len=3, overlap scheduler on, eager):

MMLU GSM8K Acceptance rate Acceptance length
test_nvfp4_eagle3[attention_dp=False-overlap_scheduler=True] 85.23 90.49 0.682 3.047
test_nvfp4_eagle3[attention_dp=True-overlap_scheduler=True] 84.80 90.75 0.731 3.194

(Reference thresholds 83 / 88; non-spec baselines 85.11 / 91.32 — accuracy-neutral.)

Batch-1 greedy throughput: 6.05 -> 17.05 tok/s (2.82x).

Limitations

  1. The MSA kernel path does not yet handle multiple query tokens per generation step, so speculative decoding with sparse_use_msa=True is rejected at creation time; Eagle3 currently runs on the reference (non-MSA) sparse backend. Multi-token support in the MSA decode driver is the follow-up that would lift this (the underlying kernel's pack factors already allow qo_len <= 32).
  2. The drafter uses the V1 KV cache manager: the Eagle3 head is a dense Llama model, which resolves to V1 by default (the M3 target stays on its V2 sparse manager). Switching the drafter to V2 via use_kv_cache_manager_v2=True is mechanically supported by the dummy-request dispatch but not yet validated for MiniMax-M3. V1 vs V2 for the drafter is not expected to make a performance difference.
  3. CUDA graphs are not supported with speculative decoding and are rejected at creation (cuda_graph_config must be null with Eagle3; all numbers above are eager): multi-token verify routes through the M3 extend path, which is not capture-safe yet (host-side reads in the dense-layer fallback). Non-speculative M3 keeps its existing CUDA-graph support. Likely follow-up paths: piecewise capture, or the multi-token MSA decode driver (which is already capture-safe by design).

@zheyuf
zheyuf force-pushed the feat/m3-eagle3-brb-port branch from 90be465 to aab4935 Compare July 9, 2026 06:40
… MiniMax-M3

Squashed port of feat/minimax-m3-eagle3 (PR NVIDIA#16021) onto feat/branch_m3.

Target-side enablement for the Inferact/MiniMax-M3-EAGLE3 draft head on
the reference (non-MSA) sparse backend:

- Wire MiniMaxM3ForCausalLM as SpecDecOneEngineForCausalLM and capture
  Eagle3 aux hidden states at layer exit (fully TP-reduced; no
  cross-layer allreduce+norm fusion).
- Rebase MiniMaxM3AttentionMetadata onto TrtllmAttentionMetadata (the
  shared per-step metadata is consumed by TRTLLM draft layers, the
  Eagle3 one-model worker, and engine isinstance gates; precedent: DSA
  and the M3 MSA metadata).
- Route multi-token generation rows (spec verify: 1 + draft_len tokens)
  through the extend path; the decode branch stays reserved for
  batches where every row appends exactly one token.
- Vectorized sync-free builder shared with a new on_update_kv_lens
  hook that re-derives seq_lens/prefix_lens/q_positions/out_cache_loc
  on device from the corrected kv_lens_cuda under overlap scheduler +
  spec (DSA pattern); in-bounds clamps cover the optimistic
  page-boundary overhang (max_seqlen_k SDPA width + slot gathers).
- V1-family draft manager support in KVCacheManagerV2.add_dummy_requests
  (exception-safe); attention-DP dummy requests register in the draft
  manager; MiniMaxM3KVCacheManagerV2 opts out of shared draft layers
  under attention DP (its AttentionOp tensors are synthetic).
- Creation-time guards: tree modes, disabled separate draft KV (disagg
  WAR), CUDA graphs, and MSA+spec (the in-builder MSA rejection is
  hoisted above routing so mixed batches cannot bypass it).
- Accuracy test test_nvfp4_eagle3 (MMLU + GSM8K + acceptance probe,
  attention_dp parametrized) + reference rows.

Validated on 4xB200 (NVFP4 tp4/ep4, draft_len=3, overlap scheduler on,
eager) at this commit:
- test_nvfp4_eagle3[attention_dp=False]: MMLU 85.50 / GSM8K 89.73
  (refs 83/88), acceptance rate 0.709 / mean acceptance length 3.126
- test_nvfp4_eagle3[attention_dp=True]: MMLU 85.14 / GSM8K 91.32,
  acceptance rate 0.767 / mean acceptance length 3.302
- batch-1 greedy: 6.05 -> 17.05 tok/s (2.82x)
- spec-off boot + generation clean (TRTLLM-Gen warmup now runs for M3
  and is harmless)

Signed-off-by: Zheyu Fu <zheyuf@NVIDIA.com>
@zheyuf zheyuf changed the title [TRTLLM-14093][feat] Enable one-model Eagle3 speculative decoding for MiniMax-M3 [TRTLLM-14093][feat] One-model Eagle3 initial support for MiniMax-M3 Jul 9, 2026
@zheyuf
zheyuf force-pushed the feat/m3-eagle3-brb-port branch from aab4935 to 448c489 Compare July 9, 2026 07:46
@zheyuf
zheyuf marked this pull request as ready for review July 9, 2026 07:52
@zheyuf
zheyuf merged commit 17c6968 into brb-nv:feat/branch_m3 Jul 9, 2026
30 checks passed
@zheyuf zheyuf changed the title [TRTLLM-14093][feat] One-model Eagle3 initial support for MiniMax-M3 [TRTLLM-14093][feat] Eagle3 support for MiniMax-M3 non-MSA path Jul 9, 2026
@zheyuf zheyuf changed the title [TRTLLM-14093][feat] Eagle3 support for MiniMax-M3 non-MSA path [TRTLLM-14093][feat] Eagle3 for M3 non-MSA path Jul 14, 2026
@zheyuf zheyuf changed the title [TRTLLM-14093][feat] Eagle3 for M3 non-MSA path [TRTLLM-14093][feat] Eagle3 for M3 non-MSA path + overlap scheduler compatibility Jul 14, 2026
@zheyuf
zheyuf deleted the feat/m3-eagle3-brb-port branch July 21, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant