Skip to content

[Perf][ROCm][MiniMax-M3.1] Add opt-in parallel decode top-k - #65267

Merged
shen-shanshan merged 8 commits into
vllm-project:mainfrom
jiacao-amd:jiacao/minimax-m31-parallel-topk-main
Nov 6, 2026
Merged

shen-shanshan merged 8 commits into
vllm-project:mainfrom
jiacao-amd:jiacao/minimax-m31-parallel-topk-main

Conversation

@jiacao-amd

@jiacao-amd jiacao-amd commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Add an opt-in parallel decode top-16 selector for MiniMax-M3.1 on gfx950, replacing the fixed FlyDSL w26 selector in the NVFP4 indexer.

Supersedes #65032 and targets main. The parallel top-k tests extend the existing MI355 NVFP4 indexer suite; no CI configuration changes are included.

Claims

  • Preserve selected block IDs, ordering, tie handling and causal boundaries.
  • Use runtime shape metadata to avoid new row/stride specializations during mixed-batch serving.
  • Enable with VLLM_ROCM_PARALLEL_INDEX_TOPK=1; default off. FP8 indexers, including C4 mono decode, bypass this path.

Validation

900 s AgentX: baseline vs top-k only

4× MI355X, TP4, AgentX 1.0.12; 900 s per arm after warmup. Model: amd/MiniMax-M3.1-Flash-Quark-MXFP4 at 0a00e0e39fc00499b23efccc18a8ea63fce5c44c. InferenceX #4671 at bed892b82, DSpark K7, synthetic AL 4.04, seed 42.

Values are baseline → candidate. p90 interactivity uses output_token_throughput_per_user.p10; total throughput includes cached input tokens.

Run 1 uses f9f83fb28; the repeats use the same kernel in eae2f1099. Neither arm includes #62509. Each row is an independent pair.

Comparison p90 interactivity (tok/s/user) Output tok/s/GPU Total tok/s/GPU
C16, run 1 139.67 → 149.73 (+7.20%) 164.11 → 164.73 (+0.38%) 19,470.28 → 19,566.95 (+0.50%)
C16, run 2 138.85 → 152.69 (+9.97%) 164.59 → 166.63 (+1.24%) 19,542.95 → 19,982.19 (+2.25%)
C32, run 1 83.67 → 91.13 (+8.91%) 353.00 → 363.73 (+3.04%) 46,831.45 → 48,283.98 (+3.10%)
C32, repeat (r3) 87.18 → 91.26 (+4.68%) 356.29 → 365.85 (+2.68%) 47,237.91 → 48,630.29 (+2.95%)
ITL and TTFT (baseline → candidate)
Comparison Mean ITL (ms) p90 ITL (ms) Mean TTFT (ms) p90 TTFT (ms)
C16, run 1 5.221 → 5.302 7.158 → 6.669 540.663 → 517.630 875.833 → 920.976
C16, run 2 5.100 → 4.682 7.193 → 6.547 559.563 → 527.167 983.740 → 921.735
C32, run 1 8.307 → 7.906 11.947 → 10.965 703.343 → 698.839 1,374.336 → 1,267.423
C32, repeat (r3) 7.862 → 7.639 11.470 → 10.946 749.175 → 681.821 1,414.022 → 1,307.598

The first C32 repeat reached the 30 s drain limit with one cancelled request and is excluded. The table uses a fresh C32 pair with the same settings.

Configuration and reproduction

Pinned nightly: vllm/vllm-openai-rocm@sha256:9cef62361792bd9cc621725c3af799993b6a68b6b62e3778dcf9b65ff6fcd872 (source e0d00e4b8). Both repetitions use this image.

C16/C32 use NVFP4 KV/indexer, V2 + DBO and a 32K prefill budget. Both arms include the same text-only DBO startup-guard fix (supports_multimodal_inputs). C4 uses FP8 KV/indexer, mono decode, an 8K prefill budget and no DBO.

Use the corresponding #4671 serving lane. Set CONC to the table's concurrency and TOKENIZER to the pinned model snapshot:

agentx profile --url http://127.0.0.1:8000 \
  --model amd/MiniMax-M3.1-Flash-Quark-MXFP4 \
  --tokenizer "$TOKENIZER" \
  --concurrency "$CONC" --benchmark-duration 900 \
  --tokenizer-trust-remote-code \
  --server-metrics http://127.0.0.1:8000/metrics \
  --public-dataset semianalysis_cc_traces_weka_062126

In-tree tests: 78 cases, previously validated with 78 passed. The unchanged test bodies and parameters now live in the existing CI-selected suite: .venv/bin/python -m pytest -q tests/kernels/attention/test_minimax_m3_nvfp4_index.py -k parallel_decode. The test-only relocation passes pre-commit and CI test-tethering checks; GPU execution at the new location is pending the new-head CI run. Direct-kernel and host-dispatch comparisons cover exact FlyDSL ordering, ties, NaNs, causal boundaries, query lengths 1/4/8, fused/staged merge and strided outputs. Two-stream graph replays switch the same rows across adaptive/merge boundaries and verify zero counters after every replay. Pre-commit hooks passed.

Flag rename c0e83e24b: environment parsing, recipe validation/rendering and pre-commit checks passed. The reported GPU, serving and accuracy results predate this name-only update; no GPU rerun was performed for the rename.

GSM8K accuracy

Original scoring, all 1,319 questions per run; TP4/C16, 5-shot, temperature 0, seed 42, reasoning effort low, 4096-token output limit, and real DSpark K7 block rejection.

Repeated evaluation: two runs per arm, using the same model revision and serving configuration above and one image rebuilt from main 380c8e438, including the shared DBO startup fix. Candidate: the runtime diff from 8daa3c4c2 applied to that same base, with parallel top-k enabled; no tiles patch.

Configuration Run 1 correct / 1319 Run 2 correct / 1319 Mean accuracy Mean delta
Baseline 1,265 1,269 96.06% —
Top-k only 1,260 1,263 95.64% -0.42 pp

All four runs completed without API errors. Prefix-cache resets succeeded before every run; token-limit answers remain in the original scores.

Earlier single-pair GSM8K result: 1,267 → 1,264 correct (96.06% → 95.83%); invalid answers 1 → 0.

Details

Small heads × rows <= 16 batches fuse selection and last-arriver merge; larger batches use staged merging. Scratch and counters are isolated by device, stream and shape.

The recipe adds opt-in parallel_topk; the existing MI355 Buildkite kernel job runs the tests through test_minimax_m3_nvfp4_index.py with its existing gfx950 platform guards. Scoreboard enablement targets #4671's C16/C32 NVFP4 lane, zip_override_tp4_dspark7.roles.agg.env: set the flag to "1" in an image containing this patch and the text-only DBO startup fix noted above. Correctness CI does not enable serving; global default-on is not planned. Recipe validation, interactive command checks and documentation discovery passed.

Related work: #65087 optimizes the same NVFP4 selector by changing the existing FlyDSL kernel to four waves per row. This PR is an alternative opt-in Triton selector with partitioned workgroups and fused/staged merging; the reported gains exclude #65087. #59980 targets index scoring and #64264 targets kernel warmup.

AI assistance: OpenAI Codex.

Pull Request Checklist
  • PR checklist used; AI assistance disclosed.
  • Design fit, tests, documentation and CI coverage reviewed.
  • Requested performance validation and model evaluation complete.
  • Attribute the observed GSM8K accuracy difference.
  • Hosted CI complete.

@mergify

mergify Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Use runtime shape metadata and fixed merge widths for the NVFP4 indexer.
Preserve FlyDSL ordering and causal bounds, with changing-length graph
replay tests, recipe opt-in and MI355 kernel CI coverage.

Reapply the reviewed vllm-project#65032 patch to main after its base branch was deleted.

Co-authored-by: OpenAI Codex
Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
@jiacao-amd
jiacao-amd force-pushed the jiacao/minimax-m31-parallel-topk-main branch from 7da2dc5 to 8daa3c4 Compare November 3, 2026 01:23
github-actions Bot added a commit to vllm-project/recipes that referenced this pull request Nov 3, 2026
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jiacao-amd

Copy link
Copy Markdown
Contributor Author

@ChuanLi1101 Following up on your review in #65032 (comment). This PR replaces #65032 after its base branch was deleted and now targets main.

  • Added in-tree tests: 78 passed. Coverage includes exact FlyDSL ordering, ties/NaNs, causal boundaries, query lengths 1/4/8, and two-stream graph replays that switch rows between adaptive early-exit and merge paths. Counters are verified to reset after every replay.

  • Repeated the 900s AgentX comparisons on the same pinned nightly. For C16/C32 respectively, output tok/s/GPU improved by 1.24%/2.68%, and p90 interactivity by 9.97%/4.68%. Both the original and repeated results are in the description.

  • Renamed the flag to VLLM_ROCM_MINIMAX_M3_1_PARALLEL_TOPK, added recipe opt-in and MI355 correctness CI coverage. The default remains off.

  • Documented scoreboard enablement: the InferenceX [WIP] model runner refactoring part 2; AttentionMetadataBuilder #4671 C16/C32 NVFP4 lane needs an image containing this patch and the documented DBO startup fix, with the flag explicitly enabled. That image rollout has not been performed.

The review fixes and measurements are included here; hosted CI remains pending the repository's pre-run gate.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

✅ @jiacao-amd, CI is now available for this PR.

  • /ci run starts upstream CI; /amd-ci run starts AMD CI only.
  • Run commands test your branch with every commit currently on its upstream target branch. If it is behind, the bot merges the target branch into it first (pull before pushing again). Append --allow-stale to a run command to test an outdated branch as is, at your own risk.
  • /ci retry retries failed jobs in the CI build for the current PR head. If the current head has no CI build, it starts a new CI build for the current head containing only jobs that failed in the latest earlier CI build for this PR.
  • /amd-ci retry retries failed jobs in AMD CI for the current PR head. Use /amd-ci run when the current head has no AMD CI build.
  • /ci cancel cancels scheduled or running CI builds for this PR branch; /amd-ci cancel does the same for AMD CI only.

github-actions Bot added a commit to vllm-project/recipes that referenced this pull request Nov 4, 2026
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jiacao-amd

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #99865 for commit 1e7f210a3c63.

ℹ️ This PR is 27 commits behind upstream main. Merged upstream main into this branch as 1e7f210a3c63 before starting CI. Pull the branch before pushing more changes.

github-actions Bot added a commit to vllm-project/recipes that referenced this pull request Nov 4, 2026
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

@ChuanLi1101 ChuanLi1101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me — default-off with the in-tree coverage and AgentX deltas. The ~0.4pp GSM8K dip is fine for merge; please attribute it before scoreboard enablement turns the flag on.

Move the 78 parallel decode cases into the NVFP4 indexer test suite
already selected by MI355 CI. Reuse the original test helpers and
preserve all assertions, parameters and gfx950 platform guards.
Remove the PR-specific Buildkite test registration.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
@mergify

mergify Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @jiacao-amd.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Nov 5, 2026
Retain the CP gate test added on main before the relocated parallel
top-k cases, resolving the shared import and append locations.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
Resolve the shared import and append locations while preserving both
test suites. The resulting tree is current main plus the five PR files;
no CI configuration changes remain in the PR.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
@jiacao-amd

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #100200 for commit 45831b7824ec.

ℹ️ This PR is 1 commit behind upstream main. Merged upstream main into this branch as 45831b7824ec before starting CI. Pull the branch before pushing more changes.

@mergify mergify Bot removed the needs-rebase label Nov 5, 2026
github-actions Bot added a commit to vllm-project/recipes that referenced this pull request Nov 5, 2026
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@shen-shanshan
shen-shanshan merged commit 1e89fd1 into vllm-project:main Nov 6, 2026
185 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Nov 6, 2026
vllm-recipes-publisher Bot pushed a commit to vllm-project/recipes that referenced this pull request Nov 6, 2026
vllm-project/vllm@main:recipes a7809d0cc5ba → 1e89fd11251b [latest.vllm]
vllm-project/vllm@a7809d0...1e89fd1

Commits:
- vllm-project/vllm@1e89fd11251b [Perf][ROCm][MiniMax-M3.1] Add opt-in parallel decode top-k (vllm-project/vllm#65267)

Recipes:
- MiniMaxAI/MiniMax-M3.1-Flash (modified): https://recipes.vllm.ai/MiniMaxAI/MiniMax-M3.1-Flash

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions Bot added a commit to tapis-project/vllm-recipes that referenced this pull request Nov 6, 2026
…mni@4cbfcc3eb555

vllm-project/vllm@main:recipes e6c60746e605 → aa4022dc8176 [latest.vllm]
vllm-project/vllm@e6c6074...aa4022d

Commits:
- vllm-project/vllm@84e17e1ba583 Minimax m3.1 dspark drafter monokernel (vllm-project/vllm#65386)
- vllm-project/vllm@1e89fd11251b [Perf][ROCm][MiniMax-M3.1] Add opt-in parallel decode top-k (vllm-project/vllm#65267)

Recipes:
- MiniMaxAI/MiniMax-M3.1-Flash (modified): https://recipes.vllm.ai/MiniMaxAI/MiniMax-M3.1-Flash

vllm-project/vllm-omni@main:recipes 04ddf2104966 → 4cbfcc3eb555 [latest.vllm-omni]
vllm-project/vllm-omni@04ddf21...4cbfcc3

Commits:
- vllm-project/vllm-omni@e89852357492 [Model] Stream JoyAI duplex speech through async-chunk Code2Wav (vllm-project/vllm-omni#9798)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
yeshihai pushed a commit to yeshihai/vllm that referenced this pull request Nov 8, 2026
…ject#65267)

Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
Co-authored-by: vllm-agent <claw@inferact.ai>
Co-authored-by: OpenAI Codex <noreply@openai.com>

This branch was previously deployed

1 inactive deployment
recipes-preview — 45831b78 Deployed Nov 6, 2026 by shen-shanshan via dispatch #366
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build minimax ready ONLY add when PR is ready to merge/full CI is needed recipe rocm Related to AMD ROCm

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants