SIGN IN SIGN UP

[rocm-libraries] ROCm/rocm-libraries#10105 (commit 287d289)

fix(ck-tile): repair #9308 merge truncations in gemm_utils +
 unified_gemm_codegen (develop broken) (#10105)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

ISSUE ID: #9308

Fixes the develop breakage introduced by the #9308 multi-D merge (commit
7fcb5f36). When I was fixing merge conflict, some line was deleted and
CI did not test it ( bridge test was not added CI that time). These two
issue has been fixed with this PR.

## Summary
The multi-D merge **#9308** (commit `7fcb5f36`) left **two independent
truncations** on `develop`, both of which make the dispatcher Python
fail to parse:

1. `dispatcher/python/gemm_utils.py` — `import gemm_utils` raises
`SyntaxError: '(' was never closed`.
2. `dispatcher/codegen/unified_gemm_codegen.py` — `SyntaxError:
unterminated string literal` (multi_d / multi_abd codegen can't run).

Both verified against the GitHub `develop` blob. Every consumer of the
multi-D / multi-ABD Python paths is broken today.

## Root cause
- **gemm_utils.py:** the multi-D `run()` landed **inside
`GpuMultiABDRunner`** and was truncated at an unterminated `return
MultiDGemmResult(`; `GpuMultiDGemmRunner` was left with only `__init__`.
- **unified_gemm_codegen.py:** `_multi_d_single_include()` returns an
f-string of C++ `#define`/exports whose closing `"""` was dropped.

## Why CI stayed green
The dispatcher Python tests that import these modules were **not
registered in `dispatcher/tests/CMakeLists.txt`**, so they never ran in
the gate.

## Changes
- **gemm_utils.py:** move multi-D `run()` (+
`kernel_name`/`num_d_tensors`) into `GpuMultiDGemmRunner` and complete
the `MultiDGemmResult(...)` return; remove the stray block from
`GpuMultiABDRunner`.
- **unified_gemm_codegen.py:** close the truncated f-string in
`_multi_d_single_include`.
- **Tests + CI:** add `TestModuleImportsAndRunnerShape` to
`test_gemm_utils.py` (import canary + multi-D runner-shape assertions +
`ast.parse` canary over `unified_gemm_codegen.py`), and **register
`test_gemm_utils.py` in CMake (`dispatcher_test_gemm_utils`)** so
ctest/CI runs it.

## Test plan
- [x] `import gemm_utils` succeeds (was SyntaxError)
- [x] `ast.parse` of `unified_gemm_codegen.py` succeeds (was
SyntaxError)
- [x] `python3 -m unittest discover -p test_gemm_utils.py` -> 21 passed
- [ ] CI runs `dispatcher_test_gemm_utils` (newly wired)

## Follow-up (separate)
Enable the dispatcher Python test suite broadly in the PR CI gate to
fully close the coverage gap.
M
Muhammed Emin Ozturk committed
8fc1ac24e9bd7b431663a15e2122ce02c2979d37
Parent: 94d3ab6
Committed by assistant-librarian[bot] <assistant-librarian[bot]@users.noreply.github.com> on 7/29/2026, 10:36:59 AM