Skip to content

glm: SparkGLM 0.2.0 on main (#199, #242 and the SparkGLM series) - #309

Merged
AzeezIsh merged 209 commits into
Atlas-Inf:mainfrom
Enntity:sg/main-575db42e1
Nov 1, 2026
Merged

AzeezIsh merged 209 commits into
Atlas-Inf:mainfrom
Enntity:sg/main-575db42e1

Conversation

@data-angel

Copy link
Copy Markdown
Contributor

Summary

This puts SparkGLM 0.2.0's engine on main: GLM-5.3-Flash FP4-Local on two DGX Sparks, in Strict and Spark modes, with the same output as 0.2.0. It carries #199 (by @Mango-kid) as ported in #242, the parts of the old GLM stack that are not on main yet, and our 13-part SparkGLM series.

This is one PR because the stack it was written on is gone: #253, #254 and #256 are closed, and #242 is 301 commits behind main. The tree here builds and passes at its tip, and a split on a base that no longer exists would not. If you want it smaller, say how you would cut it. The Enntity/atlas branches sg-pr/* show the series one topic at a time, against its old base:

Branch What it does
sg-pr/defaults 0.2.0's behaviour, sampling and consolidated transpose
sg-pr/flashkda FP32-recurrence FlashKDA compiled in-tree
sg-pr/serve Serving modes, reference prompts and tool markup
sg-pr/vision Per-sequence vision state; the cache half is already on main through #303
sg-pr/fp4l FP4-Local on its native formats, opt-in per group
sg-pr/verify The split verify head serves sampled requests
sg-pr/pdl RNE weight entry and the PDL launch list
sg-pr/modelopt A plain map isn't FP4-Local; a GLM native policy keeps the checkpoint's bytes
sg-pr/video Frame cap and token budgets follow the checkpoint
sg-pr/router FP32 router logits
sg-pr/prefill Sequence-parallel prefill with DFlash, HC tiles, paged swizzle
sg-pr/guards Target weights take the RNE converter; a mode refuses fallbacks
sg-pr/sampled A sampled row never takes the masked-greedy shortcut

Part of #220.

Test plan

  • cargo fmt --all -- --check
  • ATLAS_SKIP_BUILD=1 cargo clippy --locked --workspace --tests -- -Dwarnings, CI's env
  • python3 scripts/check_spdx.py, and the 500-line cap on every file this adds or changes
  • typos: not run, not installed here
  • Unit suites, Linux, no GPU: atlas-core 215 passed; spark-runtime 557 passed; spark-model 2257 passed, 162 ignored; spark-server --bin spark 3042 passed, 3 failed. Those three say "not inside a git checkout", which is our container's mounted worktree. CI will show whether they pass there.
  • GPU tests at this tip: not run
  • Real model and hardware at this tip: not run, see below

Hardware results are from an earlier tree. Two DGX Sparks, TP2, 2026-11-01, Enntity/atlas a76faa010 (series on main 8c2b67218, with the vision port), image d768012285a7, against SparkGLM 0.2.0 engine c87f2790. Checkpoint nvidia/GLM-5.3-Flash-FP4-Local, drafter incoai/GLM-5.3-Flash-DFlash2, profile 4x1m.

  • Greedy 8/8, logprobs zero delta over 20,705 tokens, and the 109-check suite with all 109 outputs identical, in Spark and Strict.
  • Vision identical on 14 of 14 with equal cached counts, in Spark. 0.2.0 has no Strict vision baseline.
  • GPU unit tests: 24 passed. glm5_vision_native_encoder_oracle_dump and mxfp8_real_tensors_match_bf16_per_tp2_rank did not run, because they need checkpoint env vars we had not set.

Merged into this tree since then, not on hardware: main through 88010baee, which is #142, #159, #304, #306, #307 and #308. So the LM head change, the reference video port and the shard readers have not been tested together with GLM. SparkQwen output on this tip has also not been checked.

Open speed gaps against 0.2.0, observed on a76faa010, one arm each unless noted:

Notes for reviewers

Authorship

AI-authored (Claude Code), on top of #199 by @Mango-kid and #242 by @AzeezIsh.

🤖 Generated with Claude Code

Mango-kid and others added 30 commits October 15, 2026 02:30
Extract the model-independent compiler flag and closure-attestation prerequisite from native GLM integration. No GLM kernel sources or model registration are included.

Provenance: exact patch from d8bef5fc1e540707a6af58c32f78534e92ef8464 by Reiner Schmidt; underlying Atlas build and provenance machinery retains its original contributors.
Extract the generic arena accounting and hybrid dense/MoE reader-sizing fixes. Existing latent and normalization allocations now contribute to the reservation total. Dense models retain their sizing, while hybrid models reserve the activation formats their enabled readers consume.

Provenance: selected exact final hunks from65706c9b; sizing work by Jason McCartney in536dde355f622bb9ffede185d24f832451b4e974 and imported history e0bdf666. Original Atlas buffer implementation retains its contributors.

Validation: total-byte tests failed on the two missing allocations; hybrid test failed on absent scratch. All19 buffer tests pass with CI fail-fast GPU link stubs.
Extract reusable positional record I/O, reserved files, exclusive owner-only creation, filesystem classification and stale-file cleanup. Keep cache/model policy out of this storage prerequisite.

Provenance: exact atlas-tier subtree delta from Jason McCartney,361e54ecaa02071e916cdf3dd3a27c7d68e89e40, preserved at65706c9b. Existing Atlas storage authorship remains intact.

Validation: atlas-tier unit/integration/doc tests pass, including concurrent runs and direct I/O on the local filesystem.
Expose process-owned memory growth using NVML and the allocation ledger, plus anonymous and pinned host memory accounting. Keep GLM admission and KV budgeting policy in the dependent model change.

Provenance: runtime-only hunks from63fc8c473fefe6489fb1cb3d351fe0832c3eb701 by Jason McCartney; only patch context was adapted to omit unrelated PDL wiring. Existing Atlas allocator authorship remains intact.

Validation: spark-runtime CPU unit suite passes324 tests with4 ignored GPU tests, using CI fail-fast GPU library stubs.
Extract the complete generic communication subsystem: per-rail GID discovery, bootstrap agreement and deadlines, peer lifetime monitoring, host command ring, and graph-capturable one-shot collectives. No GLM model code is required by this prerequisite; dependent model code supplies optional kernel handles.

Provenance: exact final spark-comm and atlas-rdma subtrees and common rdma_oneshot.cu from 65706c9b. Jason McCartney source series includes dad333c8, b9a3b2a8, 380ff734, 6bee4a38, 9a89b8db and 2987a78f. Preserve in-source attribution to Jason Cook/local-inference-lab b12x RoCEnante and mmastrac arx for protocol ideas; no code imported from unlicensed sources.

Validation: default-profile CPU tests pass (26 atlas-rdma, 47 spark-comm); real verbs Rust paths type-check under explicit cfg without linking. All six prerequisite crates pass clippy --tests and fmt. NIC, CUDA execution and C verbs compilation remain untested on this host.
Extract the checked native ABI, source build, canonical layout and preload
contract before GLM model wiring so numerical and allocation requirements
can be reviewed independently. No external GLM engine or adapter is used.

Source: cf4bcc705934742f05fb876d345681e32f545495, 0404448f69a5882f30532b1cb413e0123cb76f5c,
59295a453401772e90eada42e4419fd2f4935920, 147cf69b450c1050a4d7ffe17275ff80aa25fe08.
Device code: MoonshotAI/FlashKDA at 1ce47ea3bb22c84eb9cc665028399cf35e8ffb0b;
MIT license, copyright, source hashes and modifications retained in vendor/.
Integration prior art: Jason McCartney / Enntity and Atlas contributors.

Validation: spark-runtime CPU unit/integration/doc tests, clippy and fmt.
This extraction has not been independently GPU-qualified.
Extract Jason McCartney / Enntity compiler changes from 5f5e8e9 and 4030dd6 as an independent prerequisite. Preserve source bytes and attribution; leave server rejection policy and GLM scheduling to later changes.
Keep Poolside function headers buffered until validation and flush pending
content consistently when streaming generation finishes. Add parser and
sanitizer regression coverage independent of model-specific call sites.

Extract exact source from corrected native core 65706c9b. Credit Jason
McCartney / Enntity for 8d260cb8 and upstream 1f98cd0 (import e0bdf666),
and Reiner Schmidt for c7cc091a. Existing licenses and notices are retained.

Validation: 2408 server tests passed, 12 ignored; spark-server clippy --tests;
workspace fmt. Earlier unrelated TUI environment/timing failures are retained
in the local extraction audit. No GLM runtime or scheduler wiring is included.
Route remote video through the video MIME policy, carry media for every
independently scheduled blocking choice, and honor raw-completion context
budgets and explicit request deadlines. Cover request decoding, remote media,
and real blocking dispatch with model-independent fixtures.

Extract source from corrected native core 65706c9b. Credit Jason McCartney /
Enntity for upstream 1f98cd0 (import e0bdf666) and Reiner Schmidt for the
pre-existing multi-choice media fix 5e483b06. Preserve original license notices.

The vision regression uses the original test path with a local generic app
fixture instead of the native core's GLM fixture. Its baseline witness fails
on choice 1 losing media; the production fix passes. The native-core stage
will restore its original consolidated fixture and test registration.

Validation: API and completion regression tests, parser/grammar coverage,
spark-server clippy --tests, and workspace fmt. GPU qualification applies to
the integrated source receipts only, not this independently derived branch.
Load the NVIDIA NVFP4 checkpoint and execute GLM attention, KDA, routed
experts, native sparse prefill and optional DFlash through Atlas. Keep
replicated KV in this first model stage; restore token sharding and NVMe
prefix caching separately. Retain SSM spill agreement and anonymous-file
cleanup, allocation rollback, numerical tests and native source notices.

This is a dependency-aware extraction of corrected core65706c9b, derived
from the Enntity candidate and reconciled with Atlas base7ffd183f. Shared
compiler, transport, memory, storage, KDA and server fixes are prerequisites.
Developer performance harnesses follow separately. The generic blocking
media regression fixture now shares the qualified GLM fixture again.

Credit: Jason McCartney / Enntity for the imported GLM architecture,
communication, context and verification work; Atlas contributors for the
base runtime; NVIDIA and MoonshotAI for credited native device sources.
Full original commits, licenses and source pins remain in docs/porting,
docs/glm-prior-art.md and vendor provenance manifests.

Source:65706c9b045cdc3569ddb0b1857406a683528017.
Context extraction:8e2ea922de58c52b497223935f41867dc58938b8.
Historical GPU measurements do not independently qualify this boundary.

Co-authored-by: Jason McCartney <[email protected]>
The retained BF16 GEMM and FP8 split-K probes share this module. Keep the exact helper from65706c9b with its current consumers; the optional MoE benchmark will reuse it in the following stage. Credit: Jason McCartney / Enntity and Atlas contributors.
Restore initial context features after the replicated-cache native core.
Keep shard geometry, ownership, sparse attention, prefix records, disk I/O,
configuration and their tests together. Shared SSM agreement and anonymous
file safety already remain in the core; consolidate them with the full
context helpers here. Performance-only developer harnesses follow separately.

Source: Jason McCartney / Enntity commits361e54ecaa02071e916cdf3dd3a27c7d68e89e40
and8b07f620d1f1dd496bc1dd6d2914919a658bbcc3, reconciled in corrected
native core65706c9b045cdc3569ddb0b1857406a683528017. Native Atlas prefill
and subsequent allocation/safety fixes remain intact. The exact feature
restore patch is checked against the preserved source tree.

Co-authored-by: Jason McCartney <[email protected]>
Restore the standalone performance examples, paired communication probe,
and CUDA microbenchmarks after their native runtime dependencies. Keep
correctness oracles, bit checks and native qualification tests with the
implementation. The example declarations and optional NCCL feature travel
with the examples they enable.

Source: corrected core65706c9b045cdc3569ddb0b1857406a683528017.
Credit: Jason McCartney / Enntity and the Atlas contributors named in the
preserved source history and prior-art documentation.

Co-authored-by: Jason McCartney <[email protected]>
Restore RC2 canonical verification, copy drafts, sharded disk prefixes and
context optimizations on the explicit initial context prerequisites.

Exact staged source: cb74ee4af8b968b86b9c41dc994776b6043f24bd.
Original imported source credits, license notices and history maps remain
in docs/porting and native device-code provenance. Original human work by
Jason McCartney / Enntity and Atlas contributors is retained. This is a
local dependency stack; historical receipts retain their measured revisions.

Co-authored-by: Jason McCartney <[email protected]>
Carry the previously reconciled native RC4 optimization and context work
without merging external engine adapters.

Exact staged source: 7b2bfe516d609053e9b9cd9b0603b74ed6fffb06.
Original imported source credits, license notices and history maps remain
in docs/porting and native device-code provenance. Original human work by
Jason McCartney / Enntity and Atlas contributors is retained. This is a
local dependency stack; historical receipts retain their measured revisions.

Co-authored-by: Jason McCartney <[email protected]>
Update the locked TLS dependency for RUSTSEC-2026-0346 through RUSTSEC-2026-0349. Keep all other dependency versions unchanged.
data-angel and others added 11 commits October 31, 2026 11:48
sg-pr/sampled 1a45692 (Azeez's GLM stack through stack/glm-video, then
the 13 sg-pr commits) onto sq/main-stack-20261031 7c72d7f.

Where main or the SparkQwen stack ported the same production code, main's
version stands, with the GLM pieces layered on: latent-shard KV carveout,
split-row sampled verify beside scored picks, DFlash warm save, complete
Poolside calls, tool_call_id in the template, the enum-value tool grammar.

Taken from the series because production has them and main does not:
embed_chunk's vision_splice_plan, items_in_range's straddling-item fix,
the quoted closing tag in reasoning, and the compaction claim release.

Dropped: the tool_repeat_notice key (main applies the notice to every
non-verbatim model, as production did) and the JSON null coercion for the
string "null" (production keeps the string).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
probe_frames took nb_frames, or duration × rate, with no upper bound, and
glm_sample_frame_indices grows one usize per sampled step of that count
before extract_t applies. Patching one stts entry in a 1,848-byte MP4 made
ffprobe 7.1.1 report 4,000,000,000 frames, a walk of about 13 GB.

Every stored frame takes at least a byte, so refuse a count above the
payload size. An honest clip is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLM pads one sampled frame into a temporal group, as the reference does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of c87f279's expert read-ahead, lost when the loader was split into
ffn.rs. The serial per-slice read took 2.6 s per MoE layer against 0.46 s.
Drops a test of a refusal neither video path makes any more: GLM pads one
frame into a group as the reference does, covered by its own test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Takes the series' stream tests, and restores its prompt-only radix release:
with vision prompts cached again, a finished vision sequence would drop
references it never took over its reply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps main's frame probing and tests, and the two vision cache tests only
this tree has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`should_defer_tensor` leaves CSF streams to the assembler and a CSF U32
stages as bytes, so main's two older expectations go. Router kernel
selection moves to `init_router` and the dead-rows GPU test to its own file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tree keeps its CSF assembler, which handles both encodings and checks
each scale against its weight, and takes Atlas-Inf#308's shard readers. Its tests get
a weight for every scale and an exception that decodes positive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh

AzeezIsh commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Gated this head (fa528fcb4) on reiner + spark2 against main 88010baee, both built fresh. I checked the Qwen side only, since GLM qualification is parked on our end. Receipts are in reiner's ~/code/night1027/out/dap-309-fa528fcb4/.

SparkQwen output at this tip is unchanged.

  • KL logit drift: exactly 0.
    • 34,245 of 34,245 positions in each of 2 spark-config boots (teacher-forced top-20 on 6 text cases, plus 4 generated chat cases).
    • 36,765 of 36,765 on rc16 with 3 images and a video, sent 3 times each so the vision cache is exercised.
    • Main against itself is 0.
  • BFCL ST-995: 87.54 / 86.85 (run-1793567001958073465), the same as main.
  • rc16: greedy C1 and C8 8/8 identical, tools 21/21.
  • Bench (sq_bench, spark config, interleaved boots, n=4–6 per cell): C1 59.97 vs 59.62, C2 91.97 vs 91.80, C4 141.95 vs 142.03.
    • Decode code/json/prose 92.74 / 71.25 / 61.08 vs 92.73 / 71.24 / 61.24.
    • TTFT at 2K/8K/16K is equal. 28K is 7.12 vs 7.09 s, with the ranges just apart (an observation, not a claim).
  • Boot to ready (armctl up): 74 / 80 s vs 75 / 74 s.

CI is green apart from the PR benchmark gate.

It now conflicts with main: #310 (weight_map shape validation) landed after your merge, and the only conflicting file is crates/spark-model/src/weight_map/quant_helpers_tests.rs. Please merge main in. If the new head differs from this one only by that merge, I'll merge it on green CI without another full gate. #310 gets its own main-sentinel KL run.

Open on your side, as your description says: GLM on hardware at this tip, and #255's GPU equality test.

@data-angel

Copy link
Copy Markdown
Contributor Author

GLM hardware run on fa528fcb4, the run the description promised. Every output check matches SparkGLM 0.2.0, in Spark and Strict. Speed is close, with small open gaps below. This run predates #310 to #313, so it covers this head on 88010baee only.

Setup: two DGX Sparks, TP2, 2026-11-01. This head is image 68423c3d394c, built without image checks, against 0.2.0 image 3bf64a4d04c9 (engine c87f2790). Checkpoint nvidia/GLM-5.3-Flash-FP4-Local, drafter incoai/GLM-5.3-Flash-DFlash2, profile 4x1m. Arms: k-par-spark, k-par-strict, k-020-spark, k-020-strict.

Output:

  • Greedy: 8/8 identical in both modes.
  • Prompt logprobs: zero delta over 20,705 tokens in both modes.
  • Suite: 109/109 in both modes. Compared with 0.2.0 file by file, only IDs and timing fields differ.
  • Vision: 14/14 with equal cached counts. Spark is against 0.2.0. Strict is against our earlier a76faa010 candidate, because 0.2.0 has no Strict vision baseline.

Spark speed: one arm of this head. The 0.2.0 arm in this run came first in its chain and its boot and cold 2K and 8K ran slow, for a reason I did not determine. So the table also shows earlier 0.2.0 arms on the same image and harness. These are observations, not an interleaved A/B.

This head 0.2.0, this run 0.2.0, earlier arms
Decode code tok/s 69.1 70.0 69.1–70.3
Decode JSON tok/s 53.2 54.1 53.9–54.3
Decode prose tok/s 39.4 39.5 38.7–39.6
C1 tok/s 39.9 39.5 38.1–39.9
C2 tok/s 53.1 52.4 52.6–53.4
C4 tok/s 64.2 64.3 63.2–64.2
Cold TTFT 2K, s 1.19 1.34 1.17–1.21
Cold TTFT 8K, s 2.58 2.79 2.52–2.57
Cold TTFT 16K, s 4.94 5.00 4.85–4.89
Cold TTFT 28K, s 8.27 8.22 8.12–8.40
Warm 8K later turns, s 0.353 0.368 0.356–0.367
Warm 20K later turns, s 0.361 0.377 0.365–0.371
Start to server live, s 37.1 45.5 33.5–36.0

Earlier arms: five for decode, cold TTFT and boot, four for concurrency and warm. The boot arms are not the same five, and boot here is measured from start.sh to the Server live log line.

Strict speed: one arm each, against 0.2.0. Decode is 25.9 vs 26.1 tok/s and C1 to C4 are flat at about 25.1. Cold TTFT is 1.14 vs 1.11 s at 2K and within 0.6% at 8K to 28K. Boot is 35.9 vs 35.8 s.

The gaps in the description, updated:

  • Boot: the 55 s vs 45 s gap is mostly gone. Spark is 37.1 s against 33.5–36.0 s for 0.2.0.
  • C2 and warm 20K later turns: both are back in or ahead of the 0.2.0 range in this arm.
  • First big prefill after boot +1 s: not re-measured.

Still open at this head:

Resolves the conflict with Atlas-Inf#310 in weight_map/quant_helpers_tests.rs by
keeping both sides: the block-scale tests from this series and Atlas-Inf#310's
ensure_checkpoint_shape test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AzeezIsh
AzeezIsh merged commit 8ad9c3c into Atlas-Inf:main Nov 1, 2026
25 of 26 checks passed
@AzeezIsh

AzeezIsh commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Merged. The new head 354da2156 is fa528fcb4 plus a merge of main 957122780. Compared against its base, this PR's diff is unchanged in 811 of 813 files. The other two are quant_helpers.rs and its tests, where you resolved the #310 conflict, and #310's CWE-125 shape checks are kept. So the Qwen gate on fa528fcb4 carries over, and CI is green. My main sentinel will KL-check the merged main against its parent next.

AzeezIsh added a commit that referenced this pull request Nov 2, 2026
strix-hip: define SWZ512 as the linear tile index (main stopped compiling for gfx1151 at #309)
AzeezIsh added a commit that referenced this pull request Nov 2, 2026
… builds broken since #309)

Image (gb10) on the head passed; CI green except the PR benchmark gate.
data-angel pushed a commit to Enntity/atlas that referenced this pull request Nov 2, 2026
Atlas-Inf#309 added vendored kernel sources under third_party/ that the GLM
kernels include by relative path, but the gb10 Dockerfile never copied
that directory, so every image build since 8ad9c3c fails at nvcc
(glm_sparse_native_attention.cu: third_party/nvidia_sparse_mla_sm120/
prefill_kernel.cuh not found) and main has had no ghcr image since.

Copy third_party/ into the builder, ship its licences and notices in the
runtime image next to the binary that embeds the compiled kernels, and
rebuild the image when third_party/ changes.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@maplepaladin73

maplepaladin73 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Hardware re-run on the merged tip — full interleaved A/B

Update to my earlier comment above: I re-ran this as an interleaved A/B, PR-tip image vs the pre-PR image built 2026-10-29, 3 reps each, same hosts, same checkpoint/drafter/profile. PR tip = merged head 354da2156 built from docker/gb10/glm-5.3-flash/nvfp4/Dockerfile (clean build, no image issues — #318's fix is in the base Dockerfile and this one copies third_party/nvidia_sparse_mla_sm120/ itself). Old = image from 2026-10-29 (3439912). GLM-5.3-Flash-FP4-Local (pinned rev) + DFlash2 γ=8, TP2, 4 slots, recipe env files (--enable-prefix-caching=false).

Functional (identical on all 6 arms, both images): tools right/forced/no-unwanted-call all pass; JSON-object mode passes; ~6.4K needle retrieved; vision probe answered correctly ("Red"); streaming complete; bad param → 400. One check failed on both images, so it's a harness artifact, not a regression: logprobs (my probe expected exactly 8 content logprob entries; the server returned fewer) and "bad model" (server returns 200 with a fallback rather than 400 — same on old).

Greedy 8 prompts: outputs differ between the two images. The cause is a serving-behavior difference, not a numerics failure: the PR tip serves with thinking_default=true, max_thinking_budget=0 (thinking on, so reasoning tokens eat the 512-token cap on 3 of 8 prompts — those end length with empty content), while the old image ran thinking_default=false, budget=256. Content where both finished within budget matches in substance (2+2="4", hash-table definition, planets). For a byte-for-byte output comparison the right follow-up is to run both images with thinking left on (GLM-5.3-Flash does not support thinking-off) and a max_tokens large enough that reasoning doesn't truncate the answer, comparing content and reasoning separately — or diff against the 0.2.0 reference outputs directly.

Speed, median of 3 interleaved reps (tok/s unless noted):

check PR tip pre-PR image
decode code 45.0 65.3
decode JSON 52.1 47.6
decode prose 42.5 33.0
C1 / C2 / C4 39.6 / 53.8 / 67.9 32.2 / 43.2 / 52.9
cold TTFT 2K / 8K / 16K / 28K, s 1.31 / 3.62 / 6.82 / 11.64 1.46 / 3.91 / 7.58 / 13.11
warm-turn TTFT 8K / 20K ctx, s 3.65 / 8.48 3.94 / 9.52
boot to server-live, s 107 206

Read: the PR tip is ahead on everything except single-request code decode (45.0 vs 65.3 tok/s, −31%, consistent across all 3 reps) — JSON +9%, prose +29%, C1 +23%, C2 +25%, C4 +28%, cold TTFT 8K–28K 7–11% faster, warm turns 7–11% faster, boot ~2× faster. The earlier single-arm "cold TTFT / boot regression" I posted was wrong — it was comparing against fa528fcb4's numbers from a different day/harness; the interleaved A/B shows the merged tip faster than the pre-PR image on both. My earlier warm-turn concern was a prefix-caching config artifact on both sides and is gone in this comparison.

The one real regression candidate: code decode −31%. Consistent, same harness, both images. Worth a look at what changed in the decode path between 3439912 and 354da2156 (the GLM series' sampled-row verify and decode-fuse changes are the likely area).

Not run: the 109-case suite diff and 20,705-token logprob zero-delta vs 0.2.0 (need the 0.2.0 harness artifacts, not in this repo); Strict mode; #255's GPU equality test; a thinking-disabled greedy byte-compare (follow-up noted above).

@data-angel
data-angel deleted the sg/main-575db42e1 branch November 3, 2026 05:07
vcruz305 pushed a commit to vcruz305/atlas that referenced this pull request Nov 11, 2026
…ling for gfx1151 at Atlas-Inf#309)

The strix-hip target links inferspark_prefill_paged_512.cu from gb10. Since
00a3750 (Atlas-Inf#309), that file's KV-tile loader indexes shared memory through
SWZ512, the XOR swizzle defined in gb10's prefill_paged_compute_512.cuh.
strix-hip has its own (native) copy of that header with no SWZ512, so every
strix-hip build fails: "prefill_paged_compute_512.cuh:148:9: error: use of
undeclared identifier 'SWZ512'" (DevLab run 41365776429, main 8ad9c3c).

This header reads the tiles linearly (smem_K[row * HDIM_512 + col]), so
SWZ512 here is that linear index, exactly what the loader wrote before
Atlas-Inf#309: strix-hip output is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@data-angel

Copy link
Copy Markdown
Contributor Author

@maplepaladin73 sorry this went two weeks without an answer. On the code-decode drop (45.0 vs 65.3 tok/s): I haven't reproduced your harness, so I can't say what it was. Two things I can add.

The GLM code-decode numbers on main since then are level with 0.2.0, on a different harness. Azeez's pair gates on #338 and #346 (11-14/15, SparkGLM 0.3.2 serve.py, 4x1m spark profile, sq_bench, medians of 6) read 70.22 and 70.07 tok/s on the PR arms. My own run on fa528fcb4 above read 69.1, against 69.1 to 70.3 for 0.2.0. None of these used DFlash2 at γ=8 with 4 slots and the recipe env files, so they don't rule out what you measured.

Your two images also served with different thinking defaults and budgets, as you noted, so the code cell may not have decoded the same tokens on both arms.

If you rerun current main with your flags and both arms set to the same thinking settings, and code decode is still low, please post the command line. We'll bisect it on our pair.

@maplepaladin73

Copy link
Copy Markdown
Contributor

PR 309 GLM code-decode A/B — results

Bottom line: the post-#309 code-decode drop is the thinking defaults, not an engine regression. @data-angel asked for a controlled A/B isolating this — the data confirms the thinking-settings mechanism.

On the pre-PR image the default code cell produces 2 reasoning tokens / ~510 answer tokens; on the PR tip (and on current main) the identical cell produces ~511 reasoning tokens / ~1 answer token — it hits the token cap inside <think> and decodes at the reasoning rate (~54 tok/s on the PR image, ~68 on main) instead of the answer rate (~77–84 on every arm). With thinking settings held identical across arms (matched: thinking on, effort low, budget 256), answer decode is level with the old image: old ~79.7, PR ~76.8 (−3.5%), main ~78.1 (−2.0%) tok/s — and on the original-prompt pass PR is ~5% above old. DFlash speculation engages inside and outside thinking on all three images (ATLAS_DFLASH_SPEC_THINK=1 on both ranks, every boot; mean verify width ~5 rows in-think vs ~7 after-think).

Setup: old = pre-PR image rev 34399129 (built 2026-10-29), pr = PR-tip image rev 354da2156 (built 2026-11-02), main = fresh build of Atlas-Inf main 86a0b0907 (Merge #384, built today). GLM-5.3-Flash-FP4-Local + DFlash2 drafter, --dflash-gamma=8, TP2, 4 slots, recipe env files, --enable-prefix-caching=false, ATLAS_DFLASH_WIDTH_LOG=1 on rank 0 — the same launch as the Nov-2 run. 6 boots (2/arm), 4 variants × 3 reps interleaved per boot + one pass per boot with the original code prompt, via scripts/dev/pr309_decode_ab/thinking_ab.py. Absolute numbers are decode-phase rates (first→last streamed chunk), not whole-request tok/s — the mechanism and direction match Nov-2.

--summarize (median of 3 reps)

tag variant n decode_tps answer_tps reasoning_tps reasoning_tokens answer_tokens accepted_pred finish
old-boot1 default 3 80.66 81.37 12.51 2 510 437 length
old-boot1 matched 3 79.61 79.87 12.54 2 1007 849 stop
old-boot1 max_nobud 3 71.01 73.81 57.64 285 1626 1591 stop
old-boot1 sq_shape 3 80.88 81.85 12.49 2 382 331 length
old-boot2 default 3 80.31 81.02 12.40 2 510 437 length
old-boot2 matched 3 79.37 79.61 12.40 2 1007 849 stop
old-boot2 max_nobud 3 70.69 73.43 57.34 285 1626 1591 stop
old-boot2 sq_shape 3 79.79 80.73 12.46 2 382 331 length
pr-boot1 default 3 54.07 – 53.97 511 1 369 length
pr-boot1 matched 3 76.76 77.02 23.65 3 953 812 stop
pr-boot1 max_nobud 3 62.53 – 62.50 2047 1 1603 length
pr-boot1 sq_shape 3 82.95 84.01 23.57 3 381 330 length
pr-boot2 default 3 54.11 – 54.01 511 1 369 length
pr-boot2 matched 3 76.41 76.67 23.66 3 953 812 stop
pr-boot2 max_nobud 3 62.18 – 62.15 2047 1 1603 length
pr-boot2 sq_shape 3 82.41 83.48 23.44 3 381 330 length
main-boot1 default 3 67.63 – 67.50 511 1 408 length
main-boot1 matched 3 77.36 78.11 11.90 2 974 828 stop
main-boot1 max_nobud 3 66.19 82.15 66.16 2047 1 1627 length
main-boot1 sq_shape 3 84.29 85.52 11.90 2 382 331 length
main-boot2 default 3 67.81 – 67.68 511 1 408 length
main-boot2 matched 3 77.34 78.10 11.64 2 974 828 stop
main-boot2 max_nobud 3 66.15 81.89 66.12 2047 1 1627 length
main-boot2 sq_shape 3 83.74 85.03 11.81 2 382 331 length

(main max_nobud: one rep exited thinking at 1539 tokens and produced 509 answer tokens at 82.15 tok/s.) The -orig prompt-file passes show the same pattern on the original cell: default old 74.6/74.3 vs pr 51.0/50.9 vs main 50.3/50.3; matched old 72.4/72.0, pr 75.7/75.7, main 73.5/73.4.

Fingerprints

boot image Id (identical both nodes) source rev SPEC_THINK r0/r1 clocks both nodes
old-boot1/2 sha256:696a3e3150a8… (2026-10-29) 3439912 1/1 2418 MHz
pr-boot1/2 sha256:bc1dd2c66f78… (2026-11-02) 354da21 1/1 2418 MHz
main-boot1/2 sha256:95420ec5d862… (2026-11-16) 86a0b09 1/1 2418 MHz

Serve cmdline identical on all arms: spark serve /model --kernel-target=glm-5.3-flash --world-size=2 --tp-size=2 --ep-size=2 --gpu-ordinal=0 --max-seq-len=32768 --max-prefill-tokens=4096 --max-batch-size=4 --max-num-seqs=4 --block-size=16 --kv-cache-dtype=fp8_g128 --ssm-h-dtype=f32 --ssm-rollback-mode=records --gpu-memory-utilization=0.88 --oom-guard-mb=12288 --ssm-cache-slots=0 --ssm-checkpoint-interval=0 --enable-prefix-caching=false --swap-space-gb=0 --no-auto-swap --no-tui --lm-head-dtype=bf16 --request-timeout=0 --tool-call-parser=poolside_v1 --bind=127.0.0.1 --model-name=glm-5.3-flash --dflash --draft-model=/draft --dflash-gamma=8 --dflash-window-size=2048 --mtp-gate=force (+ TP2 fabric/master flags). ATLAS_GLM_DFLASH=1, ATLAS_MTP_SPEC_THINK=0 on both ranks, every boot.

DFlash width/accept (rank-0 logs)

Accept lines: old default Done: 512 (length) 81.4 tok/s, p1=0.974 mean_na=5.662 tok_step=6.662 · pr default (all-think) Done: 512 (length) 55.0 tok/s, p1=0.773 mean_na=2.674 tok_step=3.674 · pr matched Done: 964 (stop) 78.1 tok/s, p1=0.967 mean_na=5.342 tok_step=6.342 · main default Done: 512 (length) 67.8 tok/s, p1=0.883 mean_na=3.961 tok_step=4.961 · main matched Done: 908 (stop) 77.1 tok/s, p1=0.979 mean_na=5.394.

DFLASH VERIFY rows=N split inside/after <think> (per-boot totals):

arm inside-think n / mean rows after-think n / mean rows
old 469 / 4.68 3413 / 6.79
pr 3882 / 5.13 1484 / 6.97
main 3685 / 4.99 1582 / 6.89

Caveats and one observation

  • Errors/deviations: the first main build used the generic all-target docker/gb10/Dockerfile, which doesn't set CUTLASS_HOME → Atlas native KDA was not compiled into this build (4 failed boots); rebuilt with docker/gb10/glm-5.3-flash/nvfp4/Dockerfile → clean boots. The two main boots therefore ran back-to-back at the end rather than interleaved. No request errored (144/144 reps have stop/length + full usage).
  • On all-think workloads (default, max_nobud) main decodes reasoning ~25% faster than the PR image (67.7 vs 54.0) — something between 354da2156 and 86a0b0907 improved in-think decode; answer-phase rates are level.
  • Single-harness observations under the fingerprint above (temp 0, n=3 medians, deterministic replays — boot1/boot2 splits are bit-identical). Full jsonl + rank logs retained; happy to share.

Run by an automated agent under my direction; orchestration + analysis as above. Thanks again @data-angel for pushing for the controlled measurement — the "drop" was the template/defaults changing what the cell decodes.

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.

4 participants