Repository navigation
[HIP] Speed up gfx1250 two-stage AR RMSNorm FP8 amax reduction - #7080
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
Summary
Parallelize the cross-wave amax reduction in the gfx1250 two-stage fused
all-reduce + residual + RMSNorm + per-token FP8 epilogue.
Instead of thread 0 folding the wave partials serially, the first wave loads
the nonnegative amax partials and reduces them with wave shuffles. Unused
lanes contribute zero; at most 32 wave32 partials fit in that wave.
custom_all_reduce_gfx1250.cuh. gfx942/gfx950 implementations are untouched; no runtime validation on those architectures is claimed.Tracking:
This is a partial FP8 second-stage improvement, not a claim to close the entire model-level performance gap.
Performance
Measured on 2026-10-28 UTC, 4 x gfx1250, 256 CU/device, TP4.
Baseline:
9b7bb36ad9bead63ff0931bbd098a27aac2453bb.Candidate:
7d9ae81a08ef81ad29cc9b0f4b387030c380d6d4.Image:
rocm/fw-bringup-mlperf:gfx1250-atom-20261023.PyTorch:
2.11.0+rocm10.1.0a20260811-bkc.20260820; reported HIP:7.16.26315.Separate source checkouts, containers and JIT caches; GPU process checks
before runs. Three runs per side, interleaved base/opt, opt/base, base/opt.
Each graph contains 16 calls; three profiled replays provide 48 second-stage
events per rank. Reported latency is the median across three runs of the
median of the four rank-local kernel medians.
For MiniMax-M3's [2517,6144] BF16-input/FP8-output case:
The large 6144-hidden FP8 cases improve by about 5%; 8192-hidden is effectively
unchanged. The 512-row measurements have more relative variability and are
not the primary performance claim. No-quant BF16 is an unchanged control.
These are second-stage kernel timings, not full-collective or model
throughput speedups. No full-model throughput or GSM8K validation is claimed.
Rejected grid/thread-count candidates are not included.
Correctness
The new regression is added to the existing
op_tests/multigpu_tests/test_fused_ar_rms.py, using public dispatching APIs,@benchmark,run_perftest,checkAllclose, and per-rank markdown tableswith latency, logical TFLOPS/TB/s and error columns.
The identical test passed on baseline and candidate (one pytest test,
internally sweeping 8 shapes x 2 input dtypes x 2 norm modes x 2 output modes
on all four ranks):
[513,6176], [513,6160], [2048,8192].
scales and the optional BF16/FP16 mirror.
An additional 7-shape x 2-output-mode sweep passed. Saved rank-0 norm/FP8,
residual and scale tensors matched baseline bit-for-bit in all 14 cases;
each run independently checked cross-rank agreement.
Reproduction
In the described ROCm environment:
All listed checks passed. Raw traces, timing samples and exploratory drivers
remain outside the repository; no generated artifacts or benchmark reports
are added under docs.