Repository navigation
[FlyDSL] Support hidden 6144 in the INT4 QuickReduce + RMSNorm epilogue - #6404
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
86b538b to
128ddfa
Compare
The fused add + RMSNorm epilogue reduces each row inside one workgroup, so every bf16 row must sit inside one tile. A 12 KiB row (hidden 6144, e.g. MiniMax-M3) never divides the 32 KiB tile, so those models fall back to all-reduce plus a separate norm. Add a 12-atom (48 KiB) build holding four 6144 rows, selected through a tile_atoms factory parameter; the default 8-atom kernel is unchanged. Wide engines own their own IPC inbox and are built by a collective, on prepare_rmsnorm() or the first fused call; building under CUDA graph capture raises. Their persistent grid is clamped to the CUs' LDS residency. 12 atoms split across TP 2 and 4; TP 8 keeps rejecting 6144. Co-authored-by: Claude (DSH agent) Signed-off-by: Aakif Nawaz <[email protected]>
128ddfa to
c8c9076
Compare
|
@TennyWang1223 gentle ping on this one for when you get a chance! This is small extension to #6369 so the fused RMSNorm path covers hidden 6144 (MiniMax-M3) at TP 2 and 4. Default kernel untouched, validated on MI350X and MI325X. Thanks! |
|
review summary Verdict: Needs work (advisory) Evidence: The PR applies cleanly to main. I ran the test on 8x MI308X (gfx942): TP 8/4/2 all pass, including the new hidden-6144 cases. CI has no failures. At TP4 the fused path was 1.99x faster at 2048 tokens and 0.99x at 16384 tokens (one sample each). Findings
|
Signed-off-by: Aakif Nawaz <[email protected]>
|
Thanks for the review @TennyWang1223 Added
|
…sed QR RMSNorm, gfx950/xGMI retune) Ported: - FAMILY_POLICIES gfx950/xGMI TP2 one-shot window 64 MiB -> 4 MiB. - MESH_ST_LADDER gfx950/xGMI retune (one b256 rung per TP). - Policy test import fix (strict CustomAllreduce is_weak_contiguous). - main: Gluon gfx1250 fused AR+RMSNorm hooks in communicator_cuda. Superseded by this branch's fused design, not ported: - QuickAllReduceInt4 fused RMSNorm (rmsnorm_hidden, compile_rmsnorm, runtime eps, MESH_NORM_LADDER): replaced by FlyQuickAllReduceRMSNorm, whose eps is already a launch argument, whose widths are prepared by FlyDSLAllReduceRMSNorm (hiddens / AITER_FLY_AR_FUSED_HIDDENS / prime), and whose ladders come from fused_allreduce_ladders.json. - #6404 12-atom tiles for hidden 6144: the row-block geometry builds 6144 natively (block 768) at TP2/4/8, and rows are addressed per row in i64. - quick_allreduce_int4.py kernel/host and its RMSNorm test: deleted here. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ue (#6404) * [FlyDSL] Support hidden 6144 in the INT4 QuickReduce + RMSNorm epilogue The fused add + RMSNorm epilogue reduces each row inside one workgroup, so every bf16 row must sit inside one tile. A 12 KiB row (hidden 6144, e.g. MiniMax-M3) never divides the 32 KiB tile, so those models fall back to all-reduce plus a separate norm. Add a 12-atom (48 KiB) build holding four 6144 rows, selected through a tile_atoms factory parameter; the default 8-atom kernel is unchanged. Wide engines own their own IPC inbox and are built by a collective, on prepare_rmsnorm() or the first fused call; building under CUDA graph capture raises. Their persistent grid is clamped to the CUs' LDS residency. 12 atoms split across TP 2 and 4; TP 8 keeps rejecting 6144. Co-authored-by: Claude (DSH agent) Signed-off-by: Aakif Nawaz <[email protected]> * [FlyDSL] guard QuickReduce RMSNorm soffset range Signed-off-by: Aakif Nawaz <[email protected]> --------- Signed-off-by: Aakif Nawaz <[email protected]>
…lyDSL QuickReduce fused_allreduce_gemma_rms_norm is the manual AR + norm fusion MiniMax-M3 calls directly (it runs without torch.compile, so fuse_allreduce_rms never sees it). On ROCm it only fused on the one-stage custom all-reduce, i.e. decode sizes; prefill fell back to all-reduce plus a separate norm. With FlyDSL INT4 QuickReduce on, route sizes the custom all-reduce declines to QuickAllReduce.fused_allreduce_rmsnorm(gemma_norm=True) when it accepts the operands. QuickAllReduce also builds the fused-norm engines for the model's hidden size at init, so hidden sizes AITER runs on a wider tile (6144) never build them inside profiling or graph capture. Requires ROCm/aiter#6404 for hidden-size 6144 support. Signed-off-by: Aakif Nawaz <[email protected]>
…ue (ROCm#6404) * [FlyDSL] Support hidden 6144 in the INT4 QuickReduce + RMSNorm epilogue The fused add + RMSNorm epilogue reduces each row inside one workgroup, so every bf16 row must sit inside one tile. A 12 KiB row (hidden 6144, e.g. MiniMax-M3) never divides the 32 KiB tile, so those models fall back to all-reduce plus a separate norm. Add a 12-atom (48 KiB) build holding four 6144 rows, selected through a tile_atoms factory parameter; the default 8-atom kernel is unchanged. Wide engines own their own IPC inbox and are built by a collective, on prepare_rmsnorm() or the first fused call; building under CUDA graph capture raises. Their persistent grid is clamped to the CUs' LDS residency. 12 atoms split across TP 2 and 4; TP 8 keeps rejecting 6144. Co-authored-by: Claude (DSH agent) Signed-off-by: Aakif Nawaz <[email protected]> * [FlyDSL] guard QuickReduce RMSNorm soffset range Signed-off-by: Aakif Nawaz <[email protected]> --------- Signed-off-by: Aakif Nawaz <[email protected]>
Motivation
The FlyDSL INT4 QuickReduce all-reduce can fuse the residual add and RMSNorm into its all-gather epilogue. That only works when a whole bf16 row fits in one tile, and a hidden 6144 row (MiniMax-M3) never divides the 32 KiB tile.
supports_rmsnormrejects it, so for these shapes the epilogue never fires: QuickReduce runs the plain all-reduce, followed by a separate norm kernel (and on gfx950 a separate MXFP4 quant). This PR adds a 48 KiB tile that fits four 6144 rows, so the fusion starts firing at TP 2 and 4; TP 8 stays on the unfused path.Technical Details
tile_atomsparameter: 8 is the existing 32 KiB tile, 12 is a new 48 KiB tile that holds four 6144 rows. The default build is unchanged.tile_atoms_for(hidden, world_size)picks the width. Hidden 6144 works at TP 2 and 4; TP 8 stays unsupported.prepare_rmsnorm(hidden)or the first fused call), and refuses to build under CUDA graph capture. Its persistent grid is clamped to the CUs' LDS residency.supports_rmsnormnow needs an instance, because support depends on the number of ranks. vLLM already calls it that way, so nothing breaks.Test Plan
Run the existing multigpu test, which now also covers hidden 6144:
per_1x32_f4_quant_hip.Test Result
MI350X (gfx950): all 17 cases pass at TP 4 and TP 2, including the six new ones. MXFP4 is bitwise equal to the unfused quantizer in every case. SQNR 33.3 dB.
MI325X (gfx942): the same legs pass with the MXFP4 checks skipped (gfx950 only). SQNR ~36.1 dB.
Fused vs unfused at TP 4, hidden 6144, on MI350X. Fused: all-reduce + residual add + RMSNorm in one kernel. Unfused: FlyDSL all-reduce plus separate
rmsnorm2d_fwd_with_add:Fusing the MXFP4 quant as well (gfx950 only) gives 1.12x, 1.05x, 1.06x and 1.07x over all-reduce + norm + separate quant.
End to end (vLLM,
amd/MiniMax-M3-MXFP4, TP 4, MI350X), stacked with FlyDSL QuickReduce, the vLLM routing fix and the FFN all-reduce deferral: +5.3 % output throughput at 60000/600 c64 vs HIP QuickReduce, about +2 % of that from fusing at hidden 6144.