Skip to content

[FlyDSL] [gfx1250] mx32 GEMM: the _pl K loop also runs at tile_k = 128 (on #7668) - #8058

Open
yhl-amd wants to merge 14 commits into
ROCm:mainfrom
yhl-amd:hyi/gfx1250-mx32-pl-tile-k128
Open

yhl-amd wants to merge 14 commits into
ROCm:mainfrom
yhl-amd:hyi/gfx1250-mx32-pl-tile-k128

Conversation

@yhl-amd

@yhl-amd yhl-amd commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Update (12-04): re-stacked on the current #7668 dde80aaad (on main 4052b38ae; it was on #7668's 11-17 head 292a532f8); head c4edcc4fa, previous head 091be1d9e kept as bak/8058-pre1204a. The only conflict was again the PIPELINED_CASES comment: #7668 now compares a name without _pl (single-fence loop) with the same name plus _pl, so the _nopl wording is gone and this PR's tile_k = 128 cases are listed in that comment.

Validation of the rebased heads, CPU only: black --check, ruff check and py_compile on every changed file. The CPU op tests that import aiter's built modules were not rerun at these heads.

Stacked on #7668 (which is on #7667); only the last commit is new here. Please merge #7667, then #7668; this PR will be rebased onto main after that.

Motivation

The software-pipelined K loop (_pl kernel names, #7668) was limited to tile_k >= 256. Some 128-deep tiles are ahead of the current selection once they run the pipelined loop: at the DSv4.1 wq_b decode key (M, N, K) = (1344, 32768, 1280), t224x256x128 mw2 nw2 nb3 _pl is ahead of main's tuned row (t128x256x128 mw1 nw4 nb3) and of the same tile without _pl (relative timings on gfx1250 in the PR comments). Not every 128-deep tile gains: at the batched wo_a key (b, M, N, K) = (8, 1344, 1024, 4096), t96x256x128 mw1 nw4 nb3 _pl stays behind main's selection, so it is only a correctness case here.

This PR adds no tuned rows; it only lets a tuned row name a 128-deep _pl tile.

Technical Details

  • check_pipelined_k_loop no longer requires tile_k >= 256 (the tile_k argument is dropped). With one 128-deep k-step per K-tile the loop only takes its last-k-step branch: the stage is refilled and the next tile's first fragments are read during the second half of the current tile's WMMAs, behind the same split fence. Every accumulator still sees its k-steps in the same order with the same operands, so the output is bit-identical to the single-fence loop.
  • Only a kernelName that ends in _pl selects the loop, so existing tuned rows and the default selection are unchanged. No new environment variables.

Test Plan

  • op_tests/test_gemm_host_dispatch_cache.py: the tile_k rejection test is removed; the remaining rejections (non-mx32, scale preload, cluster, split-K, values other than 0/1) are kept.
  • op_tests/test_flydsl_batched_gemm.py (gfx1250): PIPELINED_CASES adds tile_k = 128 cases compared bit for bit with the single-fence loop: b=8, M=1344, 1024 x 4096 (t96x256x128 mw1 nw4 nb3), b=1, M=1344, 32768 x 1280 (t224x256x128 nb3) and a ragged-K case (t64x128x128, K = 576).

Test Result

  • gfx1250: all pipelined cases (old and new) are bit-exact against the single-fence loop; the fused-quant epilogue checks are unchanged.

PR Self-Review

Reviewed revision

c4edcc4

Behavior and intent

Validation and unverified scope

  • gfx1250 at 57628f0b1 (same code as this head; the head differs only in [FlyDSL] [gfx1250] mx32 GEMM: software-pipelined K loop; DSv4.1 rows use it #7668's CSV-value commit underneath): python op_tests/test_flydsl_batched_gemm.py exits 0. All seven PIPELINED_CASES, including the three tile_k = 128 ones, report 0 mismatches against the single-fence loop; the fused quant epilogue reports all bit-exact. python -m pytest op_tests/test_gemm_host_dispatch_cache.py op_tests/test_bmm_a8w8_fused_quant_tuned_row.py op_tests/test_bmm_a8w8_fused_quant_supported.py passes.
  • gfx1250 timing of the two decode keys above (main's selection, the tile_k = 128 _pl tile, the same tile without _pl, and main's tile with _pl where it is 128 deep), run_perftest with the tuner's default warmup / iterations, several processes with alternating order; all candidates give the same output as main's selection. Relative results are in the PR comments.
  • black and ruff clean on the changed files.
  • Unverified: no tuned row uses a 128-deep _pl tile, so no end-to-end run exercises it; gfx950 was not re-run at this head (the change is in the gfx1250 kernel only). CI has no gfx1250 runner for these FlyDSL op tests.

PR-specific question

Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?

Changed op tests

  • op_tests/test_bmm_a8w8_fused_quant_tuned_row.py: comes from [FlyDSL] [gfx1250] Batched mxfp8 GEMM fused-quant epilogue: quantize from the accumulators, use the tuned row #7667 (CPU test of the fused entry's tuned-row lookup); unchanged here.
  • op_tests/test_gemm_host_dispatch_cache.py (CPU): drops the tile_k < 256 rejection case, which no longer holds; the other rejection cases stay. It is the CPU check of the _pl validation that runs in CI.
  • op_tests/test_flydsl_batched_gemm.py (gfx1250): three tile_k = 128 entries in PIPELINED_CASES (a batched decode shape, a 2-D decode shape and a ragged K), each compared bit for bit with the single-fence loop. Not redundant: the existing cases all use tile_k = 256, where the loop also takes its middle-k-step branch; with tile_k = 128 only the last-k-step branch runs, which no other case covers.

🤖 Generated with Claude Code

@yhl-amd
yhl-amd requested a review from a team November 16, 2026 18:18
@yhl-amd yhl-amd added the FlyDSL label Nov 16, 2026
@aiter-bot

aiter-bot commented Nov 16, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision c4edcc4fa294 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

- Branch: #7667 and #7668 as they are now (head of #7668: `dde80aaad`) plus one commit. Rebased from the previous #7668 head; the only conflict was the `PIPELINED_CASES` list and its comment in `op_tests/test_flydsl_batched_gemm.py`, where both sides were kept (#7668's three- and four-buffer cases and this PR's `tile_k = 128` cases). Later rebased onto #7668's head `292a532f8`; the only conflict was again the `PIPELINED_CASES` comment, and the cases now compare `_nopl` with `_pl`. The default pick for names without a suffix still needs tile_k >= 256, so a 128-deep tile runs the pipelined loop only when its name ends in `_pl`.
- Before: a `_pl` kernelName with `tile_k = 128` raises in `check_pipelined_k_loop`.
- After: it runs the pipelined K loop and gives the same bits as the same tile without `_pl`. Nothing selects such a name today: no tuned row in the tree names a 128-deep `_pl` tile, and the heuristics never append `_pl`.

Validation and unverified scope

- gfx1250 at `57628f0b1` (same code as this head; the head differs only in #7668's CSV-value commit underneath): `python op_tests/test_flydsl_batched_gemm.py` exits 0. All seven `PIPELINED_CASES`, including the three `tile_k = 128` ones, report 0 mismatches against the single-fence loop; the fused quant epilogue reports all bit-exact. `python -m pytest op_tests/test_gemm_host_dispatch_cache.py op_tests/test_bmm_a8w8_fused_quant_tuned_row.py op_tests/test_bmm_a8w8_fused_quant_supported.py` passes.
- gfx1250 timing of the two decode keys above (main's selection, the `tile_k = 128` `_pl` tile, the same tile without `_pl`, and main's tile with `_pl` where it is 128 deep), `run_perftest` with the tuner's default warmup / iterations, several processes with alternating order; all candidates give the same output as main's selection. Relative results are in the PR comments.
- black and ruff clean on the changed files.
- Unverified: no tuned row uses a 128-deep `_pl` tile, so no end-to-end run exercises it; gfx950 was not re-run at this head (the change is in the gfx1250 kernel only). CI has no gfx1250 runner for these FlyDSL op tests.

PR-specific question

Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?

- This PR's own commit changes no configuration file. The configuration change in this branch comes from #7668: `dsv41_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv` rows `gfx1250, cu_num 256, 32x32, (M, N, K)` = `(576, 32768, 1280)` and `(768, 32768, 1280)`, replaced in place with `_pl` rows; see #7668.
- Unrelated shapes: the commit here only relaxes a check for kernelNames that end in `_pl` with `tile_k = 128`. No row or heuristic produces such a name, so every shape keeps its selection; without `_pl`, the kernel compiles exactly as before.

Changed op tests

- `op_tests/test_bmm_a8w8_fused_quant_tuned_row.py`: comes from #7667 (CPU test of the fused entry's tuned-row lookup); unchanged here.
- `op_tests/test_gemm_host_dispatch_cache.py` (CPU): drops the `tile_k < 256` rejection case, which no longer holds; the other rejection cases stay. It is the CPU check of the `_pl` validation that runs in CI.
- `op_tests/test_flydsl_batched_gemm.py` (gfx1250): three `tile_k = 128` entries in `PIPELINED_CASES` (a batched decode shape, a 2-D decode shape and a ragged K), each compared bit for bit with the single-fence loop. Not redundant: the existing cases all use `tile_k = 256`, where the loop also takes its middle-k-step branch; with `tile_k = 128` only the last-k-step branch runs, which no other case covers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • FAIL — Aiter Test Gate: failed
  • Required CI failed; fix it before requesting human review.

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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 Radeon R9700 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 8058 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@zufayu
zufayu requested review from aoli26 and coderfeli November 17, 2026 01:05
@yhl-amd
yhl-amd force-pushed the hyi/gfx1250-mx32-pl-tile-k128 branch from 0dde638 to d272f7d Compare November 17, 2026 16:11
@yhl-amd

yhl-amd commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the current #7668 head 96c03e69a (which is on #7667); new head d272f7dc1, still one commit of its own. Merge order: #7667, #7668, then this PR. The previous head is kept on the fork as bak/8058-pre1117u.

Rebase. The only conflict was PIPELINED_CASES in op_tests/test_flydsl_batched_gemm.py: #7668 now adds a three-buffer and a four-buffer case, and this PR adds the tile_k = 128 cases. Both sets are kept, and the comment above the list covers both.

Re-timing the tile_k = 128 _pl tiles against main's selection (gfx1250, at 57628f0b1, same code as this head). Each config was run through run_bmm_a8w8_mxfp8 (the tuned-row path), timed with run_perftest at the tuner's default warmup / iterations, 3 processes x 10 rounds with alternating order, and paired with main's pick in the same round. All configs give bit-identical output to main's pick. Negative = faster than main:

key main's selection config vs main (paired median) faster in
wq_b (M, N, K) = (1344, 32768, 1280) tuned row t128x256x128 mw1 nw4 nb3 t224x256x128 mw2 nw2 nb3 _pl -10.1% 29 / 30
same tile without _pl -5.7% 30 / 30
main's tile with _pl +29.9% 0 / 30
wo_a batched (b, M, N, K) = (8, 1344, 1024, 4096) heuristic t256x256x256 mw2 nw2 nb2 t96x256x128 mw1 nw4 nb3 _pl +1.7% 7 / 30
same tile without _pl +1.7% 9 / 30

So the pipelined loop pays off for the 128-deep wq_b tile (_pl is -3.8% against the same tile without it, 27 / 30), but not for the batched wo_a tile; main's selection stays ahead there, and the deeper single-workgroup tile with _pl loses clearly. This PR ships no tuned rows, so nothing changes until a row names such a tile. The description's motivation now cites the wq_b case instead of the wo_a one. The wo_a t96x256x128 entry stays in PIPELINED_CASES only as a bit-exactness case for a batched tile_k = 128 launch.

gfx1250 run at 57628f0b1: python op_tests/test_flydsl_batched_gemm.py rc = 0. All seven pipelined cases report 0 mismatches against the single-fence loop, including t96x256x128 nb3 at b=8, M=1344 (0/11010048), t224x256x128 nb3 at M=1344, 32768 x 1280 (0/44040192) and ragged-K t64x128x128 (0/204800). Fused quant epilogue: all bit-exact. python -m pytest op_tests/test_gemm_host_dispatch_cache.py op_tests/test_bmm_a8w8_fused_quant_tuned_row.py op_tests/test_bmm_a8w8_fused_quant_supported.py: 41 passed.

Description is updated with the PR Self-Review section (Reviewed revision d272f7dc1).

@yhl-amd

yhl-amd commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto #7668's new head 292a532f8 (a name without a K-loop suffix gets default_pipelined_k_loop()'s pick again, and _nopl pins the single-fence loop). The only conflict was the PIPELINED_CASES comment in op_tests/test_flydsl_batched_gemm.py; the tile_k = 128 cases now also compare _nopl with _pl.

Nothing changes for 128-deep tiles: the default pick still needs tile_k >= 256, so such a tile runs the pipelined loop only when its name ends in _pl, as before.

gfx1250 at 091be1d9e: python op_tests/test_flydsl_batched_gemm.py exits 0 (all seven PIPELINED_CASES, including the three tile_k = 128 ones, bit-exact; fused quant epilogue all bit-exact), and the three CPU pytest files pass. The previous head is kept on the fork as bak/8058-pre1118.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Dec 3, 2026
yhl-amd and others added 14 commits December 4, 2026 14:30
…ed entry runs the tuned row


Fused MXFP8 epilogue: when the warp tile holds an even number of 16-column
WMMA tiles (even wmma_n_rep), the group-32 quant reads the accumulators
instead of staging the bf16 C tile in LDS and re-reading it per group. A lane
holds 8 consecutive columns of one row per 16x16 tile, so a 32-column group
is two adjacent tiles across lanes l and l^16 and its amax is one
shuffle_xor(16). Values are rounded to the output dtype first, exactly as the
bf16 path stores them, so the e4m3 codes and e8m0 scales are unchanged; the
e4m3 and scale bytes still go through LDS for the TDM store. An odd
wmma_n_rep keeps the LDS-staged quant. The epilogue has three peer branches
(bf16 store, accumulator quant, LDS-staged quant) with the quant setup and
the group-32 scale step shared by the two quant branches.

batched_gemm_a8w8_mxscale_bpreshuffle_fused_quant looks the shape up in the
same preshuffle table as the bf16 entry and passes a flydsl row's kernelName
to the runner, so both entries run the same tuned tile. No row, an opus row
or a compute-kernel row leaves the tile to the runner; any other name is
passed through, so a name the runner does not accept raises, as for the bf16
entry.

Tests: op_tests/test_flydsl_batched_gemm.py checks the fused quant on tuned
tiles that pin each epilogue branch (two LDS-staged, seven accumulator) at
ragged M against quantize_fp8 of the bf16 GEMM on the same tile;
op_tests/test_bmm_a8w8_fused_quant_tuned_row.py is a CPU test of the
tuned-row lookup.

Rebased onto main: the LDS-staged C tile follows ROCm#8737 (staged at C_OFF, LDS
flush before the TDM store on the unfused path).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the merge with main's gfx950 fused quant, one _fused_quant_tuned_kernel
serves both arches. The CPU test now also checks a gfx950 flydsl row (passed
through) and a gfx950 opus row or no row (runner's choice).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The batched mxfp8_32 kernel's accumulator quant and the 256x256 compute
kernel's fused epilogue emitted the same per-group step (round to the output
dtype, h0/h1 amax with one shuffle_xor(16), 1e-10 floor, RoundUp e8m0,
scaled fp8 conversion, e4m3 and scale bytes into LDS) and the same scale-row
store. Both now call emit_mxfp8_acc_pair_to_lds and
emit_mxfp8_scale_rows_store in kernels/quant_utils.py, next to
emit_mx_e8m0_scale; emit_mxfp8_group32_scale (floor + RoundUp scale) is also
used by the batched kernel's LDS-staged quant. Each kernel keeps its own e4m3
TDM store. No change in the emitted code is intended.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
FUSED_QUANT_TILES adds t64x32x512 mw4 nw1 (one quant group per tile row) and
t160x128x256 nw2 (more tile rows than threads, so the scale rows take a
second pass), both shipped DSv4.1 rows on the accumulator branch that no test
pinned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The scale-row store loops ceil(tile_m / block) times, so a thread copies
rows tid, tid + block, ...; say that in the helper docstring and at both
kernel call sites instead of "one row per thread". In quant_utils, the
native-scale helper no longer refers to a function that does not exist,
and the module docstring names the dtypes _DTYPE_CFG actually defines.
The gfx950 tuned-row test uses the DSv4 batched preshuffle table's row for
its shape. Comments and test data only; no kernel change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…red group-32 scale


_fused_quant_tuned_kernel imports the gfx1250 compute-kernel name check
only on gfx1250, after the table lookup; gfx950 returns the flydsl row's
name directly, as before the merge with the gfx1250 lookup. The gfx950 bmm
fused epilogue calls emit_mxfp8_group32_scale instead of its own copy of
the same steps (1e-10 floor, RoundUp e8m0, f32 scale). Two docstrings no
longer say the fused epilogue always quantizes the bf16 C tile.

Tests: FUSED_QUANT_TILES also pins the DSv4.1 wo_a tuned tiles the fused
entry runs (t192x128x256, t128x256x256 mw1 nw4, t96x128x256, and the
LDS-staged t32x32x512); the gfx1250 tuned-row fixture uses a CU count
other than the gfx950 one so the lookup must forward the caller's.

Rebased onto main: ROCm#8975 already moved the gfx950 bmm fused epilogue onto
quant_utils.emit_mxfp8_quant_bf16_words, so that file keeps main's version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two LDS-staged tiles (t16x64 nw4, t32x32 nw2) and seven accumulator tiles,
as the tuple and the module docstring list them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fragments of k-step g+1 are read from LDS while the WMMAs of k-step g
run, across K-tile boundaries too, so LDS reads, WMMAs and the TDM refill
overlap. The fence before the next K-tile is split into signal/wait (the
primitives the 256x256 compute kernel already uses) around the two halves of
the last k-step's WMMAs, and the per-stage LDS read bases are formed a tile
ahead. Every accumulator sees its k-steps in the same order with the same
operands, so results are bit-identical to the single-fence loop.

New pipelined constexpr, appended after fuse_quant_out: -1 (default)
takes the pipelined loop for mxfp8_32, no scale preload, no cluster,
split_k 1, tile_k >= 256 when the accumulators plus two in-flight fragment
sets fit the register estimate; 1 forces it (batched kernel names may end
in _pl; tile_k < 256 is rejected), 0 keeps the old loop. No new
environment variable.

The DSv4.1 mxscale table rows for N=5120, K=8192 at M 672/768 and for
N=32768, K=1280 at M 576/672/768 are replaced in place with tiles that
use the pipelined loop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pipelined constexpr now defaults to 0 and takes only 0 or 1; the
automatic rule that moved every eligible mx32 tile onto the new loop is
gone, so existing tuned rows keep the loop they were timed on. A trailing
_pl in a batched or 2-D mxfp8_32 kernelName is the only way to select it,
and check_pipelined_k_loop() is the single place that rejects it where the
loop does not apply (it replaces the batched runner's tile_k check).

The DSv4.1 rows validated with the pipelined loop now carry _pl: N=5120,
K=8192 at M 576 / 672 / 768 (the latter two are the t192x128x256 rows that
relied on the automatic rule); the N=32768, K=1280 rows already did.

Also drop the unused pipelined argument of bmm_mx32_kernel_name, share the
fragment join of load_a / load_b and the serpentine WMMA order with the
pipelined loop, and fix the tail fence comment.

Tests: CPU checks of the _pl name round trip (batched and 2-D) and of the
rejections in op_tests/test_gemm_host_dispatch_cache.py; on gfx1250,
op_tests/test_flydsl_batched_gemm.py compares _pl with the single-fence loop
bit for bit on a ragged K and on a shipped _pl row, and runs the fused quant
epilogue on a _pl tile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…in's tile; test nb3/nb4

Re-timed the pipelined rows against the retuned tiles now on main for the
six DSv4.1 2-D keys on one gfx1250 box. The pipelined t192x256x256 tile stays
ahead at M 576 and 768 for N=32768, K=1280; the other four keys keep main's
rows. PIPELINED_CASES also compares the pipelined and single-fence loops on a
three-buffer and a four-buffer tile, where the tail fences differ from the
steady loop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the fence wait the wave refills the stage tile kt held and then reads
the first fragments of tile kt+1; the comment had the two steps swapped.
Comment only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The us, tflops and bw of the two kept _pl rows (N=32768, K=1280 at M 576 and
768) were main's values scaled by a paired ratio. Replace them with values
measured on gfx1250 through the MXFP8 GEMM tuner's harness (its data
generation, B=1 batched run path, mp_tuner timing, error check and
throughput formula), bw in the unit of the neighbouring gfx1250 rows. The
kernelName of both rows is unchanged, so dispatch is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`_pl` stays the only switch of the software-pipelined K loop: a kernelName
without it runs the single-fence loop it was tuned on, in the batched and
the 2-D paths alike. CPU tests pin that:

- untagged 2-D names on which the pipelined loop would apply (tile_k 256,
  split_k 1, before and after cluster_m is fitted to M) resolve to the
  single-fence loop, and their `_pl` names to the pipelined one; no other
  suffix parses;
- every mxfp8_32 kernelName in the shipped tuned tables runs the pipelined
  loop exactly when it ends in `_pl`.

Kernel comments: the early per-stage LDS bases are formed a tile ahead only
when `early` holds, and the tail's max(..., 0) only touches the last tile's
unused fence count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
check_pipelined_k_loop rejected a _pl kernelName with tile_k < 256 (one
128-deep k-step per K-tile). The pipelined loop does not need two k-steps:
with one, the last-k-step branch is the only one taken, so the next tile's
first fragments are read and its stage refilled during the second half of
this tile's WMMAs, behind the same split fence. Every accumulator still
sees its k-steps in the same order with the same operands, so the output is
bit-identical to the single-fence loop.

Only a kernelName that ends in _pl selects the loop, so nothing changes for
existing rows. It lets 128-deep tiles that keep two workgroups per CU (for
example t96x256x128 mw1 nw4) overlap their LDS reads with the WMMAs.

Tests: test_gemm_host_dispatch_cache.py drops the tile_k rejection;
test_flydsl_batched_gemm.py compares _pl with the single-fence loop bit for
bit at tile_k = 128 (b = 8 and b = 1 decode shapes, and a ragged K).

Depends on ROCm#7668 (the _pl loop, on ROCm#7667); this branch carries their
commits until they merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yhl-amd
yhl-amd force-pushed the hyi/gfx1250-mx32-pl-tile-k128 branch from 091be1d to c4edcc4 Compare December 4, 2026 06:44
@yhl-amd

yhl-amd commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Re-stacked on the current #7668 dde80aaad (on main 4052b38ae; this branch was still on #7668's 11-17 head 292a532f8), head c4edcc4fa, previous head kept as bak/8058-pre1204a. The only conflict was the PIPELINED_CASES comment: #7668 now compares a name without _pl (single-fence loop) with the same name plus _pl, so the _nopl wording is gone and the tile_k = 128 cases are listed in that comment. CPU: black --check, ruff check, py_compile clean on every changed file.

This branch has not been deployed

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

Labels

FlyDSL stale The PR hasn't been updated in 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants