Skip to content

[k3-455-dev] MLA gfx1250 PS1: port ROCm/aiter#8736 (QH64 code objects, QH96/q5 row packing, row reducer, VGPR hints) - #8743

Merged
gbyu-amd merged 1 commit into
k3-455-devfrom
gyu/k3dev-pr8736
Nov 26, 2026
Merged

gbyu-amd merged 1 commit into
k3-455-devfrom
gyu/k3dev-pr8736

Conversation

@gbyu-amd

Copy link
Copy Markdown
Contributor

Summary

Ports #8736 (head 13b071f) to k3-455-dev as one commit, authored by the PR author. #8736's first commit (#8181 + #7913) is already in k3-455-dev; this carries its commits d9926d2 and 13b071f:

  • QH64 FP8 PS1 code objects for q 1-8 (non round-robin CP): the 64-head draft takes PS1_FP8_ASM.
  • QH96 / q5 row packing in the metadata planner (batch >= 16, profitability check; AITER_MLA_PS1_PACK_ROWS).
  • Row-parallel Dv512 reducer kn_mla_reduce_v1_rows on gfx1250 wave32, max_seqlen_q <= 16.
  • VGPR placement hints (FlyDSL sched_vgpr); QH96 / QH128 code objects regenerated.

Conflicts:

Results

Kimi-K3 DP8 EP8 decode MLA, one MI455X, mla_decode_fwd as ATOM calls it (fp8, page size 1, no LSE, CUDA graph replay with a 2 GiB L2 flush), B 8-128 x context 8k-128k, mean of 2 GPUs; new / old time, below 1 = faster:

call geomean B64: 8k / 16k / 32k / 64k / 128k
target, 96 heads, q1 0.954 1.030 / 1.018 / 1.004 / 0.984 / 1.006
target, 96 heads, q5 0.966 1.022 / 1.004 / 0.953 / 0.902 / 0.881
draft, 64 heads, q4 non-causal 0.930 0.949 / 0.935 / 0.936 / 0.977 / 0.958
draft padded to 96 heads 0.995 0.990 / 0.995 / 0.998 / 0.996 / 1.004
  • Target q1: the gain is the row reducer at B8 / B16 (reduce 12-15 -> 7-9 µs); at B64 / B128 it is 1.5-3.5 µs slower than the current reducers.
  • Target q5: row packing cuts stage 1 by 12-17 % at long contexts (64k-128k at B64), but the packed plan's reduce takes 24-38 µs instead of 9-14 µs, so 8k / 16k cells are up to 5 % slower.
  • Draft at 64 heads: the code objects match FlyDSL JIT (ratio 1.001); the gain comes from the kernel source ([HIP] [FlyDSL] [gfx1250] MLA PS1: take 32/64-head multi-token decode as several qo tiles #7913 update and VGPR hints).
  • Output vs a torch reference (2 requests per case): 0.0 % mismatches in every case, before and after.
  • The squashed commit reruns a 36-case sample within noise of the d9926d2 run.

Tests

  • op_tests/test_mla_flydsl.py: 7 passed.
  • op_tests/test_mla_shape_support.py: 20 passed, 2 skipped. With AITER_MLA_DECODE_PS1_FLYDSL=1 exported, test_decode_agreement fails both before and after this change.
  • black 26.10.1 and ruff 0.16.0: clean.

… VGPR pins (#8736 @ 13b071f, head 2026-11-26T06:02:59Z)

Port of #8736's commits d9926d2 and 13b071f onto k3-455-dev; its
first commit (#8181 + #7913) is already here.

Conflicts:
- mla_pagesize1_fp8_fp8.py: #8736's file. It carries #7913 @ 51bb7c6
  (k3-455-dev had 067fee3), the only difference in that file.
- mla_reduce_kernels.cuh: k3-455-dev's file (keeps #7876 and #7914) plus
  #8736's row-parallel reducer and its dispatch, checked first as in #8736.
@gbyu-amd
gbyu-amd merged commit 5b18892 into k3-455-dev Nov 26, 2026
@gbyu-amd
gbyu-amd deleted the gyu/k3dev-pr8736 branch November 26, 2026 09:19
gbyu-amd added a commit that referenced this pull request Dec 3, 2026
… VGPR pins (#8736 @ 13b071f, head 2026-11-26T06:02:59Z) (#8743)

Port of #8736's commits d9926d2 and 13b071f onto k3-455-dev; its
first commit (#8181 + #7913) is already here.

Conflicts:
- mla_pagesize1_fp8_fp8.py: #8736's file. It carries #7913 @ 51bb7c6
  (k3-455-dev had 067fee3), the only difference in that file.
- mla_reduce_kernels.cuh: k3-455-dev's file (keeps #7876 and #7914) plus
  #8736's row-parallel reducer and its dispatch, checked first as in #8736.

Co-authored-by: xiangM99 <[email protected]>
(cherry picked from commit 5b18892)
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