Repository navigation
[ROCDL] Gate the TDM tile_dim0 span check on padding - #1302
Merged
Merged
Conversation
deriveTdmAtom refused any tiled atom whose innermost per-issue span was under 16 bytes. The ISA puts no such floor on tile_dim0. Its inner loop advances by data_size, which is 1, 2, 4 or 8 bytes, and the only rule it states for tile_dim0 is that its span be a whole multiple of 4 bytes -- and only when pad_enable is set, because pad_amount and pad_interval step the LDS pointer in whole DWORDs while bytesStored accumulates across rows, so a row whose span is not a multiple of 4 lands the pad inside the next row. A wider span coalesces better, but the hardware does not require one. The floor blocked layouts the older make_tdm_atom has always emitted. In aiter, mxfp8's non-preshuffled A-scale tile is (tile_m, tile_k / 32): one e8m0 byte per 32 elements, so 8 bytes at tile_k = 256. That transfer runs correctly through make_tdm_atom today, but make_tiled_tdm_atom could not even construct the op for it. Checking the 4-byte rule only when geometry.padAmount is set lets that site migrate. Verified with the TDM FileCheck tests (including both negative ones), tests/unit -k "tdm or copy or layout" (86 passed, 1 skipped), and aiter's op_tests/test_gemm_a8w8_mxfp8_bpreshuffle.py with the site switched to the tiled atom: 36 shapes, err 0, over three runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Remove the `innerBits` restriction for `make_tiled_tdm_atom`.
sjfeng1999
approved these changes
Oct 16, 2026
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.
deriveTdmAtom refused any tiled atom whose innermost per-issue span was under 16 bytes. The ISA puts no such floor on tile_dim0. Its inner loop advances by data_size, which is 1, 2, 4 or 8 bytes, and the only rule it states for tile_dim0 is that its span be a whole multiple of 4 bytes -- and only when pad_enable is set, because pad_amount and pad_interval step the LDS pointer in whole DWORDs while bytesStored accumulates across rows, so a row whose span is not a multiple of 4 lands the pad inside the next row. A wider span coalesces better, but the hardware does not require one.
The floor blocked layouts the older make_tdm_atom has always emitted. In aiter, mxfp8's non-preshuffled A-scale tile is (tile_m, tile_k / 32): one e8m0 byte per 32 elements, so 8 bytes at tile_k = 256. That transfer runs correctly through make_tdm_atom today, but make_tiled_tdm_atom could not even construct the op for it.
Checking the 4-byte rule only when geometry.padAmount is set lets that site migrate. Verified with the TDM FileCheck tests (including both negative ones), tests/unit -k "tdm or copy or layout" (86 passed, 1 skipped), and aiter's op_tests/test_gemm_a8w8_mxfp8_bpreshuffle.py with the site switched to the tiled atom: 36 shapes, err 0, over three runs.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist