update MHA CPP reademe - #4874
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
There was a problem hiding this comment.
Pull request overview
Updates the C++ MHA benchmark documentation and benchmark hosts to better reflect current v3/asm feature support and performance reporting conventions.
Changes:
- Refresh
op_tests/cpp/mha/README.mdwith updated fwd/bwd v3 argument support tables, clarified mask semantics, and re-measured MI355X performance numbers. - Adjust backward benchmark FLOP accounting to apply the same masked-run FLOP convention used by the forward benchmark hosts.
- Minor comment text normalization in the v3 backward benchmark host.
Reviewed changes
Copilot reviewed 3 out of 7 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| op_tests/cpp/mha/README.md | Updates usage guidance, supported-config tables, and performance result reporting notes/data. |
| op_tests/cpp/mha/benchmark_mha_bwd.cpp | Applies masked-run FLOP reporting adjustment for backward benchmarking. |
| op_tests/cpp/mha/benchmark_mha_bwd_v3.cpp | Same masked-run FLOP reporting adjustment for v3-only backward host; minor comment text updates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| you can also call the executable `fwd.exe` to check whether the arguments are supported by the asm kernel with the `-is_v3_check=1` condition, try following commands: | ||
| ``` | ||
| ./benchmark_mha_fwd -prec=fp16 -b=1 -h=64 -d=128 -s=8192 -iperm=1 -operm=1 -mask=1 -lse=1 -fwd_v3=1 -mode=0 -kname=1 -v=0 -is_v3_check=1 | ||
| ./fwd.exe -prec=bf16 -b=1 -h=64 -d=128 -s=8192 -iperm=1 -operm=1 -mask=1 -lse=1 -fwd_v3=1 -mode=0 -kname=1 -v=0 -is_v3_check=1 |
| // a masked run only computes roughly half the tiles | ||
| if(mask.type != mask_enum::no_mask) | ||
| { | ||
| flop /= 2; | ||
| } |
| // a masked run only computes roughly half the tiles | ||
| if(mask.type != mask_enum::no_mask) | ||
| { | ||
| flop /= 2; | ||
| } |
| A masked run only computes about half the tiles, so both hosts halve their FLOP | ||
| count for `mask != 0`; the `causal=1` rows are on that same convention. |
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist