Skip to content

glm cuda tp2 prefill: local indexer rows via TF_GLM_INDEX_SPLIT and in-place own partials - #4510

Merged
ashhart merged 5 commits into
mainfrom
lead/glm-prefill-index-local
Nov 22, 2026
Merged

ashhart merged 5 commits into
mainfrom
lead/glm-prefill-index-local

Conversation

@ashhart

@ashhart ashhart commented Nov 22, 2026

Copy link
Copy Markdown
Owner

What this changes

Two exact prefill changes from a read-only review of GLM's two-box prefill:

  1. TF_GLM_INDEX_SPLIT (existing setting, default 2048 unchanged) now applies only to multi-rank runs, and setting it to 32768 keeps indexer scores, pools and token rows local below that position. The indexer is row-independent, so the local result equals the split-and-gather result, without the blocking all-gathers.
  2. The prefill HC post reads its own rank's FP32 partial in place instead of copying it into the gather buffer first; the rank-0-then-rank-1 FP32 sum is unchanged.

Checks

  • Host tests for the setting (default, 0, 32768, malformed) and the in-place read; fmt, ast-check, lean, 600-line cap.

Still to run

Two GB10s: pp8k and pp32k with TF_GLM_INDEX_SPLIT=32768 vs default, A-B-B-A, final logits and following decode tokens compared.

@ashhart

ashhart commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

GB10 TP=2 A/B (GLM-5.3-Flash NVFP4, two boxes, --parallel 2, 64K context, no prompt cache), base = main + #4427, new = this PR + #4427 with TF_GLM_INDEX_SPLIT=32768, order base new new base, four prompts per size per run:

base new
pp8k prefill 5.36-5.40 s 5.33-5.37 s (+0.5% tok/s)
pp32k prefill 21.32-21.53 s 21.21-21.42 s (+0.3% tok/s)
pp2k, steady (prompts 2-4) 1.25-1.27 s 1.24-1.26 s
pp2k, first prompt of a run 2.97 s, 2.80 s 1.25 s, 1.26 s

Tokens 36/36 equal. Steady-state prefill is level to slightly better; the large pp2k aggregate (+24.6%) comes only from the first prompt after boot, which is slow in both base runs and not in either new run. Server start took 95 s and 70 s for the new runs vs 65 s for base, so part of that first-prompt work may have moved to startup; this does not change the verdict. Exact and no regression, so it goes into the landing train as an opt-in.

  • Synthena

@ashhart
ashhart force-pushed the lead/glm-prefill-index-local branch from c537d95 to 6560406 Compare November 22, 2026 08:15
@ashhart
ashhart merged commit e7aba1a into main Nov 22, 2026
2 of 12 checks passed
@ashhart
ashhart deleted the lead/glm-prefill-index-local branch November 22, 2026 08:15
ashhart added a commit that referenced this pull request Nov 22, 2026
Unreleased: the five (#N) placeholders get their PR numbers, the two (#PR)
duplicates go, #3192's line goes (#4427 replaced that behaviour on main and
its line refs #3192), #3960 is named as the PR that landed #2799, and the
penalty under --instruct-sampling card; ?token= Web addresses and pull's
digest and size checks).

Sixteen PRs merged 20-21 Nov with no line anywhere: a blank lines file
replaced each PR's own line at landing. #4321 and #4322 go under
Unreleased, the twelve that shipped in 1.3.3 under 1.3.3, and the two
1.3.1 lines that carried no PR number get #3941 and #4022.

docs/environment.md: Flash Next checks 37 settings, and TF_GLM_INDEX_SPLIT
(registered by #4510) gets its row.
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.
bjornmonnens added a commit to bjornmonnens/TensorFold that referenced this pull request Nov 24, 2026
…e under split prefill

Since ashhart#4510 split prefill sends only the peers' partials: rank me's slot of the gathered buffer is unused and its
partial stays in place. tf_glm_residual_add_own sums as tf_glm_residual_add does, rank 0 first, with rank me's
partial read from own (glm_glue::ranks8own, as tf_glm_hc_post_own).
bjornmonnens added a commit to bjornmonnens/TensorFold that referenced this pull request Nov 24, 2026
…e under split prefill

Since ashhart#4510 split prefill sends only the peers' partials: rank me's slot of the gathered buffer is unused and its
partial stays in place. tf_glm_residual_add_own sums as tf_glm_residual_add does, rank 0 first, with rank me's
partial read from own (glm_glue::ranks8own, as tf_glm_hc_post_own).
bjornmonnens added a commit to bjornmonnens/TensorFold that referenced this pull request Nov 25, 2026
…e under split prefill

Since ashhart#4510 split prefill sends only the peers' partials: rank me's slot of the gathered buffer is unused and its
partial stays in place. tf_glm_residual_add_own sums as tf_glm_residual_add does, rank 0 first, with rank me's
partial read from own (glm_glue::ranks8own, as tf_glm_hc_post_own).
ashhart pushed a commit to bjornmonnens/TensorFold that referenced this pull request Nov 25, 2026
…e under split prefill

Since ashhart#4510 split prefill sends only the peers' partials: rank me's slot of the gathered buffer is unused and its
partial stays in place. tf_glm_residual_add_own sums as tf_glm_residual_add does, rank 0 first, with rank me's
partial read from own (glm_glue::ranks8own, as tf_glm_hc_post_own).
ashhart pushed a commit that referenced this pull request Nov 25, 2026
…e under split prefill

Since #4510 split prefill sends only the peers' partials: rank me's slot of the gathered buffer is unused and its
partial stays in place. tf_glm_residual_add_own sums as tf_glm_residual_add does, rank 0 first, with rank me's
partial read from own (glm_glue::ranks8own, as tf_glm_hc_post_own).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants