Repository navigation
fix(mxfp8_moe): zero empty-expert weight gradients, accept non-contiguous gradients, smoke-test the kernel - #21
Draft
garrett361 wants to merge 4 commits into
Draft
garrett361 wants to merge 4 commits into
garrett361 wants to merge 4 commits into
Conversation
`torch._scaled_grouped_mm` leaves an empty group's output unwritten, so with the default MXFP8 weight-gradient recipe an expert that received no tokens got uninitialized memory (NaN or ~1e38) as its gradient. The high-precision path through `torch._grouped_mm` already zero-fills. prime-rl's dispatchers pad empty experts to one alignment block, so it never hit this, but the public `grouped_gemm` did. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
torchao's MXFP8 casts require contiguous input, so a reduction's expanded, stride-0 gradient (for example from `out.sum().backward()`) failed with "`x` must be contiguous". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A release wheel without a usable mxfp8_moe now fails CI instead of shipping; prime-rl's MXFP8 expert compute loads it. The check covers a non-power-of-two group count and an empty expert. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nment The weight gradient's 32-row scale blocks assume aligned group boundaries; an unaligned group would straddle two groups' blocks and silently get wrong scales. Not checked at runtime, since a check would add a host sync to every call. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
garrett361
force-pushed
the
feat/mxfp8-moe-sm103
branch
from
October 19, 2026 19:09
ec73ec1 to
2018c76
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.
No description provided.