Skip to content

glm sp: the pair gathers MoE and MLA inputs quantized by default (retires ATLAS_GLM_SP_QUANT_GATHER_PAIR; cold prefill −3%, exact) - #383

Merged
AzeezIsh merged 1 commit into
Atlas-Inf:mainfrom
Enntity:glm/pair-quant-gather-default
Nov 16, 2026

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Summary

@data-angel this builds directly on your #347. Your mode 1 was exact and faster on our pair, so this makes it the default and drops the switch.

Pair gate (2x DGX Spark, reiner + spark2, TP=EP=2)

Fingerprint: GLM-5.3-Flash-FP4-Local @ 76348ddb + DFlash2 @ 7d74cdd8. SparkGLM 0.3.2's serve.py 4x1m spark-mode launch (KV shard on, --gpu-memory-utilization 0.91), with only argv[0] swapped. Binaries are built from fresh clones at d8bcc1785 (main) and 5ebf67df9 (this PR), and are sha-matched on both ranks. There are 2 boots per arm, interleaved. 2026-11-16, glmgate.job.sh qg.

Instrument Result
Teacher-forced top-20 logprobs, 6 text cases up to ~20K tokens + 4 chats 27169 / 27169 positions exact (both boots), floor main-b2 vs main-b1 also exact
Vision/video logprobs (3 images + 1 clip) 29488 / 29488 exact
Vision under 2 live decodes (vmix) 5 / 5 identical
Greedy, 8 prompts, C1 and C8 8 / 8 identical each
Tool probe 21 / 21 both arms
Engagement The PR's rank-0 log shows GLM SP MoE quant gather and GLM SP MLA quant gather with no switch set; main's log shows neither

Bench medians (n=4 per cell for TTFT/conc, n=6 for decode), observed under the fingerprint above:

Cell main PR
cold TTFT 16K 5.07 s [5.02-5.17] 4.91 s [4.87-4.94] (−3.2%)
cold TTFT 28K 8.47 s [8.45-8.49] 8.17 s [8.17-8.20] (−3.5%)
cold TTFT 2K / 8K 1.20 / 2.66 s 1.20 / 2.64 s
decode prose / code / json (C1) 40.86 / 70.14 / 55.61 tok/s 40.86 / 70.13 / 55.52 tok/s
C2 / C4 aggregate 52.86 / 64.53 tok/s 53.13 / 64.64 tok/s

This matches #347's own ATLAS_GLM_SP_QUANT_GATHER_PAIR=1 arm from the 11-15 gate (TTFT 16K 4.90, 28K 8.18, bit-exact).

Tests

  • glm_sp_tests::every_sp_split_gathers_quantized: pair and chain splits gather quantized, and a lone rank does not.
  • glm_prefill_sp::tests::only_the_chain_cuts_its_chunks_to_the_tile_grid: the pair keeps its chunks, piped or not.
  • The startup parity table and its test drop the retired entry.
  • cargo test -p spark-model --lib glm_sp (68 passed), --lib startup_parity (13 passed), --lib glm_prefill_sp (2 passed).
  • fmt, clippy (ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests), typos, SPDX and the LoC cap are all clean.

Generated with Devin

…_GLM_SP_QUANT_GATHER_PAIR

PR Atlas-Inf#347's mode 1 measured bit-exact against mode 0 on the two-rank pair
and ~3% faster on cold prefill, so the pair now always takes it; mode 2
was never output-validated and gained nothing, so it is deleted. One
fewer env var on the budget.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AzeezIsh
AzeezIsh merged commit b27ecb9 into Atlas-Inf:main Nov 16, 2026
24 of 27 checks passed
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Merged as b27ecb94a after the pair gate above. CI matched main's baseline: the env budget, PR benchmark gate and cargo deny jobs fail on main as well, and every workspace job (test, clippy, fmt, LoC, nvcc PTX, release matrix) passed. @data-angel, FYI: ATLAS_GLM_SP_QUANT_GATHER_PAIR no longer exists, so any SparkGLM profile that sets it can drop it. An unset/unknown env var is ignored, so 0.3.2 profiles keep working unchanged.

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

@data-angel, here are profile notes from the pair (reiner + spark2), in case they're useful for SparkGLM. Fingerprint: same as the gate above, main b27ecb94a unless noted, nsys --cuda-graph-trace=node windows on both ranks. Numbers are observed under this fingerprint and single-harness.

  1. Our harness ran on one RDMA rail. I listed only rocep1s0f1 / rocep1s0f0. SparkGLM's start.sh passes both PCIe-domain devices of the cable. Raw ib_write_bw gives 108 Gb/s on one rail and 186 Gb/s on both. Main with both rails against main with one was bit-exact on every instrument, with cold TTFT 16K 5.09 → 4.81 s and 28K 8.50 → 8.04 s (n=4 each, non-overlapping) and decode level. The A/Bs on glm vision: borrow the tower's scratch from the prefill arena (~+15% KV pool at TP=2, image/video unchanged) #338/scheduler: a pair under expert TP may verify one draft (prose +5.8% on 2x DGX Spark) #346/glm sp: quantized MoE and MLA gathers on the pair (cold prefill +3.1%, exact) #347/buffer arena: three GLM-5 per-pass buffers sized for what they hold (KV pool +11% at TP=2, stacked on #338) #348/glm sp: the pair gathers MoE and MLA inputs quantized by default (retires ATLAS_GLM_SP_QUANT_GATHER_PAIR; cold prefill −3%, exact) #383 stay valid (both arms identical), but their absolute prefill numbers are ~5% slower than your product setup. The harness now passes both rails.
  2. Decode is not dispatch-bound. The GPU is 98.7% busy on rank 0 at C1. Per verify step (~51 ms, prose), with PDL overlap removed: routed MoE 22 ms (≈ the bandwidth roofline for the experts it reads), W4A16 GEMVs 12 ms, rdma_oneshot_bf16 4.2 ms (140 per step × 30 µs), FP8 GEMVs 3.8 ms. The step cost grows ~7.4 ms per extra accepted row (new experts), so C4 is MoE-bandwidth-bound too.
  3. Prefill after two rails (12.5K tokens): the GPU is 95.6% busy on rank 0 and 93.3% on rank 1. With one rail it was ~90%, waiting on host-staged exchanges. Time splits as grouped MoE ~20%, sparse MLA ~12%, GEMMs ~21%, hyper-connection mixing ~9%, KDA ~8%.
  4. The tail-checkpoint split costs +0.13 s on every cold prompt from ~100 to 4K tokens (same binary with ATLAS_NO_TAIL_SPLIT=1, n=3 per length). The second pass is a ≤32-row pass that sweeps most experts. Without the split, warm repeats lose their restore (0.18 → 0.42 s at 285 tokens), so it can't just be dropped. A mid-pass KDA state capture would remove it, but changes the cold/warm shape invariant the split was built for.
  5. The KV pool binds on rank 0 at half of rank 1 (57K vs 115K blocks). reiner exposes 2.0 GB less memory (kernel 6.17 vs 6.11 on spark2). Rank 0 also alone holds the vision tower's weights (0.54 GB concatenated + 0.27 GB dequantized to BF16, from ATLAS_ALLOC_LOG_MB). With b % world latent ownership, rank 1's surplus can't be used.

@data-angel

Copy link
Copy Markdown
Contributor

@AzeezIsh thanks for these notes.

  • The knob: SparkGLM sets ATLAS_GLM_SP_QUANT_GATHER_PAIR=1 in install/serve.py, and its mode tests and docs/ENGINE.md mention it. I'll drop all three when SparkGLM's engine pin moves past b27ecb94a. Until then it's ignored, as you say.
  • Two rails: yes, SparkGLM's start.sh passes both devices of the cable, so your corrected harness now matches our product setup.
  • 4 (tail-split cost) and 5 (rank 0's KV pool at half of rank 1's): we'll take both. For 5, the first thing I'll measure is moving the vision tower's weights off rank 0 against weighting latent ownership by free memory. For 4, I'll look at a mid-pass KDA state capture that keeps cold == warm, since that invariant is the reason the split exists. I'll open an issue for each with the plan before sending code.

@data-angel

Copy link
Copy Markdown
Contributor

Opened #386 (tail-split cost) and #387 (rank 0's KV pool), each with the plan and gate.

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