Commit 398d985
[rocm-libraries] ROCm/rocm-libraries#12216 (commit 72144cb)
fix(ck-tile): honor the gfx1250 unified-framework gate in
bridge kernel builds (#12216)
## Summary
`projects/composablekernel/CMakeLists.txt:230-232` force-defines
`USE_NEW_UNIFIED_FRAMEWORK=0` for gfx1250 targets, because the unified
ck_tile framework does not support gfx1250 yet. That gate is an
`add_compile_definitions` call, so it only reaches targets of that CMake
project.
The dispatcher bridges never saw it: they assemble their own per-kernel
`hipcc` command lines, outside CMake entirely.
This was harmless while the framework default was `0`. PR #11646 flipped
that default to `1`, after which every bridge kernel compiled for
gfx1250 failed on the `getCMakeCompilerTarget` static assertion in
`arch.hpp:509`, leaving `tile_engine` unable to build or benchmark any
GEMM on gfx1250.
This adds a shared `unified_framework_flags()` helper in
`dispatcher_common.py` and applies it at each of the 21 sites that build
a kernel compile line. The flag is emitted **only** for gfx1250.
Fixes the blocker reported in AICK-2268.
## Motivation
Without this, the documented gfx1250 tuning workflow does not function
at all: the shipped `configs/default_ci_config_gfx1250.json` sweep
reports `0/4 configs -> .so` and produces no measurements.
Only `gemm_utils.py` is exercised by that sweep, but all 21 compile-line
construction sites have the identical gap, so the remaining operators
would fail the same way as soon as anyone benchmarks them on gfx1250.
Fixing them together via one helper avoids leaving 17 latent copies of
the same bug.
## Design note
The helper mirrors the CMake gate rather than replacing it. A
longer-term cleanup would move the gate out of `CMakeLists.txt` into a
header, so that every compile path observes one consistent value instead
of two places having to agree. That is deliberately out of scope here.
Worth noting for reviewers: the dispatcher static library is built by a
separate CMake project (`project(ck_tile_dispatcher ...)` at
`dispatcher/CMakeLists.txt:6`), so it also does not inherit the gfx1250
gate and is compiled with the framework default of 1, while the kernels
this PR fixes are compiled with 0. That mix was verified to work
correctly on hardware -- the dispatcher translation units do not
instantiate the affected templates -- so no CMake change is required
here.
This restores the legacy WarpGemm path on gfx1250, which is what CMake
already intends today. Making the unified framework genuinely work on
gfx1250 is separate follow-up work.
## Changes
- `dispatcher_common.py`: new `unified_framework_flags(arch)` helper.
- 18 bridge modules: emit the helper's flags alongside `-DGFX_ARCH` at
each compile-line site.
19 files changed, 54 insertions, 2 deletions.
## Test plan
Verified on gfx1250 hardware against a pristine tree at the commit named
in AICK-2268, with this PR as the only local change, and with the
dispatcher built exactly as the ticket documents (no extra CMake flags).
Reproduced on a second gfx1250 node on a different ROCm build to rule
out version specificity.
- [x] Baseline reproduces the reported failure: `0/4 configs -> .so`
- [x] With this PR applied: `4/4 configs -> .so`, **0 compile failures**
- [x] Full bf16 sweep across all four layouts (rcr, rrr, crr, ccr): **64
configs, 0 compile failures, 320/320 measurements, 0 failures**
- [x] Numerical correctness via `--verify` against the fp32 reference:
**320/320 `verified=True`**, worst `max_rel` 0.003789, zero
all-zero-output rows
- [x] Kernels execute on device and emit native matrix instructions: 40
x `v_wmma_f32_16x16x32_bf16`, no fallback dummy-exec path
- [x] Non-gfx1250 unaffected: generated compile command for gfx942 and
gfx950 is byte-identical to before (27 args, no added flag); gfx1250
gets 28
- [x] All 21 dispatcher python modules import cleanly
- [ ] CI sweep on gfx942 / gfx950 to confirm no regression
- [ ] CI smoke check that builds at least one gfx1250 tile_engine
kernel, so this cannot silently regress again
Co-authored-by: Muhammed Emin Ozturk <3836908+ozturkosu@users.noreply.github.com>1 parent 6f6a4cf commit 398d985
22 files changed
Lines changed: 215 additions & 3 deletions
File tree
- dispatcher
- python
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
557 | 558 | | |
558 | 559 | | |
559 | 560 | | |
560 | | - | |
| 561 | + | |
561 | 562 | | |
562 | 563 | | |
563 | 564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
604 | 605 | | |
605 | 606 | | |
606 | 607 | | |
| 608 | + | |
607 | 609 | | |
608 | 610 | | |
609 | 611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
| 738 | + | |
737 | 739 | | |
738 | 740 | | |
739 | 741 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
2039 | 2040 | | |
2040 | 2041 | | |
2041 | 2042 | | |
| 2043 | + | |
2042 | 2044 | | |
2043 | 2045 | | |
2044 | 2046 | | |
| |||
2131 | 2133 | | |
2132 | 2134 | | |
2133 | 2135 | | |
| 2136 | + | |
2134 | 2137 | | |
2135 | 2138 | | |
2136 | 2139 | | |
| |||
2891 | 2894 | | |
2892 | 2895 | | |
2893 | 2896 | | |
| 2897 | + | |
2894 | 2898 | | |
2895 | 2899 | | |
2896 | 2900 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
104 | 119 | | |
105 | 120 | | |
106 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
1206 | 1207 | | |
1207 | 1208 | | |
1208 | 1209 | | |
| 1210 | + | |
1209 | 1211 | | |
1210 | 1212 | | |
1211 | 1213 | | |
| |||
1217 | 1219 | | |
1218 | 1220 | | |
1219 | 1221 | | |
| 1222 | + | |
1220 | 1223 | | |
1221 | 1224 | | |
1222 | 1225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
626 | 627 | | |
627 | 628 | | |
628 | 629 | | |
| 630 | + | |
629 | 631 | | |
630 | 632 | | |
631 | 633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
510 | 511 | | |
511 | 512 | | |
512 | 513 | | |
| 514 | + | |
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
876 | 877 | | |
877 | 878 | | |
878 | 879 | | |
| 880 | + | |
879 | 881 | | |
880 | 882 | | |
881 | 883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| 532 | + | |
531 | 533 | | |
532 | 534 | | |
533 | 535 | | |
| |||
0 commit comments