Repository navigation
[ROCm][Perf][MiniMax-M3.1] Tune MXFP8 linear tiles for 16 < M <= 256 - #62509
jiacao-amd wants to merge 3 commits into
Conversation
|
This pull request has merge conflicts that must be resolved before it can be |
70a2b0a to
0173d9b
Compare
0173d9b to
473a3bf
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
|
Thanks for the detailed write-up. A few technical asks before approving:
|
Select gfx950 tiles by M, local N and K while preserving the existing fallback outside the tuned range. Fold the M48 QKV exception into the table and use the narrow tile from vllm-project#64195 for V4.1 wqa/wkv M48 and M64. Extend the existing linear tests across the tuned buckets and TP2 shapes. Co-authored-by: OpenAI Codex Co-authored-by: Claude Code Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
|
Thanks @ChuanLi1101 Addressed in 99ec093:
The description is updated with the results and reproduction details. Hosted CI remains pending the repository's pre-run gate. |
Remove the V4.1-only N=1792 bucket and clarify that its normal serving path uses the separate block-scaled GEMM. Retain the MiniMax TP4 QKV M48 exception. The complete TP2/TP4 rotating-weight sweep finds a TP2 QKV regression in the M192 bucket. Use the existing main fallback for N=4992, K=6144 and 128 < M <= 192; retain the other measured buckets. Validated on MI355X: 296 kernel tests, six graph checks, 36 GEMM cases and five boundary cases. Co-authored-by: OpenAI Codex Signed-off-by: jiacao-amd <jiahui.cao@amd.com>
|
✅ @jiacao-amd, CI is now available for this PR.
|
|
/ci run |
|
✅ Triggered Buildkite CI #99795 for commit ℹ️ This PR is 188 commits behind upstream |
ChuanLi1101
left a comment
There was a problem hiding this comment.
Looks good — prior asks and okorzh's threads are addressed (V4.1/1792 cleanup, M3.1 per-GEMM table, TP2 M192 fallback). LGTM.
simondanielsson
left a comment
There was a problem hiding this comment.
Thanks for the fix!
| if ( | ||
| _ON_GFX950 | ||
| and 16 < M <= 256 | ||
| and N > 1280 |
There was a problem hiding this comment.
Question: Will this affect other models as well? Ideally we'd only add this for M31 shapes
Overview
Tune gfx950 MXFP8 linear tiles for MiniMax-M3.1 decode and small prefill batches (
16 < M <= 256, localN > 1280). Keep the main configuration for TP2 QKV at128 < M <= 192, where the tuned tile regresses.Claims
17 <= M <= 64,N > 1280range with [ROCm] MXFP8 linear: one tile row for 17-64 token decode batches #64195; integrate that overlap here rather than stacking selectors. This PR also tunes M65–256; [ROCm] MXFP8 linear: one tile row for 17-64 token decode batches #64195's additional small-N coverage is outside its scope.Validation
MiniMax-M3.1 GEMMs: main
ffdf26702vs4bfce4e2eMI355X, same image and inputs; 36 cases covering all six TP4/TP2 shapes at M48/64/96/128/192/256. The 34 changed tiles reduce GEMM latency by 4.64–58.15%. M48 TP4 QKV keeps its main tile. TP2 QKV now also keeps the main tile for
128 < M <= 192.The initial M192 TP2 QKV measurement regressed 23.296 → 26.608 µs (+14.22%). That shape/range is excluded from the tuned path; M128/129/160/192/193 boundary checks confirm the intended dispatch. The other measured buckets are retained.
All 36 GEMM timings and measurement method
Values are main → PR, µs/GEMM; these are kernel timings.
Prequantized E4M3 activations/weights with E8M0 scales and BF16 output, seed 4671. Each graph rotates
ceil(512 MiB / (N*K*33/32))weight copies. Seven alternating rounds, 40 graph replays per round; report the median device-event time per GEMM. Quantization is outside the timed region.Runtime:
vllm/vllm-openai-rocm@sha256:9cef62361792bd9cc621725c3af799993b6a68b6b62e3778dcf9b65ff6fcd872. The image's baseline native GEMM source is byte-identical to mainffdf26702; the candidate source and tests match 4bfce4e2e.Revalidated the final source on MI355X: 296 kernel tests passed, 0 skipped; six two-stream graph checks passed. Pre-commit passed.
900 s AgentX: main
380c8e438vs tiles only4× MI355X, TP4, AgentX 1.0.12; 900 s per arm after warmup. Model:
amd/MiniMax-M3.1-Flash-Quark-MXFP4at0a00e0e39fc00499b23efccc18a8ea63fce5c44c. InferenceX #4671 atbed892b82, 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.Candidate: 99ec093d5. One pair per concurrency; norm+quant fusion is already in the baseline.
ITL and TTFT (baseline → candidate)
Configuration and reproduction
Both arms use one image rebuilt from main 380c8e438 (pinned when this validation started), including Python and C++.
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
CONCto the table's concurrency andTOKENIZERto the pinned model snapshot: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:99ec093d5(tiles only).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,274 → 1,267 correct (96.59% → 96.06%); invalid answers 0 → 0.
Details
Tile selection uses M, local N and K;
BLOCK_Kdivides K. No new kernel or model interface. This follow-up changes no MiniMax TP4 tile, so the TP4 serving and GSM8K results above retain their original attribution. The new TP2 exclusion uses the existing main fallback.AI assistance: OpenAI Codex and Claude Code.
Pull Request Checklist