Skip to content

[FlyDSL] Add gfx1250 candidates to the A16W16 tuning policy - #6396

Merged
yzhou103 merged 2 commits into
mainfrom
jhinpan/gfx1250-a16w16-flydsl-candidates
Oct 13, 2026
Merged

yzhou103 merged 2 commits into
mainfrom
jhinpan/gfx1250-a16w16-flydsl-candidates

Conversation

@jhinpan

@jhinpan jhinpan commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Refs #6345.

get_flydsl_a16w16_configs returned no candidates outside gfx950, so GemmA16W16Tuner never timed the gfx1250 FlyDSL kernel (gemm_a16w16_gfx1250). The gfx1250 FlyDSL rows in the BF16 CSVs came from sweeps outside the tuner.

On gfx1250 the policy now builds candidates from 13 tiles, which hold the tile and wave layout of every gfx1250 FlyDSL row in the BF16 tuned CSVs. Each tile gets 2 to 6 stages, split-K over the divisors of K up to 8, and both main-loop policies. The policy drops the configs that the kernel rejects: padded LDS over 320 KB, and fewer K tiles per split than stages - 1. It also offers split-K only when a wave holds at most 4 accumulators: the split-K reduction code grows with them, and with 64 (256x256 tiles on 2x2 waves) one candidate compiled for minutes. No gfx1250 row uses split-K with more than 2. GemmConfigPruner then prunes the rest as on gfx950. The gfx1250 kernel has no slice-K and ignores group_m, so k_waves is 1 and group_m is 0. The output may be the input dtype or fp32, as on gfx950.

The official tuner on gfx1250 (MI450-class, 256 CUs), --libtype flydsl,triton, 6 shapes, 452 s in total:

Shape FlyDSL candidates Tuner pick Pick (µs) Current row's kernel (µs) Best Triton (µs)
1 x 640 x 2880 104 t16x16x256x3, split-K 6 3.81 6.29 9.45
64 x 5120 x 2880, bias 136 t64x64x256x3, split-K 3, ht 7.39 9.05 8.57
2048 x 5120 x 2880 46 t256x256x64x4, ht 51.70 56.49 78.04
4096 x 4096 x 4096 46 t256x256x64x4, ht 73.73 88.19 200.21
8192 x 6144 x 7168 46 t256x256x64x4, ht 332.57 394.26 965.01
64 x 640 x 2880, fp32 out 232 t16x16x256x5, split-K 3 4.87 no row none

All times are the tuner's own; "Current row's kernel" is the tuner's time for the kernel that the existing gfx1250 row names. Every pick passes the tuner's error check. The run predates the split-K limit: it offered 862 FlyDSL candidates, and 132 of them failed to launch (LDS overflow, too few K tiles per split). The LDS and K-tile checks drop exactly those 132. The split-K limit drops 120 of the other 730 (on 64 x 5120 x 2880, 2048 x 5120 x 2880 and 64 x 640 x 2880; the counts above are after it), and none of them is a pick.

op_tests/tuning_tests/test_a16w16_tuned_config_lookup.py adds a test with the gfx1250 device mocked: there are candidates, they fit the kernel's LDS and K-tile requirements, and their kernel names parse back to the same config. It fails on main.

@zufayu, could you help review this?

get_flydsl_a16w16_configs returned no candidates outside gfx950, so
GemmA16W16Tuner never timed the gfx1250 FlyDSL kernel.

On gfx1250 the policy now builds candidates from the tile and wave
layouts of the gfx1250 FlyDSL rows in the BF16 tuned CSVs, with 2 to 6
stages, split-K over the divisors of K up to 8, and both main-loop
policies. It drops what the kernel rejects (padded LDS over the
capacity, fewer K tiles per split than stages - 1) and prunes the rest
with GemmConfigPruner. Output may be the input dtype or fp32, as on
gfx950.

Signed-off-by: Jin Pan <[email protected]>
@jhinpan
jhinpan requested review from a team and zufayu October 11, 2026 08:36
@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: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 6396 --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.

The split-K reduction code of the gfx1250 FlyDSL A16W16 kernel grows with
the accumulators per wave. A 256x256x128 tile on 2x2 waves (64 of them)
with split-K 6 compiled for minutes and stalled GemmA16W16Tuner. Offer
split-K only when a wave holds at most 4 accumulators; no gfx1250 row
uses split-K with more than 2.

Signed-off-by: Jin Pan <[email protected]>
jhinpan added a commit that referenced this pull request Oct 11, 2026
With the gfx1250 FlyDSL candidates of #6396, GemmA16W16Tuner picked a
different config for the 20 shapes of this PR. Through
tuned_gemm.gemm_a16w16, 14 of its picks took 0.716 to 0.965 of the
swept rows' time; most are 256x256x64 tiles with 3 or 4 buffers and the
unrolled main loop. Use them for those 14 rows and keep the swept
config for the other 6.

Signed-off-by: Jin Pan <[email protected]>
@zufayu
zufayu requested review from yzhou103 and removed request for zufayu October 12, 2026 05:53
@zufayu

zufayu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

@yzhou103, this PR expands the gfx1250 FlyDSL A16W16 tuning policy with 13 tile layouts, 2–6 stages, split-K up to 8, and resource-based pruning; please confirm that the candidate space and pruning rules are appropriate for the tuning flow.

@yzhou103
yzhou103 merged commit 2c9efe1 into main Oct 13, 2026
@yzhou103
yzhou103 deleted the jhinpan/gfx1250-a16w16-flydsl-candidates branch October 13, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants