Repository navigation
[Triton/Gluon] [HIP] [Perf] Fuse gfx1250 AR RMSNorm native MXFP8 - #8310
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
Port of #8310 (925d22b) onto the m3-mi455 perf stack. The stack still has the single _all_reduce_kernel (NORM constexpr, y0..y5 planes), so the NORM 3 branch and _mxfp8_quant_store are added to that kernel and the host wrapper launches it with (n, programs) instead of main's split _all_reduce_rmsnorm_kernel / norm_fits. Co-authored-by: Cursor <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
a581921 to
7ab8944
Compare
…rm + MXFP8 quant On gfx1250 with an aiter that has tensor_model_parallel_fused_allreduce_rmsnorm_mxfp8_quant (ROCm/aiter#8310), the decoder's input and post-attention all-reduce + Gemma RMSNorm hand the native group-32 FP8 QKV and dense-MLP linears E4M3 values with row-major E8M0 scales, so the standalone quantize_fp8 launch before those GEMMs goes away. The bytes equal the separate norm and quantize_fp8. Other linears, archs and aiter builds keep the existing path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rm + MXFP8 quant On gfx1250 with an aiter that has tensor_model_parallel_fused_allreduce_rmsnorm_mxfp8_quant (ROCm/aiter#8310), the decoder's input and post-attention all-reduce + Gemma RMSNorm hand the native group-32 FP8 QKV and dense-MLP linears E4M3 values with row-major E8M0 scales, so the standalone quantize_fp8 launch before those GEMMs goes away. The bytes equal the separate norm and quantize_fp8. Other linears, archs and aiter builds keep the existing path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rm + MXFP8 quant On gfx1250 with an aiter that has tensor_model_parallel_fused_allreduce_rmsnorm_mxfp8_quant (ROCm/aiter#8310), the decoder's input and post-attention all-reduce + Gemma RMSNorm hand the native group-32 FP8 QKV and dense-MLP linears E4M3 values with row-major E8M0 scales, so the standalone quantize_fp8 launch before those GEMMs goes away. The bytes equal the separate norm and quantize_fp8. Other linears, archs and aiter builds keep the existing path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
GPU check of 4a0f73e on 4x MI455X (gfx1250), TP4: this PR's tree (main bf59948 + the two commits), every module JIT-built from it, flydsl 0.5.3.
The previous head (7ab8944, same kernel code) gave the same bytes. It failed only the old dispatch expectation at M = 240 / 256 and the mock comparison of |
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
4a0f73e to
e3eaf80
Compare
|
Rebased onto current main ( Main's #8559 rewrote Checked after the rebase:
Not rerun on the new kernel: the 4-GPU byte comparison and dispatch test ( |
…t runs Re-measured on ROCm#8559's Lamport kernel (this branch's base), the Lamport MXFP8 kernel is as fast as the Gluon MXFP8 kernel or faster at every shape where both run: 4x MI455X, TP4, bf16, CUDA graphs, arms interleaved in one process, hidden 1024-8192 (10 sizes) x 1-256 rows, the Gluon kernel never more than 3% faster. The rule that gave Gluon up to 128 rows while no wave of its program idles (norm_waves_busy) lost up to 21% (1.9 us) against the faster of the two; Lamport first loses nothing. The 4 MiB bound over the Gluon power-of-2 route at hidden up to 1024 (_GLUON_POW2_LAMPORT_MXFP8_MAX_BYTES) also goes: at 1024 x 3072 / 4096 rows (6 / 8 MiB) the Lamport MXFP8 kernel takes 0.89-0.90x the time of fused_allreduce_rmsnorm + per_1x32_mx_quant_hip (it was 1.03-1.04x on the previous kernel). fused_allreduce_rmsnorm_mxfp8_quant now takes Lamport wherever should_lamport_ar_rms holds, else the Gluon MXFP8 kernel where _use_gluon_ar_norm takes the call (now main's gate unchanged), else fused_allreduce_rmsnorm and the quant. norm_waves_busy goes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pushed |
…rm + MXFP8 quant On gfx1250 with an aiter that has tensor_model_parallel_fused_allreduce_rmsnorm_mxfp8_quant (ROCm/aiter#8310), the decoder's input and post-attention all-reduce + Gemma RMSNorm hand the native group-32 FP8 QKV and dense-MLP linears E4M3 values with row-major E8M0 scales, so the standalone quantize_fp8 launch before those GEMMs goes away. The bytes equal the separate norm and quantize_fp8. Other linears, archs and aiter builds keep the existing path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the epilogue quant_type names the quant block (per_Token / per_1x128 / per_1x32) and the new quant_dtype the element type: per_1x32 with fp8 is MXFP8, with fp4x2 (the default, as before) MXFP4. MXFP8 is the first group quant routed through fused_allreduce_rmsnorm_group_quant, with its spec in aiter/dist/ar_rms_group_quant.py: one torch.compile op, one route (Lamport, then Gluon, then the split path) and one Lamport wrapper, all keyed by the group quant, so another group size (1x128) is a table entry and the kernels that have its epilogue. The "mxfp8" name stays an alias; tensor_model_parallel_fused_allreduce_rmsnorm_mxfp8_quant goes. Kernels and bytes unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… per_1x32, quant_dtype E4M3 ROCm/aiter#8310 now takes the epilogue as (quant_type, quant_dtype) and drops the tensor_model_parallel_fused_allreduce_rmsnorm_mxfp8_quant helper. The MXFP8 call goes through tensor_model_parallel_fused_allreduce_rmsnorm_quant(quant_type=per_1x32, quant_dtype=float8_e4m3fn), and the gate asks whether that function takes quant_dtype. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r_rms_quant.py The (quant_type, quant_dtype) pair table, the name aliases, the default element types, the canonicalization and the group-quant specs move into one module, so an epilogue is defined in one place: communication_op keeps the public API and imports it; the torch.compile op, the route and the Lamport wrapper read the specs from it. ar_rms_group_quant.py goes. No behavior change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ilogue enum, not bool mx The FP8 epilogue of lamport_ar_rmsnorm_gfx1250 was a bool template parameter (MX: per-token or MXFP8) and a bool argument of the entry: a third epilogue (FP8 1x128) would take another flag and conditions like QUANT && !MX && !G128. LamportRmsQuant names the epilogue instead (kPerToken, kMxfp8): one template parameter, a switch in the dispatch (-Wswitch flags a missing case), a static_assert in the kernel for an enumerator without its branch, and lamport_rms_quant_of reads it from the scale's layout in one place. Same kernels: every instantiation's ISA and kernel descriptor are identical to before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd group quants lamport_fused_ar_rms_group_quant folds into lamport_fused_ar_rms_quant: quant=None is the per-token FP8 quant as before (same call, same outputs, emit_bf16), a group quant spec lays out its outputs from the spec. Both call the same C++ entry, which picks the epilogue by the scale's layout (LamportRmsQuant); emit_bf16 stays per-token only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s quant_dtype ATOM runs on aiter main, whose fused AR + RMSNorm takes `quant_dtype` since ROCm/aiter#8310. The helper passes it for every quant, and the MXFP8 gate no longer asks whether aiter has it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rm + MXFP8 quant On gfx1250, MiniMax-M3's decoder hands its native group-32 E4M3FN QKV and dense-MLP linears E4M3 values and row-major E8M0 scales straight from aiter's fused all-reduce + Gemma RMSNorm + quant (ROCm/aiter#8310), so the standalone quantize_fp8 launch before those GEMMs goes away. - fused_allreduce_gemma_rms_norm_quant takes (quant_type, quant_dtype) as aiter's op does: "per_token" FP8 by default, or "per_1x32" with float8_e4m3fn for MXFP8; any other pair raises. It passes quant_dtype to aiter on every call. At TP 1 it runs the norm and then the same quant (quantize_fp8 for MXFP8). - fused_allreduce_gemma_rms_norm_mxfp8_supported(linear) gates MXFP8: gfx1250, and a linear that reads native E4M3FN with group-32 E8M0 scales and does not run in BF16. Each decoder layer decides it once at construction, and _fused_ar_rms_quant picks the quant of each fused norm. - tests/test_minimax_m3_mxfp8_fused_ar.py loads atom.model_ops.layernorm through aiter_stub.atom_without_aiter, so it runs in the CPU job: the gate (1x32 and 32x32 weight scales), the helper's per-token and MXFP8 calls and their scale shapes, TP 1 MXFP8 (the norm, then quantize_fp8), and the pairs it refuses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Extend the pushed two-shot AR + RMSNorm (ar2s_rms_gfx1250) with ar2s_rms_ex
and three modes, exposed as sequence-parallel tensor_model_parallel_sp_* ops
for prefill:
- FP8: the norm output is written as MXFP8 (E4M3 + row-major E8M0 per 32),
the bytes per_1x32_mx_quant_hip gives for the bf16 out (the group max is
floored at kAmaxFloor as there, so an all-zero group gets scale 85).
- SP: each rank keeps the residual of its own row chunk only; the owner
normalizes (and quantizes) its rows and pushes the result, so the
all-gather moves MXFP8 and phase 3 is a copy. The normed output is whole
on every rank and bit-identical to the replicated path.
- AUX (with SP): no norm, the whole all_reduce(x) + residual on every rank.
tensor_model_parallel_sp_fused_allreduce_rmsnorm{,_mxfp8_quant} and
tensor_model_parallel_sp_allreduce_add_residual take the SP path at the ar2s
sizes and are the replicated ops below it, so every call of a forward takes
the same branch (mutates_args=[]).
The TP4 per-launch cap is 192 MiB, one launch for a 14336-token chunk of
hidden 6144.
TP4, hidden 6144, Gemma norm, 4x MI455X: AR + RMSNorm + MXFP8 at 14336 rows
347 -> 226 us a call (SP + MXFP8 all-gather vs ar2s + separate quant);
sp_fp8 at 14336 / 32768 rows 189.0 / 401.2 us, bit-exact.
On top of ROCm#8427 at 0c78341 (the review round there), adapted as follows:
- The SP gate (ar2s_sp_eligible) takes the replicated route's measured
hidden range (_AR2S_RMS_HIDDEN, 4096-7168) in whole 512-element groups,
which the MXFP8 output needs.
- The replicated MXFP8 fallback calls main's
fused_allreduce_rmsnorm_group_quant(..., "mxfp8") (ROCm#8310 renamed it).
- The 192 MiB cap keeps ROCm#8427's AITER_CUSTOM_AR_AR2S_RMS_MAX_SIZE
override; the routing test's default is 192 MiB.
- ROCm#8427 now carries op_tests/multigpu_tests/test_ar2s_rms_gfx1250.py (the
replicated route); this PR's test and benchmark of the ex modes moves to
test_ar2s_rms_ex_gfx1250.py, on main's public MXFP8 op
(tensor_model_parallel_fused_allreduce_rmsnorm_quant with
quant_type="per_1x32", quant_dtype=fp8), ruff-clean.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rm + MXFP8 quant On gfx1250, MiniMax-M3's decoder hands its native group-32 E4M3FN QKV and dense-MLP linears E4M3 values and row-major E8M0 scales straight from aiter's fused all-reduce + Gemma RMSNorm + quant (ROCm/aiter#8310), so the standalone quantize_fp8 launch before those GEMMs goes away. - fused_allreduce_gemma_rms_norm_quant takes (quant_type, quant_dtype) as aiter's op does: "per_token" FP8 by default, or "per_1x32" with float8_e4m3fn for MXFP8; any other pair raises. It passes quant_dtype to aiter on every call. At TP 1 it runs the norm and then the same quant (quantize_fp8 for MXFP8). - fused_allreduce_gemma_rms_norm_mxfp8_supported(linear) gates MXFP8: gfx1250, and a linear that reads native E4M3FN with group-32 E8M0 scales and does not run in BF16. Each decoder layer decides it once at construction, and _fused_ar_rms_quant picks the quant of each fused norm. - tests/test_minimax_m3_mxfp8_fused_ar.py loads atom.model_ops.layernorm through aiter_stub.atom_without_aiter, so it runs in the CPU job: the gate (1x32 and 32x32 weight scales), the helper's per-token and MXFP8 calls and their scale shapes, TP 1 MXFP8 (the norm, then quantize_fp8), and the pairs it refuses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Extend the pushed two-shot AR + RMSNorm (ar2s_rms_gfx1250) with ar2s_rms_ex
and three modes, exposed as sequence-parallel tensor_model_parallel_sp_* ops
for prefill:
- FP8: the norm output is written as MXFP8 (E4M3 + row-major E8M0 per 32),
the bytes per_1x32_mx_quant_hip gives for the bf16 out (the group max is
floored at kAmaxFloor as there, so an all-zero group gets scale 85).
- SP: each rank keeps the residual of its own row chunk only; the owner
normalizes (and quantizes) its rows and pushes the result, so the
all-gather moves MXFP8 and phase 3 is a copy. The normed output is whole
on every rank and bit-identical to the replicated path.
- AUX (with SP): no norm, the whole all_reduce(x) + residual on every rank.
tensor_model_parallel_sp_fused_allreduce_rmsnorm{,_mxfp8_quant} and
tensor_model_parallel_sp_allreduce_add_residual take the SP path at the ar2s
sizes and are the replicated ops below it, so every call of a forward takes
the same branch (mutates_args=[]).
The TP4 per-launch cap is 192 MiB, one launch for a 14336-token chunk of
hidden 6144.
TP4, hidden 6144, Gemma norm, 4x MI455X: AR + RMSNorm + MXFP8 at 14336 rows
347 -> 226 us a call (SP + MXFP8 all-gather vs ar2s + separate quant);
sp_fp8 at 14336 / 32768 rows 189.0 / 401.2 us, bit-exact.
On top of ROCm#8427 at 0c78341 (the review round there), adapted as follows:
- The SP gate (ar2s_sp_eligible) takes the replicated route's measured
hidden range (_AR2S_RMS_HIDDEN, 4096-7168) in whole 512-element groups,
which the MXFP8 output needs.
- The replicated MXFP8 fallback calls main's
fused_allreduce_rmsnorm_group_quant(..., "mxfp8") (ROCm#8310 renamed it).
- The 192 MiB cap keeps ROCm#8427's AITER_CUSTOM_AR_AR2S_RMS_MAX_SIZE
override; the routing test's default is 192 MiB.
- ROCm#8427 now carries op_tests/multigpu_tests/test_ar2s_rms_gfx1250.py (the
replicated route); this PR's test and benchmark of the ex modes moves to
test_ar2s_rms_ex_gfx1250.py, on main's public MXFP8 op
(tensor_model_parallel_fused_allreduce_rmsnorm_quant with
quant_type="per_1x32", quant_dtype=fp8), ruff-clean.
Co-Authored-By: Claude Opus 5.5 <[email protected]>

What
tensor_model_parallel_fused_allreduce_rmsnorm_quant(quant_type=QuantType.per_1x32, quant_dtype=dtypes.fp8)(orquant_type="mxfp8"): all-reduce + residual add + (Gemma) RMSNorm with native group-32 MXFP8 output, E4M3 values and row-major E8M0 scales of shape(tokens, hidden // 32). The bytes are those of the AR + RMSNorm kernel the route runs followed byper_1x32_mx_quant_hip(quant_dtype=fp8, scale_type=fp8_e8m0).API.
quant_typenames the quant block and the new keywordquant_dtypethe element type, as aiter's quant ops take them:per_1x32withfp8is MXFP8, withfp4x2MXFP4.quant_dtype=Nonekeeps what eachquant_typemeant before (per_1x32is MXFP4, the others FP8), so existing callers are unchanged; a format name gives both ("mxfp4","mxfp8"); any other pair raisesValueErrorwith the supported ones. The epilogues are defined in one module,aiter/dist/ar_rms_quant.py: the table of supported pairs and the route each takes (QUANTS), the names and defaults, the canonicalization, and the group-quant specs (GROUP_QUANTS: group size, element type, scale type). MXFP8 is the first group quant: one torch.compile op (fused_allreduce_rmsnorm_group_quant_, its fake shaped by the spec), one route (CudaCommunicator.fused_allreduce_rmsnorm_group_quant) and and the Lamport wrapper (lamport_fused_ar_rms_quant, which takes the spec asquant; without it, the per-token quant as before), all keyed by it. Another group size (e.g. FP8 1x128) is then entries in that module and the kernel epilogues that have it, not a new set of entry points.On gfx1250 it is one launch wherever a one-shot fused kernel takes the call:
lamport_ar_rmsnorm_gfx1250([HIP] fea: gfx1250 Lamport AR + RMSNorm: split sends, preloaded arguments, faster reductions #8559's kernel) gets an MXFP8 epilogue (as [Triton/Gluon] [HIP] gfx1250 all-reduce + RMSNorm + per-token FP8 in one kernel #8022 added per-token FP8), taken wherevershould_lamport_ar_rmsholds (TP2 / TP4, hidden a multiple of 256 up to 8192, up to the Lamport cap, 8 MiB at TP4). A group of 32 is pack k of four neighbouring lanes; the amax starts atkAmaxFloorand uses main'slamport_xor_lane, the scale isfp_f32_to_e8m0_scale<RoundUp>capped at 2^127 andv_cvt_scalef32_pk8_fp8_{bf16,f16}converts: the steps and helpers ofper_1x32_mx_quant_hip. The epilogue is the kernel'sLamportRmsQuanttemplate parameter (kPerToken,kMxfp8; another one is an enumerator and its branch), and the C++ entryfused_allreduce_rmsnorm_quant_lamportreads it from the scale's layout (lamport_rms_quant_of: one FP32 a row, or one E8M0 a group of 32): no new pybind orcompile_opssymbol.QUANT=2), taken where_use_gluon_ar_normholds (main's gate, unchanged), e.g. hidden 2880.fused_allreduce_rmsnormand then the quant.QuantType.per_1x32keeps meaning MXFP4; existing quant types and archs keep their routes.Why
MXFP8 GEMM consumers (native-MXFP8 QKV and dense linears) paid a separate quant launch after every AR + RMSNorm. In one launch the route takes 0.21-0.90x the time of
fused_allreduce_rmsnorm+per_1x32_mx_quant_hip(97 shapes, never slower).Evidence
Setup: 4x MI455X (gfx1250), TP4, bf16 in, Gemma RMSNorm, the Gluon all-reduce on, on this head's code. Each arm is a CUDA graph of 10 calls on distinct inputs inside aiter's
graph_capture; 21 ABAB rounds after 2 warm-up rounds, median, max over ranks; us per call. All arms of a hidden size run in one process; an A/A arm (a second graph of the route) gates each shape, which is re-measured when it differs by more than 5% (the tray is shared).Measured: hidden 1024 / 2048 / 2560 / 3072 / 3584 / 4096 / 5120 / 6144 / 7168 / 8192 x rows 1 / 8 / 16 / 32 / 64 / 128 / 129 / 192 / 256, plus 1024 x 1024 / 2048 / 3072 / 4096 and 2048 x 1024 / 1536 / 2048 (up to the 8 MiB cap), and 2880 x 1 / 16 / 64; the table shows a subset. ("main" at 8192 takes the Gluon power-of-2 kernel, as main's bf16 route does with the Gluon all-reduce on; with it off, main's route is the next column, Lamport then the quant.)
Bytes: Lamport MXFP8 vs Lamport +
per_1x32_mx_quant_hip, and Gluon MXFP8 vs the Gluon per-token kernel (bf16 out) +per_1x32_mx_quant_hip: every byte of out, scale and residual of the last call of each graph above, 190 comparisons, 0 bytes differ. The MXFP8 instantiation keeps the squares of the RMSNorm sum unfused, as the bf16 / per-token instantiations compile them; left to the compiler it fused them into FMAs and fp16 rows differed in rare last bits.Notes
_use_gluon_ar_normstay as on main: with the Gluon all-reduce on (AITER_GLUON_FUSED_AR=1, which ATOM sets by default throughATOM_ENABLE_GLUON_FUSED_AR), they keep main's choice between the Gluon kernels and the Lamport one-shot. A deployment that wants the Lamport one-shot on those routes wherever it runs turns the Gluon all-reduce off (in ATOM,ATOM_ENABLE_GLUON_FUSED_AR=0). The MXFP8 route takes Lamport first either way.fused_allreduce_rmsnormtakes another kernel than the MXFP8 route (the Gluon kernels at power-of-2 hidden on main), the MXFP8 bytes are not those offused_allreduce_rmsnorm+ quant there, as for the per-token route.78c98fc21, the parent of the routing commit; that commit changes Python only): the module builds for gfx942, gfx950 and gfx1250; main's 563 gfx1250 kernels keep byte-identical ISA and metadata, and the 40 new MXFP8 kernels use no scratch.Tests
tests/test_ar_rmsnorm_routing.py(CPU),pytest tests/test_ar_rmsnorm_routing.py: 70 passed at89a7e15ef.test_mxfp8_route: Lamport at 6144 x 1 / 128 / 129 rows, 7168 x 1, 4096 x 513 and power-of-2 1024 x 2048 / 4096 rows (4 / 8 MiB); the split path past the Lamport cap (1024 x 4097, 6144 x 683); the Gluon MXFP8 kernel at a non-Lamport hidden (2880), the split path there without the Gluon all-reduce; the Lamport wrapper gets the MXFP8 spec, the split quant E4M3 / E8M0.test_quant_type_and_dtype_pick_one_route: every spelling of each supported pair (string,QuantType, its int value, format name, with and withoutquant_dtype) takes the same route; a format name with another element type, an unsupported pair and an unknown name raise.test_each_group_quant_route_is_its_pair,test_the_group_quant_fake_follows_its_spec: the pair table and the group-quant specs agree; the torch.compile fake has the spec's shapes and dtypes.op_tests/multigpu_tests/triton_test/test_all_reduce_rmsnorm_quant.py(4 GPUs), the whole file: 3 passed at537cb958aand again at89a7e15ef(4x MI455X). Intest_fused_allreduce_rmsnorm_dispatch, through the public API, the MXFP8 call takes the expected kernel (wrapped) and its bytes equal that kernel's AR + RMSNorm followed byper_1x32_mx_quant_hip: Lamport at 6144 x 1 / 128, 7168 x 64 (split sends), 6144 x 192 / 512 (four / eight packs a thread) and 1024 x 4096 (8 MiB); Gluon at 2880 x 1. Since1cb5eb802it calls the API asquant_type=QuantType.per_1x32, quant_dtype=dtypes.fp8and wrapslamport_fused_ar_rms_quant.PR Self-Review
Reviewed revision
89a7e15
Behavior and intent
The fused AR + RMSNorm entry points take the epilogue as (
quant_type,quant_dtype);quant_dtype=Nonekeeps every existing call's meaning. They gain MXFP8 (per_1x32with FP8, or"mxfp8"), run on gfx1250 in one launch wherever a one-shot fused kernel takes the call, instead of AR + RMSNorm and a separateper_1x32_mx_quant_hip: the Lamport one-shot (HIP, new MXFP8 epilogue) first, wherevershould_lamport_ar_rmsholds, because measured it is the faster MXFP8 kernel at every shape where both run; else the Gluon AR + RMSNorm kernel (QUANT=2) where main's_use_gluon_ar_normtakes the call; else the split path. Other quant types, archs and the bf16 / per-token routes are unchanged.Validation and unverified scope
At
537cb958a(4x MI455X, TP4, bf16, the Gluon all-reduce on):python3 -m pytest op_tests/multigpu_tests/triton_test/test_all_reduce_rmsnorm_quant.py tests/test_ar_rmsnorm_routing.py: 46 passed (3 on 4 GPUs, 43 on CPU).At
1cb5eb802and31ee61f71(the API commits, Python only):tests/test_ar_rmsnorm_routing.py67 passed (CPU); black and ruff clean on the changed files.At
00ef84687(C++ refactor:bool MX/bool mxbecomeLamportRmsQuant): the module compiled for gfx1250 before and after with its JIT flags; all 603 kernels, the 120lamport_ar_rmsnorm_gfx1250instances among them, have identical instructions and kernel descriptors (607,376 instruction lines and 603 descriptors compared, names differing only in the epilogue's template argument); the host + device compile succeeds with the same warnings as before.At
89a7e15ef(Python only: one Lamport quant wrapper):tests/test_ar_rmsnorm_routing.py70 passed (CPU), with the wrapper's per-token and MXFP8 output layouts and its emit_bf16 refusal; black and ruff clean.At
89a7e15efon 4x MI455X (TP4,AITER_GLUON_FUSED_AR=1):pytest op_tests/multigpu_tests/triton_test/test_all_reduce_rmsnorm_quant.py tests/test_ar_rmsnorm_routing.py73 passed (3 on 4 GPUs, the MXFP8 calls taking the expected kernel with the bytes of its AR + RMSNorm andper_1x32_mx_quant_hip; 70 on CPU). The timing sweep is from537cb958a; the commits since change no kernel code (00ef84687keeps every kernel's ISA).Not run: TP2 and fp16 (the Lamport MXFP8 kernel is instantiated for both; the Gluon route is TP4 / bf16-only), TP6 / TP8, hidden sizes outside 1024-8192 other than 2880, gfx950 and older archs (route unchanged there).
PR-specific question
The Lamport MXFP8 kernel is selected only where
should_lamport_ar_rmsholds: gfx1250 (the Lamport inbox exists only there), bf16 / fp16 in, hidden a multiple of 256 up to 8192, contiguous operands, input within the Lamport cap; the C++ entry checks the E8M0 scale's element count (rows x hidden / 32), contiguity and device, and rejects a bf16 output pointer. TheLamportRmsQuanttemplate parameter defaults tokPerToken, so other instantiations cannot reach the MXFP8 epilogue; an enumerator without its kernel branch fails to compile (static_assert), and the dispatchswitchwarns on a missing case. The Gluon mode is selected only where Lamport cannot run and_use_gluon_ar_normholds (TP4, bf16, contiguous, up to 4 MiB).Changed op tests
op_tests/multigpu_tests/triton_test/test_all_reduce_rmsnorm_quant.py,test_fused_allreduce_rmsnorm_dispatch: about 50 lines. It checks that the MXFP8 call takes the Lamport kernel wherever Lamport runs (including a power-of-2 hidden at the 8 MiB cap) and the Gluon kernel where it cannot (2880), and that its bytes equal that kernel's AR + RMSNorm followed byper_1x32_mx_quant_hip. It fails before this PR (quant_type="mxfp8"raised, and no Lamport MXFP8 route existed). No other test covers MXFP8 out of the fused op. It calls the API asquant_type=QuantType.per_1x32, quant_dtype=dtypes.fp8.🤖 Generated with Claude Code