Skip to content

scheduler: a pair under expert TP may verify one draft (prose +5.8% on 2x DGX Spark) - #346

Merged
AzeezIsh merged 5 commits into
Atlas-Inf:mainfrom
Enntity:glm/pair-two-row-verify
Nov 15, 2026
Merged

AzeezIsh merged 5 commits into
Atlas-Inf:mainfrom
Enntity:glm/pair-two-row-verify

Conversation

@data-angel

Copy link
Copy Markdown
Contributor

On a two-Spark pair, the confidence width rule never verified a single draft. A lone sequence's 2-row verify was priced 10.3 ms above its 3-row one, a 2026-09-28 measurement of the fused two-row path. Under expert TP that path no longer runs: a 2-row verify takes the same grouped path as a 3-row one.

Measured on SparkGLM 0.3.2 (GLM-5.3-Flash, TP-2, prose, ATLAS_DFLASH_FIXED_WIDTH=1): 2 rows 42.0 ms, 3 rows 47.4 ms. About 45% of prose steps accept no draft, so the narrow step pays.

Change

  • A pair under expert TP prices a lone 2-row verify on its row line. The topology is recorded once at startup.
  • A single GPU, a pair without expert TP and the TP-4 chain keep the charge: they still run the fused path, or have not been measured.
  • Verification is exact at any width, so output does not change.

Result (2x DGX Spark, RigMark, 3 runs of 4,096 tokens)

Before After
Prose 34.7 tok/s 36.7 tok/s (+5.8%)
Code 62.6 62.9
Structured 81.8 81.3

Greedy output on 8 prompts and prompt log-probabilities are identical to the build without the change.

Tests

cargo test -p spark-server --bin spark dflash passes (the existing width tests keep their expectations; one new assertion covers the pair's row line).

🤖 Generated with Claude Code

data-angel and others added 5 commits November 14, 2026 15:58
In multi-rank worlds the GLM vision tower sizes its scratch for the
processor's whole budget (GlmCapacity::budgets: 120,000 patches, one video
temporal group). That is 1.25 GiB held for the life of the process on the
encoding rank, and since the KV pool is the minimum across ranks it costs
every rank the same number of blocks.

The tower only runs between prefill passes, so the scratch now comes from
the BufferArena instead. The arena's 15 per-pass members (FP8 activations,
router and gate logits, QKV/attention/norm/MoE outputs, SSM and expert
intermediates) are carved from one allocation (buffers/lend.rs), and the
encoding rank lends that span to the tower:

- lend(): device-wide sync, then hand out the span's base.
- return_lent(): zero only the borrowed bytes that overlap members decode
  expects zeroed, then wait on the encode stream. The four members the
  arena never zeroes sit first in the span, so the borrow's first bytes
  need no memset.

Every encode call site (prefill and the vision cache head) goes through
vision_forward_items(). When the span is smaller than the tower's scratch,
the factory falls back to a private allocation, which is the old behaviour.
total_bytes() accounts for the aligned span.

GLM-5.3-Flash FP4-Local, TP=2 on two GB10s, 4x1M profile, util 0.91: the
KV pool goes from 116,958-122,639 to 142,988-144,780 blocks (+19%). Vision
output is identical to the owned-scratch build (images and a 19K-token
video, alone and mixed with text decodes, every token logprob), greedy text
and prompt logprobs are identical, and text decode is level. Image TTFT is
about 20 ms (0.7%) higher from the sync and memset around each encode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
norm_output is now carved from the arena's per-pass span, which is freed
once through its base, so the teardown-order check looks for the span.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The confidence width rule never verified one draft on the pair, because a
lone owner's 2-row verify was priced 10.3 ms over its 3-row one. That was the
2026-09-28 sweep of the fused two-row path, which expert TP retired. On
SparkGLM 0.3.2 (TP2, prose, ATLAS_DFLASH_FIXED_WIDTH=1, 2026-11-11) a 2-row
verify takes 42.0 ms against 47.4 for 3 rows, and 46% of prose steps accept
no draft. The pair now prices 2 rows on the same 5.68 ms line, so an unsure
block verifies one draft. The chain has not been re-measured and keeps the
charge. Verification stays exact at any width.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…line

Review: the non-chain branch also serves a single GPU and a pair without
expert TP, which still run the fused two-row path the 10.3 ms charge was
measured on. The row-line price now needs the pair under expert TP
(set at startup with the topology); everything else keeps the charge, and
the width tests keep their expectations.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@AzeezIsh
AzeezIsh force-pushed the glm/pair-two-row-verify branch from 343c445 to 7ea9aec Compare November 14, 2026 21:15
@AzeezIsh

Copy link
Copy Markdown
Contributor

Restacked: the four GLM PRs are now one linear stack on main cb59c7663, in order: #338 → #346 → #347 → #348. This PR sits on #338. Its own commits: ec9d198, 7ea9aec.

git range-diff against the previous heads shows every original commit unchanged (=). All cherry-picks applied without conflicts.

Pre-push checks on the stack top: fmt, clippy --workspace --tests, cargo test --workspace --locked, the ≤500-line cap, typos, SPDX, mdBook and cargo doc all pass. While the PRs below are open, GitHub shows their commits in this PR's diff as well.

Pair gate on 2× GB10 is running now: GLM-5.3-Flash FP4-Local, the SparkGLM 0.3.2 4x1m spark launch with KV shard at 0.91, each PR's binary against its parent's. Results will follow here.

Generated with Devin

@AzeezIsh

Copy link
Copy Markdown
Contributor

@data-angel pair gate for #346: passed. Merging after this comment.

Setup: 2× GB10 (reiner + spark2). Each arm is a fresh build at an exact commit: parent = #338 1897b4786 (f648b082…), PR = 7ea9aecbf (22efc028…). Same launch as on #338: GLM-5.3-Flash FP4-Local 76348ddb, drafter 7d74cdd8, SparkGLM 0.3.2 serve.py, 4x1m spark, KV shard, 0.91. Boots alternate parent, PR, parent, PR. Rank 0 logs expert TP true on both arms, so the pair row line is the path under test.

Check Result
Teacher-forced top-20, text (27,169 positions) bit-identical, KL 0 on both boot pairs; parent-vs-parent floor exact
Vision top-20 (29,488 positions) / vision under 2 live decodes KL 0 / 5/5 identical
Greedy 8 prompts C1 / C8 8/8 / 8/8 identical
Tools 21/21 both
Decode prose, C1, 384 tok, medians of 6 39.73 [39.62–39.79] → 40.85 [40.67–40.91] tok/s (+2.8%, ranges disjoint)
Decode json 54.38 [53.75–54.56] → 55.59 [54.79–56.41] (+2.2%)
Decode code 69.97 → 70.07 (level)
Aggregate C1 / C2 / C4 40.21 → 40.85 / 53.30 → 52.83 / 64.68 → 64.63 (C2/C4 ranges overlap)
Cold TTFT 2K / 8K / 16K / 28K level (1.21 / 2.66 / 5.08 / 8.49 → 1.20 / 2.67 / 5.10 / 8.46 s)
Mean accepted tokens per step (rank 0, b1) 3.34 → 3.32, as expected with identical output

The prose gain we observed (+2.8%) is about half your RigMark +5.8%. Our cell is a different harness: sq_bench, 384 tokens, reasoning_effort: low, 3 reps × 2 boots, versus 3 × 4,096. So read ours as a same-direction observation, not a contradiction.

Qwen: this change only re-prices the pair under expert TP. The Qwen pair receipt from 11-11 (same patch on the old base: KL 0 / 34,245 positions, bench level) covers it, so we didn't re-run it.

Generated with Devin

@AzeezIsh
AzeezIsh merged commit c9b3fe3 into Atlas-Inf:main Nov 15, 2026
24 of 27 checks passed
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.

3 participants