Skip to content

glm: native prefill and FP4-Local for dual DGX Spark (#199 by @Mango-kid, rebased onto main + #198) - #223

Merged
AzeezIsh merged 69 commits into
stack/vision-probefrom
port/199-on-198
Oct 29, 2026
Merged

AzeezIsh merged 69 commits into
stack/vision-probefrom
port/199-on-198

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Summary

Test plan

Tracking: #220. Supersedes #199 only if @Mango-kid prefers; happy to push this to his branch instead.

Generated with Devin

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.
@AzeezIsh

AzeezIsh commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

GitHub closed this PR automatically during a restack: its base branch was briefly pushed to a commit containing its head, an accident reverted within minutes, and nothing reached main. Continued in #242, on the same branch.

AzeezIsh added a commit that referenced this pull request Oct 29, 2026
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