Add challenge 99: Grouped GEMM (Medium)#264
Open
claude[bot] wants to merge 1 commit into
Open
Conversation
Implements a Grouped General Matrix Multiplication where rows of A are partitioned into G contiguous groups (via cumulative offsets) and each group is multiplied by its own per-group weight matrix B[g]. This is the core building block of Mixture-of-Experts inference: after a router has dispatched tokens to experts, a single grouped GEMM computes every expert's projection in one launch with imbalanced per-expert workloads. Co-Authored-By: Claude Opus 4.7 <[email protected]>
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
A(defined by a cumulativegroup_offsetsarray) is multiplied by its own per-group weight matrixB[g], with output written to the corresponding rows ofC. Empty groups are supported.challenge.py(10 functional tests covering empty groups, imbalanced routing, edge sizes, zeros/negatives, and a realistic MoE perf test of 8 experts × 8,192 tokens × 1,024 hidden × 2,048 intermediate),challenge.htmlwith SVG visualization, and starter files for all six frameworks.Test plan
pre-commit run --all-filespasses on the new filesscripts/run_challenge.py --action submiton T4: all functional + performance tests pass with a tiled CUDA solution🤖 Generated with Claude Code