Draft
Conversation
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com> Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: xintin <gaurav.verma@amd.com>
Signed-off-by: xintin <gaurav.verma@amd.com>
4f4d867 to
d5eacf6
Compare
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.
In MXFP4 GEMM kernels with bf16 output, the MMA accumulator layout (F32_16x16x128_F8F6F4) distributes results across threads in a non-contiguous pattern. Without a transposed output layout, each thread issues narrow, scattered global stores (buffer_store_short), which underutilizes memory bandwidth. A transposed output layout
(C^T [N, M])makes per-lane MMA accumulator elements contiguous in the fast (M) dimension, improving store width to buffer_store_dwordx2 (4 bf16 per thread). The compiler pass in this PR doubles it further to buffer_store_dwordx4 (8 bf16).The
coalesce_epilogue_storespass marks epilogue bf16 global writes for permlane packing. At codegen time,v_permlane16_swap_b32exchanges each thread's 4 bf16 values (2 packeddwords) with a partner lane 16 positions apart. Since the MMA layout groups lanes by 16 (lanes 0-15 own M=0-3, lanes 16-31 own M=4-7, etc.), this produces 8 consecutive M values per lane, written as a single buffer_store_dwordx4.Both lane halves write identical data to the same global address (benign duplicate), avoiding divergent control flow: