ROCm: the compiled pipeline can lower tile.mma (via-tile reachable) - #508
Merged
Merged
Conversation
Closes the first of the two gaps W1_1_TYPING_DESIGN.md §4.3 identified.
`GenerateWMMAGemmKernel{via-tile=true}` emits `tile.mma %a, %b, %acc` at the
Tile-IR seam, and its own comment says the op "flows through
rocm-wave-lds-pipeline + lower-tile-to-rocm". Neither runtime pipeline contained
that pass. `tile.mma` therefore survived to LLVM translation and the build died
with
cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface`
registration for dialect for op: tile.mma
so W1.1's Tile-IR seam was unreachable from the lane that actually executes --
including the canonical pipeline, which already runs `tessera-tile-ir-lowering`
and `rocm-wave-lds-pipeline` and still had no tile -> ROCm lowering after the
generator.
Both pipelines now run `lower-tile-to-rocm{arch=<chip>}` after
`generate-wmma-gemm-kernel`.
── Verified, in both directions ──
Default path unchanged: with via-tile off there is no `tile.mma` to lower and
the emitted hsaco is BYTE-IDENTICAL with and without the pass (diffed at the
tessera-opt level before making the change, since adding a pass to a working
production lane needs that evidence, not an assumption).
via-tile now reachable: injecting only `via-tile=true` -- no hand-added lowering
-- compiles and runs bit-identical to the production `tessera_rocm.wmma` lane on
gfx1151 at 64^3, 256^3 and 128x96x64, matching numpy to ~1e-05. The accumulator
survives the round trip.
Every measurement carried the bogus-option control (inject an invalid pass
option, require ok=False), because an earlier run of this experiment reported
bit-identical output while the injection silently never applied.
`arch=` is mandatory and separately gated: `lower-tile-to-rocm` defaults to a
CDNA part and emits `llvm.amdgcn.mfma.contract`, an MFMA intrinsic wrong for
RDNA 3.5 that does not resolve. The pipeline string stays syntactically valid,
so this fails at link time rather than parse time -- hence a gate, not a comment.
Gates: `test_rocm_pipeline_tile_lowering.py` counts lowerings against generators
(so a third lane added without one fails here), forbids the arch-less spelling,
and compares numerics on hardware. Teeth verified by deleting one pipeline's
pass: the structural and hardware tests both fail.
Remaining from §4.3: `TileToROCM`'s TYPED branch still requires a
`FragmentZeroOp` accumulator.
14442 unit, mypy 0, ruff clean, docs in sync.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9217eff66b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
gstoner
added a commit
that referenced
this pull request
Aug 4, 2026
PR #508 review: make the via-tile test fail if the compiled lane degrades
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the first of the two gaps
W1_1_TYPING_DESIGN.md§4.3 identified.The gap
GenerateWMMAGemmKernel{via-tile=true}emitstile.mma %a, %b, %acc, and its own comment says the op "flows through rocm-wave-lds-pipeline + lower-tile-to-rocm". Neither runtime pipeline contained that pass.tile.mmasurvived to LLVM translation:So W1.1's Tile-IR seam was unreachable from the lane that actually executes — including the canonical pipeline, which already runs
tessera-tile-ir-loweringandrocm-wave-lds-pipelineand still had no tile→ROCm lowering after the generator.Verified in both directions
Default path unchanged. With via-tile off there's no
tile.mmato lower, and the emitted hsaco is byte-identical with and without the pass — diffed at the tessera-opt level before making the change, since adding a pass to a working production lane needs evidence rather than an assumption.via-tile now reachable. Injecting only
via-tile=true(no hand-added lowering) compiles and runs bit-identical to the production lane on gfx1151:Every measurement carried the bogus-option control (inject an invalid pass option, require
ok=False) — an earlier run of this experiment reported bit-identical output while the injection silently never applied.arch=is mandatory, and gatedlower-tile-to-rocmdefaults to a CDNA part and emitsllvm.amdgcn.mfma.contract— an MFMA intrinsic wrong for RDNA 3.5 that doesn't resolve. The pipeline string stays syntactically valid, so this fails at link time rather than parse time. Hence a gate, not a comment.Gates
test_rocm_pipeline_tile_lowering.pycounts lowerings against generators (a third lane added without one fails here), forbids the arch-less spelling, and compares numerics on hardware. Teeth verified by deleting one pipeline's pass — structural and hardware tests both fail.Remaining from §4.3
TileToROCM's typed branch still requires aFragmentZeroOpaccumulator, so the typed form can't yet do what the untyped one now demonstrably does. That's next.14442 unit, mypy 0, ruff clean, docs in sync.
🤖 Generated with Claude Code