Skip to content

update MHA CPP reademe - #4874

Open
minmengdie wants to merge 3 commits into
mainfrom
mmd/dev/mha_readme
Open

update MHA CPP reademe#4874
minmengdie wants to merge 3 commits into
mainfrom
mmd/dev/mha_readme

Conversation

@minmengdie

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@minmengdie
minmengdie requested review from a team and a lite review from Copilot August 20, 2026 06:32
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 4874 --add-label <label>

PR title tags:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf] and op tags like [MLA] are left untouched. Add the no-auto-title label to opt this PR out of title tagging.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md with 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.

Comment on lines +58 to +60
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
Comment on lines +338 to +342
// a masked run only computes roughly half the tiles
if(mask.type != mask_enum::no_mask)
{
flop /= 2;
}
Comment on lines +940 to +944
// a masked run only computes roughly half the tiles
if(mask.type != mask_enum::no_mask)
{
flop /= 2;
}
Comment on lines +129 to +130
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants