Repository navigation
gemm: every MXFP8 GEMM shape's rows in its own folder, no common table - #9
Merged
Merged
Conversation
Each (N, K)'s rows move out of gemm/mxfp8_common/mxfp8_gemm_tuned.py into its folder gemm/mxfp8_n<N>_k<K>/host.py (ROWS via gemm.parse_rows, select via gemm.select_from_rows), so a shape is tuned and optimized in its own folder and a change to one shape cannot reach another through a shared file. - New folders (rows only): n1280_k6144, n1536_k6144, n2304_k6144, n3072_k6144, n4608_k6144, n6144_k768, n6144_k1536, n6144_k3072, n12288_k6144. - Folders with kernels of their own (n2560_k6144, n4992_k6144, n6144_k2048, n6144_k4096, n6144_k8192): their windows first (_select_own, unchanged), else their ROWS, the order _select_config used with the table. - gemm: _SHAPE_HOSTS lists every folder; _load_tuned_configs gathers the folders' ROWS; tuned_shapes reads them; mxfp8_gemm_tuned.py is gone (its column notes are parse_rows' docstring, the measurement notes the folders'). - No config choice changes: _select_config (both allow_decode), the prequant and deferred configs and prequant_code_tile_rows at every row count 1-65536, bf16 and fp16, of every shape, and tuned_shapes, equal main's. - tests: test_shape_folders (dispatch through every folder, tuned_shapes, no common table) replaces the 6144 x 6144 folder test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Taoyu Zhu <[email protected]>
benenzhu
marked this pull request as ready for review
November 20, 2026 09:06
benenzhu
added a commit
to shen-shanshan/amd-kernels
that referenced
this pull request
Nov 20, 2026
Conflict in amd_kernels/README.md only: main's index (Inferact#5's TP2 packages, Inferact#9's shape folders) with this PR's gemm/mxfp8_bmm_mxfp8_out_n1024_k4096 line after the dense MLP gate_up lines. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Taoyu Zhu <[email protected]>
This was referenced Nov 21, 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.
Every MXFP8 GEMM shape's rows move out of the common table
gemm/mxfp8_common/mxfp8_gemm_tuned.pyinto the shape's own foldergemm/mxfp8_n<N>_k<K>/host.py(ROWSviagemm.parse_rows,selectviagemm.select_from_rows), registered ingemm._SHAPE_HOSTS. A shape is then tuned, or gets kernels of its own, in its folder, and a row change cannot reach another shape through a shared file. Two layers with the same (N, K) run the same GEMM and share the folder's rows (asgemm/mxfp8_n6144_k6144from #5 already does).n1280_k6144,n1536_k6144,n2304_k6144,n3072_k6144,n4608_k6144,n6144_k768,n6144_k1536,n6144_k3072,n12288_k6144.n2560_k6144,n4992_k6144,n6144_k2048,n6144_k4096,n6144_k8192) try their windows first (_select_own, unchanged), then theirROWS: the order_select_configused with the table._load_tuned_configsgathers the folders' rows,tuned_shapesreads them, and the table file is gone. The column notes moved toparse_rows' docstring, the measurement notes to the folders.tests/gemm/mxfp8_common/test_shape_folders.py: dispatch goes through every folder,tuned_shapesis the folders' keys, no common table.No behavior change. I dumped every config choice on main (79dc256) and on this branch:
_select_config(bothallow_decode), the prequant and deferred configs, andprequant_code_tile_rows, for every shape, bf16 and fp16, at every row count 1-65536, plustuned_shapes. 0 differences.Tests (8 x MI355X, ROCm 7.2 image, FlyDSL 0.5.0,
tools/cifull suite at ba03308): 259 / 262 targets.gemm/mxfp8_n4992_k6144/test_warmupandmoe/mxfp4_h6144_i768_e128_top4/test_gemm2_adaptivenever started (two targets hit a container-start race in the CI job); alone they pass, 28 passed.test_handoffs.py::test_side_stream_pool_recorded_grows[True]fails on that node without this branch too (3 of 3 runs at amd-kernels: tensor parallel 2 for MiniMax-M3.1-Flash on MI355X #5's head): its pool check depends on the allocator's state. It will be fixed in a test PR.test_shape_folders,test_tuned_shapes,test_decode_splitk,test_dispatchand every shape folder's tests pass.🤖 Generated with Claude Code