Repository navigation
glm cuda tp2: opt-in one routed-expert pass per prompt pair with 128-row items - #4493
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/glm-pair-experts
branch
from
November 22, 2026 06:39
80a6921 to
a88c1fc
Compare
Owner
Author
|
GB10 TP=2 A/B (GLM-5.3-Flash NVFP4, two boxes,
Tokens 36/36 equal. The first 2K prompt after boot is slow in some runs of both arms (2.50 s new, 1.74 s base), so it is not counted. Exact and faster on long prompts, so this goes into the landing train as an opt-in.
|
ashhart
force-pushed
the
lead/glm-pair-experts
branch
from
November 22, 2026 09:05
1f3740b to
52771cc
Compare
ashhart
force-pushed
the
lead/glm-pair-experts
branch
from
November 22, 2026 11:01
52771cc to
94ccda2
Compare
Add an opt-in 128-pair routed pass for two prompt chunks, retaining separate shared experts, combines and chunk scratch. Cover routing skew and production-size byte equality in the CUDA oracle.
…0 (copy, as before)
…fill #3659 (TF_GLM_MOE_DIRECT) sums a direct decode window with combineTail inside fill; this PR split fill into shared and combine. shared now stops after the shared expert on a direct window (no slot put), and fill does the combineTail there, so the direct path runs the same launches in the same order as on main. Paired prompt chunks never take the direct path.
ashhart
force-pushed
the
lead/glm-pair-experts
branch
from
November 22, 2026 12:04
94ccda2 to
1bc687b
Compare
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
Under TF_GLM_PREFILL_REDUCE=split (the default), #4510 made the partials exchange send peers' partials only, and glueRows takes the rank's own partial as its own argument. The paired path (#4493, TF_GLM_PAIR_EXPERTS=1) passed 0 there since its rebase onto #4510, so hc_post read an unwritten slot for the rank's own rows. It now passes r.b.part at the rank's first row, as the unpaired path does. The default path (switch off) is unchanged.
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
Under TF_GLM_PREFILL_REDUCE=split (the default), #4510 made the partials exchange send peers' partials only, and glueRows takes the rank's own partial as its own argument. The paired path (#4493, TF_GLM_PAIR_EXPERTS=1) passed 0 there since its rebase onto #4510, so hc_post read an unwritten slot for the rank's own rows. It now passes r.b.part at the rank's first row, as the unpaired path does. The default path (switch off) is unchanged.
This was referenced Nov 22, 2026
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 23, 2026
… beside Mini's soft-capped limit2 and keep_full_lone
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 24, 2026
…s pair arguments and the soft-cap limit2; host test drops promptSmem asserts main moved to experts_prompt_layout.zig
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
In a GLM prompt pair, each chunk's routed NVFP4 experts ran as separate gate/up and down launches with 64-row items, so an expert with many tokens re-read its weights. With
TF_GLM_PAIR_EXPERTS=1, router and shared experts run for A then B, then one grouped gate/up and one down launch serve both chunks with 128-row items (WM=2,RT=4), each chunk keeping its own weights, activations and outputs and the sameprompt_tilesarithmetic and epilogues. Four routed launches per MoE layer become two. Default off; included in the rank agreement.Checks
compile-cuda-tests, host tests, fmt, ast-check, lean, 600-line cap.Still to run
Two GB10s: kernel contract (paired vs independent outputs byte for byte, skewed routing, empty experts), then pp8k and pp32k A-B-B-A with final prompt logits and 256 following decode tokens compared. Kill on any difference or under +5% on either.