MXFP4 double buffer barrier fix #866
Open
adedespirlet wants to merge 16 commits intoiree-org:mainfrom
Open
Conversation
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
IE rather than extracting an i8 (and bitcasting to f8e8m0fnu) from a 4x vector (IE one VGPR) to use as mfma argument, use the extraction offset as the opsel argument for the mfma. This should reduce register pressure. Signed-off-by: William G Hatch <william@hatch.uno>
Signed-off-by: William G Hatch <william@hatch.uno>
Signed-off-by: William G Hatch <william@hatch.uno>
Signed-off-by: William G Hatch <william@hatch.uno>
The speculative_decoding.py tests change because the extra canonicalize pass optimizes some things away. Eg. nested conditionals simplified to one conditional with a merged condition expression. The pipelined_attention.py changes are similar, it looks like double canonicalization merged some things which moved bits around and changed some counts. Signed-off-by: William G Hatch <william@hatch.uno>
Signed-off-by: William G Hatch <william@hatch.uno>
Signed-off-by: William G Hatch <william@hatch.uno>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
Signed-off-by: Aurore De Spirlet <aurore.despirlet@amd.com>
panditsa
reviewed
Feb 20, 2026
| ): | ||
| """Double-buffered MXFP4 GEMM, 8 waves, with stagger.""" | ||
|
|
||
| mlir = """ |
Contributor
There was a problem hiding this comment.
Do we still need to pass the MLIR text entirely?
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.
This PR places barriers differently in the double buffered mfp4 gemm to reduce stalls observed in the trace.
The previous schedule utilized amdgpu.lds_barrier prior to the wavefront staggering branch. This forced an immediate s_waitcnt vmcnt(0), resulting in big stalls in the prologue. This "too early" LDS synchronization (vmcnt(0)) prevented the overlap of indexing logic with the in flight global memory loads.
To resolve this, I replaced the amdgpu.lds_barrier with a pure rocdl.s.barrier. And inside the loop I inserted a amdgpu.memory_counter_wait load(0) immediately before the first vector load from LDS.