[rocm-libraries] ROCm/rocm-libraries#9520 (commit 8676d27)
fix(ck-tile): close GEMM_GROUPED entry in arch_filter
OPERATOR_TILE_CONSTRAINTS (#9520)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Related to the grouped-GEMM bridge merge that introduced the malformed
entry.
ISSUE ID : #9000
## Summary
I mistakenly deleted } when I was fixing merge conflicts of PR9000. This
PR simply fixes that.
Fixes a `SyntaxError` in `dispatcher/codegen/arch_filter.py` that
currently breaks all GEMM codegen on `develop`. The
`OperatorType.GEMM_GROUPED` entry in `OPERATOR_TILE_CONSTRAINTS` was
opened with `{` but never given a body or a closing `}`, so the outer
dict literal is never terminated:
```
arch_filter.py, line 65: OPERATOR_TILE_CONSTRAINTS = {
SyntaxError: '{' was never closed
```
## Design note
`OPERATOR_TILE_CONSTRAINTS` maps each `OperatorType` to a tile-shape
gate. The `GEMM_GROUPED` entry (from the grouped-GEMM bridge, #9000) and
the `GEMM_STREAMK` entry (from the stream-K bridge, #9028) got
interleaved: the `GEMM_GROUPED: {` value was left empty and the
following `NOTE` comment block plus `OperatorType.GEMM_STREAMK` ran on
*inside* it. The fix restores `GEMM_GROUPED` as its own dict (the same
tile-shape gates as plain GEMM — grouped is multi-problem but each
sub-problem obeys plain-GEMM tile validity) and lets the `NOTE` comment
precede `GEMM_STREAMK` as originally intended.
Because `arch_filter` is imported transitively by
`unified_gemm_codegen`, the import-time crash cascades: `make
dispatcher_gemm_lib` fails (`generate_gemm_fallback_kernel` Error 1) →
no `libdispatcher_gemm_lib.so` → `tests/test_library_caching.py` fails
4/5 (only the pure source-string check survives).
## Changes
**Modified**
- `codegen/arch_filter.py` — give `GEMM_GROUPED` its own constraints
dict + closing `},`; move the `NOTE` comment to precede `GEMM_STREAMK`.
- `tests/CMakeLists.txt` — register the new test as
`dispatcher_test_arch_filter_constraints`.
**New**
- `tests/test_arch_filter_constraints.py` — regression test that imports
`arch_filter` and asserts every `OperatorType` has a well-formed
constraints entry (required integer keys, positive values). Importing at
all would have failed on the malformed table.
## Validation
Reproduced on MI355X / gfx950 / ROCm 7.2 against `develop`:
- Before: `python3 -m pytest tests/test_library_caching.py -v` → **4
failed / 1 passed**.
- After: `arch_filter.py` parses (`PARSE OK`), `python3
tests/test_arch_filter_constraints.py` → **3 passed**, `make
dispatcher_gemm_lib` builds `libdispatcher_gemm_lib.so`, and
`test_library_caching.py` → **5 passed**.
## Test plan
- [x] `arch_filter.py` parses cleanly
- [x] `tests/test_arch_filter_constraints.py` passes (3/3)
- [x] `make dispatcher_gemm_lib` builds the default `.so`
- [x] `tests/test_library_caching.py` passes (5/5)
- [ ] CI: `dispatcher_test_arch_filter_constraints` +
`test_library_caching.py` pass
Co-authored-by: Muhammed Emin Ozturk <3836908+ozturkosu@users.noreply.github.com> M
Muhammed Emin Ozturk committed
c401998b69d53022041da6a1caad8a554cb16555
Parent: e44760f
Committed by assistant-librarian[bot] <assistant-librarian[bot]@users.noreply.github.com>
on 7/17/2026, 12:26:55 AM