Skip to content

[ASM] [HIP] gfx1250 mha bwd kernel integration - #6454

Merged
slippedJim merged 3 commits into
mainfrom
jim/dev/mha_bwd_mi400
Oct 16, 2026
Merged

slippedJim merged 3 commits into
mainfrom
jim/dev/mha_bwd_mi400

Conversation

@slippedJim

@slippedJim slippedJim commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

integrate mha bwd gfx1250 kernels into AITER

Technical Details

Test Plan

gfx1250 function test
test on a07-3, docker image: rocm/fw-bringup:gfx1250-atom-20260923
amdgpu-dkms 1:7.1.0.31300009-2410483.24.04

iterate all features supported

gfx942 & gfx950 compatibility test

Test Result

gfx1250 function test pass
perf result on shape b4 h64 s8192 d128:
image

gfx950 has bug in mainline, will create another pr to fix
gfx942 smoke test all pass

Submission Checklist

@slippedJim
slippedJim requested review from a team and a balanced review from Copilot October 13, 2026 01:33
@github-actions github-actions Bot changed the title [ASM] gfx1250 mha bwd kernel integration [ASM] [HIP] gfx1250 mha bwd kernel integration Oct 13, 2026
@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 (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
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: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
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 6454 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

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.

🟡 Changes recommended

Public dispatch cannot reach the new gfx1250 paths, and two new benchmark validation modes do not behave as documented.

4 open findings
What changed in this PR

Integrates gfx1250 assembly kernels for MHA backward, including grouped and deterministic execution.

Changes:

  • Adds gfx1250 batch/group kernel configurations.
  • Adds deterministic dQ workspace splitting and conversion.
  • Extends benchmark validation and documentation.
File Description
op_tests/​cpp/​mha/​README.md Documents gfx1250 support and test options.
op_tests/​cpp/​mha/​benchmark_mha_bwd_v3.cpp Adds padding, poisoning, and determinism checks.
hsa/​gfx1250/​fmha_v3_bwd/​fmha_bwd_odo.csv Registers grouped ODO kernel.
hsa/​gfx1250/​fmha_v3_bwd/​fmha_bwd_dqdkdv.csv Registers grouped and deterministic kernels.
hsa/​gfx1250/​fmha_v3_bwd/​fmha_bwd_dq_convert.csv Registers matching conversion kernels.
csrc/​include/​mha_bwd.h Extends kernel argument ABIs and deterministic options.
csrc/​cpp_itfs/​mha_bwd.cu Implements gfx1250 dispatch and workspace handling.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread csrc/cpp_itfs/mha_bwd.cu Resolved
Comment thread op_tests/cpp/mha/README.md Resolved
Copilot AI balanced review requested due to automatic review settings October 14, 2026 12:06

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.

🔵 Needs a closer look

Public routing cannot reach the new gfx1250 paths, batch determinism is discarded, and one kernarg structure contains uninitialized padding.

2 open findings
2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Value-initialize ABI padding fields before kernel launch

csrc/​cpp_itfs/​mha_bwd.cu:490

The removed packer explicitly zero-filled every ABI padding slot, but this declaration leaves all _p* members indeterminate and the launch copies the entire struct into the kernarg buffer. Value-initialize the struct so uninitialized stack bytes are not passed to the runtime and memory-sanitizer checks remain clean.

🧠 Review effort: Balanced

@shay-li77 shay-li77 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.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants