Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The raw mha_v4 path rejects FP16 inputs, breaking the previously supported --kernel mha4_mxfp8 --e2e --dtype fp16 benchmark mode.
1 open issue
What changed in this PR
This PR routes the MXFP8 end-to-end attention benchmark through mha_v4, so timing includes the K-smoothing gate and public wrapper overhead.
Changes:
- Replace direct quantization and packed execution in
mha4_mxfp8 --e2ewithmha_v4. - Pass the MXFP8 scale modes as named arguments.
- Leave kernel-only benchmarking unchanged.
| File | Description |
|---|---|
op_tests/op_benchmarks/triton/bench_sage.py |
Route MXFP8 end-to-end timing through the public attention wrapper. |
Review effort: Balanced
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 |
619ac9c to
21833e1
Compare
Every other mha4 recipe's --e2e calls mha_v4, which is what models call; mha4_mxfp8 called its producers and mha_v4_packed directly, so it skipped the K-mean smoothing gate and the raw API's host path, and its e2e numbers were not comparable with the other recipes'. Kernel-only mode keeps the producers. Same output (cosine 0.99956 against BF16 either way). gfx950, mha4_mxfp8 hd128 --e2e (median of 3), before / after: h16 s4096 92.6 us / 122.2 us h5 s65536 3.788 ms / 3.814 ms Signed-off-by: jcaraban <jcaraban@amd.com>
21833e1 to
8a55175
Compare

Summary
Stacked on #7754.
bench_sage --kernel mha4_mxfp8 --e2ecalled the producers andmha_v4_packeddirectly, unlike every othermha4_*recipe; it now callsmha_v4, so it includes the K-smoothing gate and host path real callers pay. Kernel-only mode is unchanged.Performance
MI355X,
mha4_mxfp8hd128--e2e, median of 3: b1 h16 s4096 92.6 -> 122.2 us, b1 h5 s65536 3.788 -> 3.814 ms (the cost now measured, not a regression).PR Self-Review
Reviewed revision
619ac9ce562cBehavior and intent
For BF16 inputs,
--e2eformha4_mxfp8measuresmha_v4, including the K-smoothing gate, like the othermha4_*recipes. FP16 retains the previous packed-producer path.Validation and unverified scope
MI355X on
f926eca(before the FP16 fallback; current head has not been GPU-validated):bench_sage.py --kernel mha4_mxfp8 --b 1 --hq 16 --hk 16 --sq 4096 --sk 4096 --d 128 --dv 128 --report-quality, with and without--e2e: cosine 0.99956 both, hd128 MXFP8 object loaded. Black/Ruff pass. Unverified: CI does not runbench_sage.py; MXFP8 is gfx950-only, so no MI300X run.PR-specific question
bench_sage.pyis a benchmark, not a correctness test: before this PR itsmha4_mxfp8 --e2eskipped the K-smoothing gate and under-reported end-to-end time against realmha_v4callers.Changed op tests
op_tests/op_benchmarks/triton/bench_sage.py: benchmark only; routes themha4_mxfp8 --e2erunner throughmha_v4like the other recipes.