Repository navigation
minimax_m3 cuda: opt-in verify window from one graph, refreshed each round - #4610
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/minimax-verify-graphs
branch
6 times, most recently
from
November 24, 2026 12:23
02470c2 to
2515d4a
Compare
TF_MINIMAX_GRAPHS=1 (default off) runs a one-stream decode verify window's launches through cuda.graph_cache, keyed by rows, sparse attention and taps. MiniMax's attention takes each round's positions and block counts as launch arguments, so a held graph cannot be replayed as captured: graph_cache gains a refresh mode in which a hit records the body again with this round's arguments and updates the executable in place (a new one when the launches changed), every rank voting each step, so a failed record sends all ranks to eager together. The same kernels with the same arguments in the same order; the ids upload and the draw stay outside the graph.
ashhart
force-pushed
the
lead/minimax-verify-graphs
branch
from
November 24, 2026 15:35
2515d4a to
b297eec
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.
What this changes
TF_MINIMAX_GRAPHS=1(opt-in, default off) runs MiniMax-M3's CUDA decode verify window from one CUDA graph launch instead of about 2,000 eager launches, so the GPU runs them back to back without per-launch host gaps.A replay of one captured program wouldn't be exact here: MiniMax's attention takes each round's positions as host launch arguments (
prep's.pos, the index kernels'atandnb,attnPrompt'sat), the index kernels' grid grows with the context, and whether they run at all depends on the context length. So each round records the window's launches again with that round's arguments and updates the held executable in place (cuGraphExecUpdate); if the launches took another shape, the update is refused and a new executable replaces the old one (graph_refresh.zig). Every kernel gets the same arguments in the same order as the eager path, so tokens cannot change.zig/src/cuda/root.zig.Checks
Host tests for the switch policy, the refresh (update, refused update, new executable) and the launch order against the eager path; fmt, ast-check, the 600-line cap. No GPU or nvcc was available.
Still to run
On two GB10s, MiniMax-M3.1-Flash at TP=2, one stream, plain and DSpark-drafted, switch off/on/on/off with the same prompts: tokens identical in all four runs, and decode speed.