Repository navigation
(feat): Add MiMo v2.6 Flash DP Attention Support - #35
Merged
sammysun0711 merged 17 commits intoNov 2, 2026
Merged
Conversation
Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Enable PyNccl for DP attention reductions and LM-head gathers. - Include attention TP groups in graph capture without duplicate entries. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Keep draft projections, sampling and graph batches within attention TP. - Let idle DP groups join target collectives and defer eager verify planning. - Require DP LM head and reject DP with CP or TBO. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Shard image and video encoding while preserving order and empty-rank output shapes. - Forward vision attention windows and sinks to AITER. - Synchronize DP attention SHM consumers before unlinking features. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Normalize unindexed devices before checking buffer reuse. - Preserve explicit indices, CPU pinning and capacity growth. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Resolve dense-draft placement once and restore target parallel state. - Align model loading, forwards and graph setup with the draft group. - Keep seed broadcasts tied to world ranks. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Price draft KV from its actual dtype, layers and attention TP width. - Include padding pages in standard and hybrid-SWA pool sizing. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Defer DP verify planning and preserve embedding shard semantics. - Account for cached embeddings and initialize idle mRoPE positions. - Initialize runtime buffers independently of optional mask files. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Add a draft-only graph toggle while retaining target graphs. - Apply the low-memory guard on HIP and report draft graph mode. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Honor the full-decode selector and warm qlen1 before graph capture. - Reuse DFlash workspaces and slice page tables to active batch rows. - Validate with 25 targeted decode, context-length, and graph cases. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Zero V lanes beyond the final page's valid KV length. - Prevent zero-probability NaN contamination while preserving valid NaNs. - Validate with 15 BF16/FP8, partial-page, and long-context GPU cases. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Fuse selected-logit weighting and stable normalization into one Triton kernel. - Preserve FP32 weights, scaling, and NaN behavior behind the opt-in ROCm flag. - Add AMD CI coverage for strides, extreme logits, and updated-input graph replay. Validation: 33 GPU tests pass in a clean checkout. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Convert the SWA token interval to iterations using the DFlash block size. - Preserve overlap guards and eviction boundaries behind an opt-in flag. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Reduce register pressure while preserving V-tail masking. - Cover penultimate query tiles and mixed partial-page batches. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
- Combine DP attention and the FlyPA tail-mask repair with PR #34. - Retain native MXFP4 A16W4/A8W4 MoE support. Signed-off-by: Xiake Sun <xiake.sun@amd.com>
sammysun0711
force-pushed
the
feat/mimo-flash-dp-attention
branch
from
November 2, 2026 07:13
167d12e to
e4080a1
Compare
sammysun0711
marked this pull request as ready for review
November 2, 2026 07:31
There was a problem hiding this comment.
🟡 Changes recommended
Missing test registration and a pytest entry point block CI collection, while the benchmark calls a nonexistent analyzer and a valid DFlash configuration can crash.
5 open issues
What changed in this PR
Adds MiMo V2.6 Flash data-parallel attention support on gfx942, combining global TP8 with two attention TP4 groups and DFlash speculative decoding.
Changes:
- Isolates draft execution groups, accounts for draft KV memory, and handles idle attention replicas and graph capture.
- Updates FlyDSL decode dispatch and FlyPA tail masking, with optional router fusion and sliding-window eviction tuning.
- Adds regression tests, deployment launchers, and prefill/decode benchmarking guidance.
| File | Description |
|---|---|
test/registered/unit/spec/test_dflash_swa_eviction_interval.py |
Tests eviction timing and live-page preservation. |
test/registered/unit/layers/moe/test_mimo_stable_router_weights.py |
Tests fused router numerics and graph replay. |
test/registered/attention/test_mimo_flypa_nan_tail.py |
Tests masking of unused KV tails containing NaNs. |
test/registered/attention/test_mimo_flydsl_full_decode.py |
Tests FlyDSL decode correctness, warmup, and replay. |
test/registered/attention/test_aiter_mimo_vectorized_5d.py |
Extends decode dispatch and compilation coverage. |
python/sglang/srt/speculative/draft_parallel.py |
Resolves draft placement and isolates execution state. |
python/sglang/srt/speculative/dflash_worker_v2.py |
Integrates attention-local drafts, memory budgeting, and idle handling. |
python/sglang/srt/speculative/dflash_info.py |
Supports verification padding and deferred metadata initialization. |
python/sglang/srt/speculative/dflash_info_v2.py |
Normalizes device identity for reusable buffers. |
python/sglang/srt/speculative/dflash_dp.py |
Gathers embeddings when collectives would cross independent drafts. |
python/sglang/srt/models/mimo_vl.py |
Exposes vision output dimensions. |
python/sglang/srt/models/mimo_v2.py |
Enables data-parallel image and video encoding. |
python/sglang/srt/models/dflash.py |
Declares the draft’s single-group execution layout. |
python/sglang/srt/model_executor/runner/decode_cuda_graph_runner.py |
Reformats an existing graph configuration call. |
python/sglang/srt/model_executor/pool_configurator.py |
Includes draft KV and fixed allocations in pool sizing. |
python/sglang/srt/model_executor/model_runner.py |
Stores draft configuration, layout, and memory budget. |
python/sglang/srt/model_executor/forward_batch_info.py |
Initializes empty multimodal positions for idle batches. |
python/sglang/srt/mem_cache/draft_kv_budget.py |
Calculates draft KV memory from its attention geometry. |
python/sglang/srt/managers/tp_worker.py |
Uses the world-group rank for seed broadcasts. |
python/sglang/srt/managers/scheduler_components/request_receiver.py |
Synchronizes shared-memory consumers within attention groups. |
python/sglang/srt/managers/schedule_batch.py |
Adds block-aware DFlash eviction intervals. |
python/sglang/srt/layers/moe/topk.py |
Adds opt-in fused stable router weights. |
python/sglang/srt/layers/moe/stable_router_weights.py |
Implements stable selected-expert weights in Triton. |
python/sglang/srt/layers/attention/vision.py |
Forwards window and sink parameters to attention. |
python/sglang/srt/layers/attention/flydsl_pa.py |
Masks unused V tails and adjusts tile scheduling. |
python/sglang/srt/layers/attention/aiter_utils.py |
Shares FlyDSL decode/verification handling and adds warmup. |
python/sglang/srt/layers/attention/aiter_backend.py |
Prepares ordinary decode alongside speculative verification. |
python/sglang/srt/environ.py |
Adds eviction and draft graph controls. |
python/sglang/srt/distributed/parallel_state.py |
Supports attention-group capture and isolated draft groups. |
python/sglang/srt/configs/draft_parallel.py |
Defines draft execution and placement metadata. |
python/sglang/srt/arg_groups/speculative_hook.py |
Permits DFlash DP attention with configuration constraints. |
evaluation/run_benchmark_mimo_pro_prefill.sh |
Adds benchmark matrices, dataset overrides, and failure reporting. |
evaluation/mimo_v26_flash/mimo-v2.6-flash-mopd-evaluation-guide.md |
Documents DP-attention deployment and benchmark procedures. |
evaluation/mimo_v26_flash/launch_mimo_v26_flash_dp2_tp8_ep1_dpa_decode_fake_prefill_baseline.sh |
Adds a TP8 DP-attention fake-prefill decode launcher. |
evaluation/mimo_v26_flash/launch_mimo_v26_flash_dp2_tp8_ep1_dpa_accuracy_baseline.sh |
Adds a DP-attention accuracy launcher with optional vision DP. |
evaluation/mimo_v26_flash/launch_mimo_v26_flash_dp2_tp4_ep1_dflash_decode_fake_prefill_baseline.sh |
Adds native MXFP4 recipe selection. |
evaluation/benchmark_sglang_prefill.sh |
Adds a fixed-concurrency prefill benchmark matrix. |
evaluation/bench_sglang_prefill_sweep.sh |
Adds request-rate tuning against a target first-token latency. |
Review effort: Balanced
sammysun0711
force-pushed
the
feat/mimo-flash-dp-attention
branch
from
November 2, 2026 07:40
e4080a1 to
1e843cb
Compare
Signed-off-by: Xiake Sun <xiake.sun@amd.com>
sammysun0711
force-pushed
the
feat/mimo-flash-dp-attention
branch
from
November 2, 2026 07:43
1e843cb to
349c046
Compare
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.



Motivation
Enable MiMo-V2.6-Flash on gfx942 DP Attention (DPA) support with global TP8, DP2 attention (two TP4 groups), EP1 and DFlash speculative decoding based on upstream DP attention support for DFlash
Modifications
Based on upstream for DP attention support with DFlash
--enable-dp-attention,--enable-dp-lm-headfor attention-TP collectives and graph capture, draft placement, idle-DP handling, and draft KV budgeting/graph controls.--mm-enable-dp-encoder(not enabled by default)SGLANG_MIMO_FUSED_STABLE_ROUTER_WEIGHTSand SWA eviction tuningSGLANG_DFLASH_SWA_TOKEN_INTERVAL, default off.Accuracy Tests
Launch server
Run evalscope GSM8K accuracy verification
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci