[AMD] Clean up shuffleXor implementation#10065
Merged
Merged
Conversation
antiagainst
reviewed
Apr 18, 2026
| // CHECK-LABEL: reduce_xor_max | ||
| tt.func @reduce_xor_max(%arg0: tensor<32xf32, #blocked4>) { | ||
| // CHECK: rocdl.ds_swizzle | ||
| // stride 16: CDNA fallback to bpermute |
Member
There was a problem hiding this comment.
Right now this is only checking gfx942. Can you also add check lines for gfx1250 given your changes?
antiagainst
reviewed
Apr 18, 2026
| Value hiSel = b.i32_val(buildSelectorMask(8)); | ||
| return ROCDL::PermlaneX16Op::create(rewriter, loc, val.getType(), val, val, | ||
| loSel, hiSel, true, false) | ||
| .getRes(); |
Member
There was a problem hiding this comment.
Nit: You don't need to explicitly call getRes for one-result ops--it will automatically convert the op to its only result value I believe.
antiagainst
approved these changes
Apr 18, 2026
bingyizh233
pushed a commit
to bingyizh233/triton
that referenced
this pull request
Apr 20, 2026
We make things a bit more uniform by decomposing the xor mask and emitting instructions accordingly. For a `mask` in [1, 15], on RDNA + gfx1250 we use a single `row_xmask` DPP instruction, and on CDNA we use 1 or 2 DPP instructions. For a `mask >= 16`, on RDNA, we use a single `v_permlanex16`, and on CDNA we use `ds_bpermute`. We also pull some static utility functions into an anonymous namespace and remove the ShflKind::down case from the enum as it was unimplemented.
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.
We make things a bit more uniform by decomposing the xor mask and emitting instructions accordingly. For a
maskin [1, 15], on RDNA + gfx1250 we use a singlerow_xmaskDPP instruction, and on CDNA we use 1 or 2 DPP instructions. For amask >= 16, on RDNA, we use a singlev_permlanex16, and on CDNA we useds_bpermute.We also pull some static utility functions into an anonymous namespace and remove the ShflKind::down case from the enum as it was unimplemented.