Repository navigation
glm: add native prefill and FP4-Local support for dual DGX Spark - #199
Conversation
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.
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.
Port Jason McCartney / Enntity SparkGLM tool-choice and response-format union support, including branch-mass selection and reasoning/speculation boundaries. Keep strict response-format requests fail-closed when the selected parser has no tool grammar. Original commits and source credits are recorded in docs/porting/tool-json-union.json. Validation: 2771 server unit tests passed; all-features clippy, rustdoc and static checks passed. The live two-turn probe is included for subsequent GPU validation.
Adapt Jason McCartney / Enntity side-projection packing, planar KDA convolution, fused HC input normalization and sequence-parallel seam overlap. Preserve Atlas native KDA/sparse kernels and current-main Qwen prefill pipelines. Check all four switches in rank startup agreement. Exact upstream commits, adaptations and validation limits are recorded in docs/porting/GLM_5_3_FLASH_PREFILL.md. All switches remain opt-in pending local GPU equivalence and timing. Focused CPU tests: 32 passed; spark-model clippy and rustdoc, formatting and kernel shadow checks passed. No GPU result is claimed.
Keep the initial FP8 cache bounded, identify the pinned checkpoint layout and avoid linking a public API document to a private constant.
|
@Mango-kid I rebased this onto current main + #198 (Qwen FP4-Local TP2) as draft #223, stacked on #198, with full credit to you. There were 12 conflicted files; each resolution is written up in |
#198's host-decode set scooped every module with no registered native consumer into mxfp8_to_bf16. On glm5_next (no registered consumers) the FP8_PB_WO shared experts — E4M3 weights with 128x128 FP32 block scales — hit that codec and failed its per-32 E8M0 shape check at build: GLM-5.3-Flash FP4-Local would not load on port/199-on-198. Restrict host_decode_modules to MXFP8 plus NVFP4-family modules without a native consumer, and have expand_module require the declared MXFP8 algo before calling mxfp8_to_bf16. FP8_PB_WO tensors stay resident for the model's own loader (#199's shared_expert_requantizes_from_fp8_blocks path). Qwen FP4-Local unchanged (byte-identical).
…/vision_budget/vision_limits/guard_stop)
The merged parser produced None for field-less quantized_layers entries; Enntity stores a plain string default, and consumers (incl. the #199 parse test's 438 MXFP8 count via Some("")) expect Some("").
…d in the restack; adjusts a #199 file)
…/vision_budget/vision_limits/guard_stop)
|
GLM-5.3-Flash NVFP4 on our dual DGX Sparks, using the recipe branch ( Our env vs the recipe:
Full startup logs and the test script are on our side; happy to paste either here. Drafted by Emily (AI assistant, Mistral Large 4) for maplepaladin73. |
…series; data-angel) Qwen-side KL + bench gate on reiner + spark2 (#220, receipts on the PR) at fa528fc: KL 0 vs main over 34,245 x2 + 36,765 positions incl. vision, BFCL 87.54/86.85 = main, greedy 8/8, tools 21/21, bench neutral. 354da21 = fa528fc + main (only the #310 conflict area changed). GLM-side results are data-angel's (see the PR). CI green except the PR benchmark gate.
|
@maplepaladin73 Thanks for testing both paths and reporting the plain-decode startup failure. Follow-up: #316 uses one active/admitted sequence for plain decode at 32K with FP8 KV, and explicitly reserves the native sparse path's 4100-row workspace. The optional DFlash2 profile retains four slots. Adding I also answered the benchmark-profile question on #242. The 97.19 C1 and 168.85 C4 figures were from different checkpoints/context profiles, not a matched FP4-Local pair; the reply links the original receipts and gives the exact settings. |
Summary
Add native GLM-5.3-Flash support on two DGX Sparks for NVIDIA NVFP4 and FP4-Local checkpoints, with FP8 target cache and optional separately downloaded DFlash2 weights. Atlas builds and dispatches its own KDA and sparse-MLA prefill kernels. The integration includes RC2/RC4 correctness, KV sharding and prefix restoration, native compressed-scale/MXFP8 loading, optional exact prefill optimizations, and a constrained tool-call-or-JSON-answer path.
This branch now integrates main at
e29809db9f3fd75611b7a1ed491f55275d34df0e. Main already includes the earlier GLM implementation through #174; the remaining diff contains the native prefill integration and subsequent improvements. Main's newer Qwen/Nemotron support and rustls 0.23.46 update are preserved. Checkpoint-native GLM MTP and new Strix functionality remain outside this release.Current update
Server runtime tested at
5d652f8e0835231ead3bcac91d66e22632c08cbe. Later edits are documentation and a test-only ownership correction at3dbb41fb494f3db3993d9e620de1b8009adc901d; the server binary is unchanged.The four switches remain opt-in. Their documented default-promotion criterion requires repeated interleaved comparisons and isolation of each switch's contribution. Results and limits record timing definitions, thinking behavior, memory minima and advisories.
Previous main-integration qualification
The following results belong to the preceding merge and do not qualify the new runtime. Merged implementation:
a37b789bec6dc2def8128c257d465f923c07a4a8.e29809dbreproduced the failure at 63.2 tokens/s, using the same hardware, checkpoint, builder, benchmark settings, and thresholds. Both completed every request with 320 output tokens and zero request errors. This is a failure also present on main, not a passing qualification; neither result was overwritten and no threshold was lowered.The committed October 15 results retain their original measured revision and do not qualify this merge. The deployment recipe provides both ranks' commands, a bounded FP8-cache starting configuration, explicit optional DFlash2, and network/VPN guidance.
Notes for reviewers
Atlas owns loading, scheduling, distributed KV/SSM state and kernel dispatch, and builds its prefill sources without serving through another engine. The new checkpoint loader touches shared scale decoding, file loading and ownership tracking. The tool/JSON union changes shared grammar and sampling code. CPU tests and bounded GLM checks cover the current update; the cross-model GPU results above retain their preceding source revision.
Source pins, licenses and contributor credits are in
docs/glm-prior-art.md,docs/porting/glm53-fp4local-sources.json, the prefill source ledger and native vendor notices, including Jason McCartney's Enntity/SparkGLM work. Apache-2.0 vLLM/FlashInfer reference functions used by test generators retain their notices inthird_party/csf_references; small NVIDIA checkpoint fixtures retain separate upstream terms intest_data/FP4_LOCAL_NOTICE.md. Target and optional draft checkpoint terms remain separate. This integration is AI-assisted; Reiner Schmidt is the submitting contributor. Reiner confirms that he has Jason McCartney's permission to use his work. Atlas maintainers should confirm whether that permission satisfies their CLA and commercial-relicensing requirements and resolve the remaining contribution-policy questions. No CLA signature or additional grant is asserted on another contributor's behalf.Historical benchmarks retain their measured revisions. The current GLM validation is bounded; no enlarged-capacity or general accuracy claim is made.
CLA