Repository navigation
[FlyDSL] Add gfx1250 candidates to the A16W16 tuning policy - #6396
Conversation
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]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
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]>
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]>
|
@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. |
Refs #6345.
get_flydsl_a16w16_configsreturned no candidates outside gfx950, soGemmA16W16Tunernever 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.GemmConfigPrunerthen prunes the rest as on gfx950. The gfx1250 kernel has no slice-K and ignoresgroup_m, sok_wavesis 1 andgroup_mis 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: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.pyadds 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?