perf(dflash): enable grouped MMID on RDNA - #557
Open
cheese-cakee wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
cheese-cakee
force-pushed
the
codex/perf-mmid-grouped-rdna-main
branch
from
July 23, 2026 22:01
0e33d3b to
cbbc755
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.
Summary
Extends the grouped MMID (
MUL_MAT_ID) batch gate to AMD RDNA3 and RDNA4 while keeping the HIP path opt-in and default-off. Adds portable grouped-versus-legacy dispatch and numerical coverage for CUDA and HIP, including the DS4 gate/up activation graph.Changes
get_mmvq_mmid_max_batch()to admit RDNA3/RDNA4 for grouped MMID.DFLASH_MMID_GROUPED=1.MUL_MAT_IDand the production pair of gate/upMUL_MAT_IDnodes feedingSWIGLU_DS4.How it works
The grouped kernel sorts
(token, slot)pairs by routed expert so each unique expert weight stream is consumed once per MoE batch. The gate admits supported types and bounded widths/pair counts on NVIDIA Turing+ or AMD RDNA3/RDNA4. HIP remains default-off until performance is measured.For grouped DS4 graphs, fusion selection deliberately falls back to two grouped MMIDs plus the existing standalone DS4 activation. This retains the grouped matmul optimization while preserving activation semantics and a stable numerical oracle.
Verification
sm_89, CUDA 12.6):deepseek4_mmid_grouped_cudapassed.compared_cases=50exact_cases=25tolerant_cases=25legacy_grouped=0grouped_grouped=75parity=PASSgfx1151, ROCm HIP): five-test gate passed:rocmfp4_referencerocmfpx_referencerocmfp4_hip_tailrocmfpx_mmqdeepseek4_mmid_grouped_cudaGGML_CUDA_DISABLE_FUSION=1, proving the grouped child clears inherited test state.git diff --checkpasses.Limitations