Repository navigation
[Klaud Cold] minimaxm31flash-fp4-mi355x-sglang-agentic-dspark: day-zero MiniMax-M3.1-Flash MI355X SGLang recipe - #4445
Conversation
….1-Flash SGLang AgentX on MI355X Serve flags follow the SGLang cookbook's MiniMax-M3.1 cells with the day-zero dev-minimax-m31-flash image. Seven-token DSpark with synthetic acceptance from the minimaxm31flash_dspark golden curve.
|
Thanks for the contribution!
中文感谢你的贡献!
|
| - "Serve flags follow the cookbook's MI355X Low-Latency (TP4) and High-Throughput (TP4, HiCache, fp8 draft KV): DSpark with block verification, breakable prefill graphs, minimax-m3 reasoning and tool parsers, 8 tokenizer workers." | ||
| - "Seven-token DSpark (the bundled draft's dspark_block_size); throughput runs use synthetic acceptance from the minimaxm31flash_dspark golden curve (AL 4.04 at 7 draft tokens, #4425)." | ||
| - "Search space: Low-Latency TP4 at conc 1-32; TP4 + HiCache (180 GB per rank) and fp8 draft KV at conc 48-64." | ||
| pr-link: TBD |
There was a problem hiding this comment.
🔴 The perf-changelog check will fail on this PR, and the entry will not get its real PR link at merge. pr-link: TBD is not one of the accepted placeholders. validate_added_pr_link (infx/workflows/validate_perf_changelog.py:147) accepts only the canonical https://github.com/SemiAnalysisAI/InferenceX/pull/<N> or an entry in PR_LINK_PLACEHOLDERS (XXX, .../pull/XXX). Fix: set pr-link to this PR's canonical URL, or to XXX so prepare_perf_changelog_merge fills it in.
Why this was flagged
The new block at inferencex-e2e/perf-changelog.yaml:11018 sets pr-link: TBD. On a PR run, validate_added_pr_link in inferencex-e2e/infx/workflows/validate_perf_changelog.py:146-150 raises ChangelogValidationError("new PR entry must use '.../pull/' or an XXX placeholder; found 'TBD'"), because PR_LINK_PLACEHOLDERS at lines 22-25 holds only "XXX" and "https://github.com/SemiAnalysisAI/InferenceX/pull/XXX". The merge-time rewriter inferencex-e2e/infx/workflows/prepare_perf_changelog_merge.py:108 also skips links that are not in PR_LINK_PLACEHOLDERS, so it would never replace TBD. On main, validation requires CANONICAL_PR_LINK (line 142), so TBD fails there as well. Every earlier block in the file uses a canonical URL, for example 11009.
Verification: The new block at inferencex-e2e/perf-changelog.yaml:11018 sets pr-link: TBD. PR_LINK_PLACEHOLDERS (validate_perf_changelog.py:22-25) holds only "XXX" and ".../pull/XXX". validate_added_pr_link (lines 146-150) raises "new PR entry must use ... or an XXX placeholder; found 'TBD'". Either way, the entry does not get its real PR link.
| # MiniMax-M3.1-Flash AgentX on MI355X with SGLang: day-zero image from the SGLang | ||
| # cookbook (https://docs.sglang.io/cookbook/autoregressive/MiniMax/MiniMax-M3.1), | ||
| # manifest digest verified 2026-10-24. Serve flags follow the cookbook's | ||
| # MI355X Low-Latency (TP4) and High-Throughput (TP4, HiCache, fp8 draft KV). | ||
| # Seven-token DSpark (bundled draft); synthetic acceptance follows | ||
| # infx/golden_al_distribution/minimaxm31flash_dspark.yaml. |
There was a problem hiding this comment.
🟡 nit (optional): New header and provenance comments break the mandatory AGENTS.md comment rules, sweep:cookbook|Low-Latency|High-Throughput|cell|verified 2026. Two examples: the 6-line block above the config key at amd-master.yaml:1556 ("day-zero image from the SGLang cookbook", "manifest digest verified 2026-10-24") and the section headers in the recipe's agentic.yaml at lines 52 and 139. Fix: delete the header, section and source/date comments. Keep only short line-level reasons, for example why hicache-size is 180 or why max-running-requests is 2x CONC capped at 128.
Why this was flagged
AGENTS.md:64 says "No header comments" above a recipe, override or section, and bans describing what the file, topology or config is. AGENTS.md:65 says "No history", which covers where something came from and past results. The diff adds a config description and provenance block at amd-master.yaml:1556-1561, which says "day-zero image from the SGLang cookbook" and "manifest digest verified 2026-10-24". It also adds topology labels at amd-master.yaml:1574 and 1578. In minimaxm31flash/sglang/mi355x-fp4-mtp/agentic.yaml it adds a source-URL comment at lines 24-25, and section headers above overrides at lines 52-53 and 139-141 ("TP4 Low-Latency cell", "High-Throughput cell", "instead of the cookbook's auto-sized ~350 GB per rank"). The base branch has none of these lines. After merge, the repo carries comments its mandatory guidance forbids. The neighbouring entries also have header comments, but that is precedent, not permission.
Verification: AGENTS.md:64 forbids comments "above a recipe, override, or section" and says "Do not describe what the file, topology, or config is". AGENTS.md:65 forbids comments about "where it was derived from ... or past results". The 6-line block at amd-master.yaml lines 1556-1561 and the section headers at agentic.yaml lines 52 and 139 break this. Nothing breaks at runtime.
…io 1.5 A fixed hicache-size of 180 GB per rank (host/device ~1.09) hit a HIP illegal memory access in the first prefill's HiCache write backup, so the scheduler died and the server never turned healthy. Use the cookbook's ratio sizing at 1.5 (~249 GB per rank) to stay inside the MI355X CPU DRAM budget.
Keep main's perf-changelog and append the MI355X SGLang entry at the end.
Keep main's entries and re-add the MI355X SGLang changelog and master-config blocks.
The cookbook High-Throughput cell crashes on MI355X: the first prefill's HiCache write backup hits a HIP illegal memory access with either a fixed hicache-size or hicache-ratio 1.5. Run concurrency 48 and 64 GPU-resident on the Low-Latency cell.
|
/use 40065869885 |
|
@Oseltamivir staged run 40065869885. This run remains available across future |
…rnel launch a layer (#56) ## Motivation On SGLang's standard path, MiniMax-M3.1-Flash decodes at low concurrency with about seven launches per sparse layer after attention: - the attention all-reduce with residual add, norm and quant - the router, fused with the shared expert's gate/up - the shared expert's activation and down projection - the routed MoE's two stages - the MoE all-reduce At c1 (TP4, MI350X, 150K context, DSpark with 7 drafts) that chain takes about 76 µs per layer, roughly half of an 8.66 ms step. vLLM's MiniMax-M3 ROCm path runs the same work as one persistent FlyDSL launch per layer (`vllm/models/minimax_m3/amd/specialized_decode/mono`), and MiniMax-M3.1-Flash has the same text architecture. This PR brings that launch here for M3.1's decode and DSpark verify steps of up to 16 rows, through the monokernel interface (`--monokernel-backend amd`). ## Modifications - **minimax_m31/** vendors vLLM's FFN launch at vllm-project/vllm@a50259bb (Apache-2.0, attribution in the package docstring). The first commit copies it with only the imports rewritten, so each later commit is a reviewable change against upstream: - The launch builds on the plugin's own `common` primitives (`ops`, `plan`, `sync`, `peer`, `epoch`, `guard`), not on vLLM's copies of them. The occupancy check loads the HIP runtime through `common.peer.hip_runtime()`. - **Fail-stop as every other model's launches.** Waits run under `common.guard`: SGLang's deadline (`BuildContext.deadline_s`), the peers' failure flags, and a stop at the null page on failure, so no token of a failed step is sent. `SGLANG_AMD_MONO_FAULT_INJECT` works. vLLM's own error words and step-end handshake are gone; vLLM reads them in a host executor that SGLang has no place for. - **No epoch limit.** The attention seam's triple pairs carry 16-bit tags. vLLM resets the epoch from its host executor every ~2,000 steps; here the tags cycle 1 .. 65535 per parity on the device, and the last launch of a cycle zeroes that parity's receive half past its epoch barrier. - **The shared expert runs on the checkpoint's own MXFP8 values, from tensors of its own (`a16w8.py`).** vLLM reads it as MXFP4 expert 128 of the routed tensors. On M3.1 that requantization has about 4.6× the output error of FP8 (relative 0.18–0.19 vs 0.04), and in a test build it halved DSpark's real acceptance at one request (3.6 → 2.0 tokens per step) while GSM8K still passed. Routed slots keep A16W4. - **minimax_m31/spec.py**: the forward runs SGLang's embedding, dense layers, input norms and attention, then one FFN launch per sparse layer, which hands its output and residual back to SGLang's residual stream. SGLang's final norm (with DSpark's last-layer capture) and logits close the step. Attention and KV stay SGLang's, so NVFP4 and FP8 KV and HiCache are untouched. The load hook keeps each rank's MXFP8 shared-expert shard. `SGLANG_AMD_MONO_CHECK=1` runs SGLang's layer on a copy of each sparse layer's input in eager steps and logs the differences; `NUMERICS` comes from those runs. - **minimax/spec.py**: MiniMax-M3 and M3.1 share the `MiniMaxM3Sparse*` architectures, and SGLang registers one spec per architecture. This spec states only what both need, hands each checkpoint to its own spec, and re-checks that spec's requirements as SGLang's guard does. Unit tests pin that split to SGLang's `Requirements` and `MonoSpec` fields and the two models' device limits, so a field SGLang adds or a divergence fails CI. `minimax/check.py` holds the check-mode comparison both models log. - **test/e2e/test_minimax_m31_server.py** (new): the DSpark verify and decode servers' routing lines and chat GSM8K past the 16-row width, check mode against `NUMERICS`, and a stalled rank stopping the server without tokens. - **README** and **CODEOWNERS**: M3.1's row, launch, requirements and test command. ## Accuracy tests MI350X (gfx950), SGLang `af6d50a85e` (sgl-project/sglang#45936 on #45925) on a ROCm 10 image (torch 2.11, Triton 3.8, FlyDSL 0.4.0, HIP 7.15), `MiniMaxAI/MiniMax-M3.1-Flash`, TP4: - `test/kernels/test_minimax_m31_ffn.py`: 6 passed. Every stage at 1, 3, 8 and 16 rows (TP=1 build): the routed experts against AITER's fused MoE on SGLang's post-load MXFP4 layout, the shared expert against torch on its MXFP8 values. A launch whose wait times out stops (fails with a guard that does not stop), and a tag cycle ends with its receive half zeroed and every launch matching one at epoch 0 (fails without the clear). - `test/unit`: 140 passed. One contract failure against this SGLang branch: `deepseek_v41/spec.py` reads `mxfp8_aiter_preshuffled`, which that branch lacks; unrelated to this PR. - `test/e2e/test_minimax_m31_server.py`: 6 passed. Both servers' startup lines show their tested batches on the launch; chat GSM8K past the 16-row width scores 0.985 (DSpark verify) and 0.975 (decode); every checked launch is within `NUMERICS`; a rank stalled by `SGLANG_AMD_MONO_FAULT_INJECT` stops all four GPUs with faults at the null page and no tokens sent. - Chat GSM8K (`sglang.test.run_eval`, 200 questions, greedy, DSpark verify server, real acceptance): 0.975 with `--monokernel-backend amd`, 0.975 on the standard path. 8-shot completion prompts score under 0.1 on either path, so the gate is chat. - Check mode, two runs of 16 GSM8K prompts (49,476 and 44,004 launches), worst case: residual rel 0.042, cosine 0.99831; MLP output on the rows routed alike rel 0.28, cosine 0.66; 6.0–6.1% of rows routed to other experts than SGLang's. ## Speed tests c1 decode on the same stack, DSpark acceptance held at 3 tokens per step (`SGLANG_SIMULATE_ACC_LEN=3`), 11K-token prompt, 1,024 greedy tokens, median of 4: | | decode tok/s | |---|---:| | standard path | 390.8 | | `--monokernel-backend amd` | 422.3 (+8.1%) | Chat GSM8K above (4 requests at a time, real acceptance): 24.8 s vs 26.8 s on the standard path, 1,312 vs 1,272 output tok/s. The port to `common` and the guard leave the launch's time unchanged (TP=1 build, 1 / 4 / 8 / 16 rows: 26.3 / 45.7 / 65.8 / 108.8 µs against 27.0 / 45.9 / 65.7 / 108.1 µs vendored). On an earlier revision, AgentX c1 (900 s, TP4, DSpark with 7 drafts at golden AL 4.04, SemiAnalysisAI/InferenceX#4445's c1 cell) measured 6,013 → 6,151 tok/s/GPU, p90 449.5 → 470.2 and median 495.2 → 548.0 tok/s/user. c1 screens at 900 s move by several percent between identical runs. ## Not covered - MI355X, and TP other than 4. - A TP4 kernel-level test. TP4 is covered end to end. - Steps of more than 16 rows (DSpark at 3+ requests), which run SGLang's path. - On a ROCm 10 image, #45936's bf16 GEMM table carries hipBLASLt indices that fit its ROCm 7.2 image only, so verify-graph capture fails until those rows are left out (`AITER_CONFIG_GEMM_BF16`). These tests ran with them left out on both paths. - SGLang could select a spec per checkpoint, which would let `minimax/spec.py` drop its re-check of the requirements. - The launch reads at about 3.3 TB/s at 8 rows on MI350X. Its front stages (norm → router → route → table) cost about 12–16 µs before any routed weight is read, and a routed tile's loads wait for the previous tile's tail. Overlapping them across tiles by unrolling was 6% slower end to end; that's a follow-up. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Kevin Mi <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Day-zero MiniMax-M3.1-Flash (
MiniMaxAI/MiniMax-M3.1-Flash, NVFP4) AgentX on MI355X with SGLang, following the SGLang cookbook: https://docs.sglang.io/cookbook/autoregressive/MiniMax/MiniMax-M3.1 (config source:docs/src/snippets/configs/MiniMaxAI/minimax-m3.1.jsx).lmsysorg/sglang:dev-minimax-m31-flash-mi35x, pinned by digest (verified on Docker Hub 2026-10-24).SGLANG_USE_AITER=1,--fp8-gemm-backend aiter) for conc 1–32 and High-Throughput (Low-Latency + HiCache + fp8 DSpark draft KV +--prefill-decode-interval 16) for conc 48–64. HiCache is pinned to 180 GB per rank (720 GB total), within the 1.5 TB allowed for 4 of 8 GPUs, instead of the cookbook's auto-sized ~350 GB per rank.--speculative-algorithm DSPARK --speculative-use-block-verification,--cuda-graph-backend-prefill breakable,minimax-m3reasoning and tool parsers,--tokenizer-worker-num 8.--speculative-dspark-block-size 7, the bundled draft'sdspark_block_size). It's set explicitly so throughput runs resolve synthetic acceptance fromminimaxm31flash_dspark.yaml([Klaud Cold] Add MiniMax-M3.1-Flash DSpark golden AL curve and SPEED-Bench collector / [Klaud Cold] 新增 MiniMax-M3.1-Flash DSpark 黄金 AL 曲线与 SPEED-Bench 采集脚本 #4425): AL 4.04 at 7 tokens, thinking on (adaptive, the default).infx generatebinds every matrix point to exactly one recipe variant, withSGLANG_SIMULATE_ACC_LEN=4.04.vLLM siblings: #4419 (GB300), #4420 (MI355X), #4421 (B300), #4422 (H100), #4423 (H200), #4426/#4431 (B200), #4433 (GB200).