Repository navigation
Fix MoE permutation on gfx1250 w/ Triton 3.8, faster row_id_map - #791
Open
matthiasdiener wants to merge 3 commits into
Open
matthiasdiener wants to merge 3 commits into
matthiasdiener wants to merge 3 commits into
Conversation
matthiasdiener
force-pushed
the
mdiener/gfx1250-moe-permute
branch
from
November 2, 2026 21:50
a0e5a61 to
c6b49d4
Compare
matthiasdiener
marked this pull request as ready for review
November 2, 2026 23:09
matthiasdiener
requested review from
Micky774,
ipanfilo,
wangye805 and
wenchenvincent
as code owners
November 2, 2026 23:09
ipanfilo
reviewed
Nov 4, 2026
|
|
||
| # The row_id_map from token-major passes over the routing map: block counts per expert, their | ||
| # prefix sums, then each block's rows. Triton 3.8 on gfx1250 miscompiles multi-warp kernels that | ||
| # both scan and reduce a block, as _row_id_map_pass_1_kernel does, so none of these does both. |
Collaborator
There was a problem hiding this comment.
Maybe add Triton ticket so it is easier to track
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.
Description
Triton 3.8 miscompiles MoE permutation on gfx1250 for multi-warp kernels that apply both
tl.cumsumand a reduction to the same block. Triton 3.9 fixes that miscompilation, but the code is slow on both versions (as well as on gfx950).row_id_map(all AMD GPUs): three new kernels count each expert's tokens per block of tokens, prefix-sum the counts over blocks, then write each block's rows. They read whole token rows, need no sort, and none of them both scans and reduces a block. Therow_id_mapformat is unchanged.unpermute_with_mask_mapunpermutes the probs in a kernel of their own (_unpermute_probs_kernel) instead of in the first hidden blocks of_unpermute_kernel. Other GPUs keep the fused kernel.Performance results: https://github.com/AMD-ROCm-Internal/frameworks-internal/issues/395#issue-6169144290
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: