Repository navigation
[Config] [GEMM] [gfx950] Add MiniMax-M3 master BF16 GEMM table & tuned ViT linear projections - #6235
Conversation
Add gfx950 master BF16 GEMM tuned configuration table (5,449 kernel solutions) for MiniMax-M3 across text prefill, decode, multimodal composite token counts, and vision encoder linear projections. Covers ASM, Opus, and FlyDSL kernels with and without bias.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
…ntuned companion - Replace 2,076 torch fallback rows with profiled FlyDSL/hipBLASLt winners - Eliminate 3,605 sibling-table primary key collisions - Synchronize untuned companion CSV to exact 338 rows (1:1 shape parity) - Enforce strict non-torch, non-colliding table across TP=8, TP=4, TP=2, and ViT Signed-off-by: Bishwo Adhikari <bishwo.adhikari@amd.com>
da33891 to
18e64e3
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Several impossible timing outliers and benchmark shape/bias mismatches undermine the tuning evidence.
1 open finding
What changed in this PR
Expands MiniMax-M3 MXFP4 BF16 GEMM coverage on gfx950 with synchronized tuned and untuned configurations.
Changes:
- Adds 338 TP and ViT GEMM shapes.
- Uses native FlyDSL, hipBLASLt, Opus, ASM, and Triton kernels.
- Synchronizes tuned and untuned shape tables.
| File | Description |
|---|---|
minimax_m3_mxfp4_bf16_tuned_gemm.csv |
Adds gfx950 kernel selections and measurements. |
minimax_m3_mxfp4_bf16_untuned_gemm.csv |
Mirrors the expanded tuning shape set. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
- Re-tune 3 physical outlier shapes ((240,4608,6144), (112,4992,6144), (128,4992,6144))
on MI355X (gfx950) with explicit event synchronization (use_cuda_event=True).
- Brings latencies to realistic 45-89 us range and TFLOPS within physical boundaries
(<2614 TFLOPS, <8000 GB/s):
* (240,4608,6144): 89.34 us, 152.11 TFLOPS (FlyDSL solidx=534, splitK=3)
* (112,4992,6144): 46.49 us, 147.79 TFLOPS (Torch native)
* (128,4992,6144): 45.65 us, 172.00 TFLOPS (ASM pf3_splitk, splitK=1)
6da9c17 to
3d68ce4
Compare
…licate BF16 tables - Replace PyTorch fallback on shape (112, 4992, 6144) with verified native hipblaslt kernel (solidx 440108, 23.0212 us, 298.43 TFLOPS, 2772.93 GB/s, err_ratio 0.0), guaranteeing zero unaccelerated PyTorch fallback rows. - Remove 38 duplicate shape keys colliding with minimax_m3_eagle_bf16_tuned_gemm.csv to ensure clean global BF16 JIT config auto-discovery without RuntimeError. - Synchronize companion minimax_m3_mxfp4_bf16_untuned_gemm.csv 1:1, reducing both tables to 300 clean, non-colliding rows on gfx950 (187 FlyDSL, 72 hipBLASLt, 24 Opus, 16 ASM, 1 Triton).
…nner - Re-tune shape (128,4992,6144) on MI355X (gfx950) with event synchronization across all candidate backends, replacing the 45.65 us ASM entry with the winning native hipblaslt kernel (solidx 440108, 23.4287 us, 335.13 TFLOPS, 2739.91 GB/s, err_ratio 0.0), improving latency by 1.95x and outperforming the prior 25.35 us baseline. - Update backend distribution across the 300 non-colliding rows: 187 FlyDSL, 73 hipBLASLt, 24 Opus, 15 ASM, 1 Triton, 0 torch fallback.
…y timed measurements - Benchmark all 44 previously extrapolated shapes with GPU event-synchronized tuner execution across native backends (flydsl, opus, asm, triton) on MI355X (gfx950). - Eliminate all identical TFLOPS sequences across lines 224-243 and 255-301, establishing measured per-shape winners (FlyDSL vs Opus). - Maintain 100% physical sanity (<= 2614 TFLOPS, <= 8000 GB/s) and numerical accuracy (err_ratio <= 0.05). - Final table distribution across 300 rows: 254 FlyDSL, 28 Opus, 16 ASM, 2 Triton, 0 hipBLASLt, 0 torch.
|
please update you branch |
…past buffer limits The gfx950 A16W16 epilogue computed C offsets as int32 `row * n + col`, so any GEMM with M * N >= 2^31 stored to a wrapped address. Tuned BF16 rows are looked up by padded M, and getPaddedM(gl=1) maps every M > 8192 with N > 4096 to the M=8192 row, so a row tuned at M=8192 serves arbitrarily large M. With the MiniMax-M3 ViT rows from ROCm#6235, vLLM's encoder-cache profile run (M=768000, N=6144, K=1280) hits this and faults with "Write access to a read-only page" on MI355X (reproduced standalone via tgemm.mm at M>=360000). - Compute the non-split-K C offsets in int64 in both the full-tile and half-tile-interleaved epilogues. - Reject shapes whose A or B exceeds the 2 GiB buffer-resource range in make_gemm_a16w16_param_and_validate (also prunes them from tuning). - Skip a FlyDSL tuned row in get_GEMM_A16W16_tuned_config when the kernel cannot run the actual shape, falling back like an unrecognized kernel. - Add the large-M MiniMax-M3 ViT shape and a shape-limit check to op_tests/test_flydsl_hgemm.py. Co-Authored-By: Claude <noreply@anthropic.com>



Summary
This PR updates the original configuration from #5758 and expands coverage across TP=8, TP=4, and TP=2 for both language model projections and multimodal vision encoders.
Key Changes
Expanded Coverage Across Parallelism Degrees (112 → 300 Rows):
Elimination of hipBLASLt & Zero PyTorch Fallbacks:
flydsl,asm,triton,opus) with GPU event synchronization and strict numerical accuracy (err_ratio <= 0.05).flydsl_hgemm_*), 28 Opus, 16 ASM, 2 Triton, 0 hipBLASLt, and 0 torch.JIT Deduplication & 1:1 Companion Parity:
(gfx, cu_num, M, N, K, bias, dtype, outdtype, scaleAB, bpreshuffle)shared withminimax_m3_eagle_bf16_tuned_gemm.csvto ensure clean global BF16 JIT auto-discovery inaiter/jit/core.py:506-548without runtime exceptions.minimax_m3_mxfp4_bf16_untuned_gemm.csv1:1 to the 300 tuned shapes in order and dimensions.Full Model Coverage Across Parallelism Degrees:
bias=False) across token decode batch sizes (bias=True) across ViT QKV, MLP, and Multimodal Projector dimensions:Reproduction / Validation Command:
Breaking changes
None.
Verification Checklist
gfx950).libtype: torchfallback rows.