Skip to content

Serve Ling-3.2-air at 256K and LingSante Air-VL on one DGX Spark - #411

Merged
AzeezIsh merged 67 commits into
Atlas-Inf:mainfrom
Enntity:ling/3.2-air
Dec 1, 2026
Merged

AzeezIsh merged 67 commits into
Atlas-Inf:mainfrom
Enntity:ling/3.2-air

Conversation

@data-angel

@data-angel data-angel commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add native Ling-3.2-air text and image serving on one GB10. Ling combines KDA and MLA with 512 routed experts per MoE layer. Its original FP8 shards alone occupy 120.4 GiB, so the strict path pages expert weights from disk while preserving their bytes and scales.

The second path loads Primitive AI’s NVFP4A16 checkpoint. Large prompt batches can quantize routed activations, and small decode batches can use NVFP4 attention projections. The measured profile keeps the checkpoint’s BF16 vocabulary head. The changes also cover recurrent state and prefix reuse, continuous batching, and the model’s tool-call format.

Benchmarks

One DGX Spark, 40,960-token context, BF16 KV, speculation off. Atlas and stock vLLM used the same Primitive AI checkpoint. The figures below use the BF16 output head.

Workload Atlas vLLM
Single-stream prose, tok/s 43.70 21.60
Single-stream structured output, tok/s 44.09 21.61
Four-client prose, aggregate tok/s 83.78 78.80
Eight-client prose, aggregate tok/s 115.35 123.22
32K cold / exact replay, seconds to first token, first matched pair 12.00 / 0.0135 14.66 / 0.2875

Both engines completed both prose prompts and both structured prompts. Both exhausted the 4,096-token budget on the stock thinking-enabled code prompts. With thinking disabled, both returned visible code on the same Go prompt. The optional NVFP4 vocabulary head missed one prose completion.

Benchmark measurements, controls and rooflines

256K context and LingSante Air-VL

Ling’s full-attention layers now store the shared rotary key once per token. This takes 28.44 GiB for 262,144 slots across seven BF16 KV layers. On one Spark, the NVFP4A16 profile recalled an initial key from 262,132 input tokens with a 12-token output budget. It reused 480 prefix tokens and answered in 482.53 seconds. The original FP8 profile also allocated a full sequence and passed its arithmetic smoke.

The Air-VL loader handles inclusionAI’s MXFP4/32 expert matrices and its original BF16 checkpoint. MXFP4 is resident on GB10. BF16 experts are file-backed. Bailing’s image path now uses the published CLIP channel statistics. The packaged Strict server loaded all 50 original BF16 shards from a USB SSD on GB10, advertised 131,072 tokens and returned the same correct text and image answers.

At a matched 4K window, Atlas and SGLang returned identical arithmetic and image answers and identical text for both 64-token streams. Atlas decoded at 10.47 and 10.48 tokens/s compared with 28.37 and 27.59 for SGLang’s FlashInfer MXFP4 backend. The earlier 40K table covers the original Ling model and engine revision.

Context, model pins, raw responses and rates

Native MTP and Air-VL follow-up

Ling-3.2-air's appended head now drafts one token per step. Prompt priming computes just the predictor's K/V in tiles. Verification batches two target rows and snapshots the KDA recurrent and convolution state at the rejection boundary. On one GB10 and three 64-token greedy streams, ordinary decode measured 44.34 / 44.95 / 45.32 tok/s for counting, prose and Python. The native head with KV-only priming measured 59.04 / 50.47 / 53.99 and accepted 29 / 23 / 25 predictions. Counting and Python matched ordinary output. Prose differed. The SparkLing launcher keeps MTP opt-in. Requests, raw streams and controls

The vectorized Air-VL MXFP4 expert GEMV raised the original 10.47–10.48 tok/s to 30.26–30.31 on unchanged publisher weights. A new paired SGLang run measured 29.22–30.12. With routed experts converted directly from the original BF16 to NVFP4 and optional in-memory NVFP4 attention, shared/dense MLPs and output head, Atlas measured 54.07–54.98 without drafting. All Atlas configurations answered the arithmetic and image controls correctly. The converted expert outputs were closer to BF16 on all 15 sampled experts. The fastest profile matched BF16 on 57/68 teacher-forced positions. On the second distinct cold 2,048-token input Atlas took 0.829 s and SGLang took 0.671 s. Checkpoint provenance, accuracy, speed and rooflines

Atlas also accepts inclusionAI's and Primitive AI's revised config layout, including the 4,608-wide vision merger and top-level video boundary tokens. Old configs still parse. The updated model releases have identical hashes across all pinned inference files except config.json.

Test plan

  • cargo fmt --all -- --check
  • Built and served the pinned image on one physical DGX Spark. Verified concurrent answers against eight serial answers, shared-prefix retrieval, image input, and a forced tool call.
  • Compared original-checkpoint FP8 arithmetic with SGLang during bring-up. Strict serving receipt
  • Built the new ARM64 product image with its workspace test and Clippy gates. Compared compact-cache decode to a CPU attention oracle and tiled prefill to per-query attention.
  • Upstream CI, including the containerized license-header check. The local Docker daemon was unavailable for that check.

One-Spark drafting comparison

On identical 64-token greedy requests and the same Primitive A16 checkpoint, Atlas with one native draft reached 59.04 / 50.47 / 53.99 tok/s on counting / prose / Python. vLLM with the publisher’s three-token lookahead reached 46.91 / 29.44 / 47.61. The scalar verification control reproduced all three ordinary continuations. Fast verification changed the prose continuation. Matched streams and controls

LingSante Air-VL has no embedded predictor. SparkLing can now attach only Ling’s predictor block to its BF16-derived Santé NVFP4 target using the same Atlas implementation. Drafting increased counting from 54.27 to 60.98 tok/s, prose from 54.30 to 57.66, and Python from 53.69 to 68.87. Counting was 2.05× the fresh SGLang publisher-MXFP4 counting result. Counting and Python matched undrafted target output exactly. Prose changed. Both arithmetic and image-color checks passed. Santé measurements and checkpoint provenance

Authorship

Developed with OpenAI Codex under data-angel’s direction.

data-angel and others added 30 commits November 23, 2026 12:40
`--tool-guard stream` screens the same calls as `on`, at the same point
(each call's end, and the aggregate size bound as bytes arrive), but sends
a call's header and arguments as they are written instead of holding them
until the call passes. A call it blocks, or one the response cuts off,
ends the response `content_filter` (not `tool_calls`) with
STREAMED_REFUSAL, which says part of the call streamed and that it must
not be run. Poolside v1 calls stay held: its detector buffers them anyway.
`off` and `on` are unchanged, and `off` stays the default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 887d178)
Under `--tool-guard stream` every request got its tool calls as they were
written. A client that does not read `content_filter` would run a call the
guard blocked at its end, or an unclosed one. A request now gets streamed
tool calls only with the body field `stream_tool_arguments: true` (an Atlas
extension on /v1/chat/completions); without it the call is held, and the
response is the same as under `--tool-guard on`. This covers the generic
stream path and the Poolside v1 string-argument path. Under `on` and
`off` the field is accepted and ignored. A working-directory hint,
ATLAS_BUFFER_TOOL_ARGS and tool retry still hold a call as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 1a36752)
data-angel and others added 5 commits November 25, 2026 06:20
…stimate

- ling_latent_decode now runs the absorbed attention on BF16 mma: each warp
  keeps its query fragments in registers, 32-key tiles stream through shared
  memory two at a time, and the online softmax runs once per head per tile.
  Plain decode on a GB10 beside other work, 256 tokens after a prompt of
  2K / 32K / 128K / 262K tokens: 42.8 / 37.6 / 33.0 / 28.0 tok/s (the FP32
  version: 42 / 30.9 / 16.5 / 10.3).
- The Ling loader no longer overrides the cache's per-layer geometry with
  the old 32 x 130 expanded layout, and the paged cache honours V aliasing
  for any model that asks for it, not only GLM's plan.
- The load pre-flight uses Ling's measured 1.02 device/disk ratio (1.05
  with margin) instead of the generic 1.3, which projected 94.3 GB for
  72.5 GB of weights and refused to load beside 20 GB of other work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The single-request prefill takes an MLA prompt in one chunk only when the
model has no paged-history prompt kernel (supports_chunked_mla). The batched
and mixed paths checked is_mla() alone, so two or more long prompts arriving
together reached Ling as whole 49K- or 245K-token chunks and failed against
the 8,192-row arena. Both paths now use the same gate. Eight simultaneous
65,524-token Ling prompts then each recalled their own key (524,192 prompt
tokens in 279 s on one GB10).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drafted Ling decode in 0.1.1 ran 2-3% behind 0.1.0. An nsys profile of the
same eight drafted requests put the attention path at 77 us per layer per
step against 0.1.0's ~40. 0.1.0 read kv_b_proj as NVFP4 (2 MB per layer)
for each new token; the absorbed form reads both BF16 halves (8 MB) every
step, and its kernels and a 256-key minimum split were latency-bound.

- ling_q_absorb reads a BF16 transposed key half (kb_t [heads * 512, 128],
  made once at load) and ling_v_up the value rows, one warp per output row
  with coalesced loads, a fixed shuffle reduction, and a loop over the rows
  present only: 21.7 and 21.3 us per call (27.7 and 25.1), near the 4 MB
  bandwidth floor.
- Decode splits hold at least 64 keys, not 256: 11.3 us per call (19.3).
- Attention path 59 us per layer per step. Drafted 54.4 / 53.8 tok/s against
  0.1.0's 55.0 / 54.4 on the same GB10; drafted text equals plain decode.

NVFP4 copies of both halves were tried and reached 0.1.0's speed, but in the
absorbed form the key half's error reaches every cached token's score:
against vLLM on the same weights, decode-path top-1 agreement fell to 92.6%
(BF16: 95.2%, 0.1.0: 94.5%) and GSM8K-200 to 192 (0.1.0: 196). BF16 stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commit kept BF16 absorption because a small decode-path sample
(about 100 positions) and GSM8K-200 suggested NVFP4 absorption cost fidelity.
A larger sample settles it: against vLLM on the same weights, over ~775
decode positions in 220 contexts, top-1 agreement and total variation are
equal within error for 0.1.0 (94.2% +/- 0.8, 0.049), NVFP4 absorption
(95.0%, 0.050) and BF16 absorption (94.3%, 0.050). GSM8K-200 moved by up to
four problems between numerically equivalent builds (Air-VL: 193, 192, 189).

- Under NVFP4 decode precision (ATLAS_LING_NVFP4_DECODE=1) the key half (as
  kb_t, then released) and the value half of kv_b_proj are quantized to NVFP4
  at load like every other Ling NVFP4 decode projection. ling_q_absorb_nvfp4
  gives a thread each 64-byte row (11.6 us per call; a warp per row measured
  16.7), ling_v_up_nvfp4 a warp each row (11.3 us). Both reduce in a fixed
  order over the rows present, with the E2M1 table in shared memory.
- Checkpoint precision (Strict) keeps the BF16 kernels.
- Attention path 38.8 us per layer per step (0.1.0 ~40). Drafted 54.1-54.9
  tok/s against 0.1.0's 54.4 in alternating runs on one GB10; drafted text
  equals plain decode on all eight probe prompts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ling-3.2-air's predictor layer expects the target's final-normed hidden:
the reference implementation's target model returns its rows after
`model.norm`, and the predictor applies its own `hnorm` on top. Atlas hands
over the raw residual stream, so Ling's predictor saw unnormalized rows.
Verify kept the output exact, so nothing looked wrong except the speed:
first-draft acceptance sat near 70% on every prompt, including text the
predictor should never miss.

The predictor now applies `model.norm` to the target rows before `hnorm`,
in `append` and in the tiled prime that serves prompt and catch-up rows.

Measured on one DGX Spark, SparkLing 0.1.1 launch arguments, eight greedy
256-token prompts, first-draft acceptance and decode tok/s (before -> after):

  Ling-3.2-air      counting 0.735 -> 0.992, 57.0 -> 66.0
                    Python   0.652 -> 0.966, 53.5 -> 64.0
                    JSON     0.427 -> 0.843, 46.4 -> 61.3
                    mean of eight         54.8 -> 61.1
  LingSante (borrowed predictor) counting 0.700 -> 0.992, mean 54.1 -> 57.1

vLLM serving the same NVFP4A16 checkpoint and predictor accepts 100% of
first drafts on counting and Python. Output text is byte-identical to 0.1.1
on all sixteen prompts.

The DraftProposer impl moves to ling_mtp/proposer.rs; ling_mtp.rs was
already over the 500-line cap and both files are now under it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) label Nov 26, 2026
data-angel and others added 5 commits November 26, 2026 02:33
Several drafting sequences now verify in one forward and draft in one
predictor pass, instead of Ling declining speculation past one request.

- KDA layers take decode_verify_multi: two rows per sequence, each
  sequence's rollback snapshot after its first row; the recurrence runs as
  two ling_kda_batch launches (every first row, then every second row; the
  kernel gains a row stride and base).
- can_batch_verify admits Ling at two rows per sequence; the batched verify
  uses decode_position, so text after a Ling image keeps its shifted RoPE.
- LingMtp::propose_batch: embed, merge, MLA + MoE body, head and argmax over
  all rows at once (w4a16_gemv_batch tiers, row-invariant).
- The NVFP4 decode copy of the attention projections serves up to 32 rows
  (was 8; 9+ fell back to a BF16 GEMM), the router and BF16 projections take
  the batched GEMV in 8-row chunks below 32 rows: a verify row is the bytes
  serial decode computes for it.

RigMark 1.1.0 short-code concurrency, one Spark, thinking off (tok/s,
C1/C2/C4/C8): 0.1.2 engine 58.3/66.1/98.8/142.3, this 58.7/91.1/121.3/~142.
C8 is bound by routed-expert reads (512 experts, top 8).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SparkLing 0.1.3 drafts for up to four requests (ATLAS_MTP_MAX_SEQS=4), so a
batched verify has at most eight rows, and those always took the batched
GEMV tiers. The 16- and 32-row NVFP4 tiers and the 8-row chunking of the
router and BF16 projections only changed prompt chunks of 9-31 tokens (common
as a prefix-cache tail): their projections and routing no longer matched
0.1.2's, and single-request output changed on 7 of 8 probe prompts. Back to
0.1.2's kernels for those widths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Long-context prefill spent most of its time in the shared BR=64 paged kernel
at HDIM 192 (half the warps idle during QK^T, P through shared memory, V
padded 128 -> 192) and in re-expanding the whole prefix from the latent for
every 2048-row prompt tile.

- ling_mla_prefill.cu is now a Ling-specific port of SparkQwen's
  prefill_paged_rows128 layout: QK^T 192 wide, PV 128 wide, ldmatrix K/V,
  P in registers, one barrier per key tile, compact [rows][32][128] output.
  It reads expanded rows directly, so the identity block table, V's zero
  tail, attn_padded and the narrowing copy are gone. Bit-identical to the
  BR=64 kernel per row (tests/ling/mla_prefill.cu: output, softmax state
  and BF16 bytes over seven shapes); 3.5x faster on a visible 8192x8192
  tile (62.5 TFLOP/s), 2.8x on the causal tile.
- Prompt tiles are a whole 8192-row chunk, so each layer expands its prefix
  once per chunk instead of four times. Projections still run 2048 rows at
  a time (LingProjection::forward_pieces), because the BF16 GEMM's rounding
  follows its row count.

One Spark, 0.1.3 release image with this binary, cold prefill TTFT:
8K 2.41 -> 2.25 s, 32K 12.70 -> 9.55 s, 64K 34.61 -> 21.78 s,
128K 106.83 -> 55.06 s (1,227 -> 2,381 tok/s; vLLM MTP3 1,842).

Greedy text is unchanged on the eight probes (Ling and LingSante) and on
20K/50K prompts, and prompts within one chunk are byte-identical to 0.1.3
including logprobs. Longer prompts move logprobs at rounding level: 0.1.3
expanded a key differently for different query tiles; both builds sit the
same distance from vLLM's logprobs on those prompts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
c7bf36c made prompt tiles chunk-wide and ran the projections in fixed
2048-row pieces, but it rounded the tile down to 128 rows of the prompt:
a 2634-token prompt became 2560 + 74 rows where 0.1.3 had 2048 + 586. The
BF16 GEMM rounds by its row count, so those rows changed bits, and that was
enough to flip LingSante's forced-tool note in the demo (0.1.3: a complete
517-token call; c7bf36c: 800 tokens, blocked by the tool guard).

Projection pieces are now the old tile exactly (2048 rows, or the prompt
rounded down to 128 below that) and attention tiles are whole multiples of
that piece. On the 0.1.3 release image with this binary: the note is the
same 517-token call byte for byte; Ling prompts of 1,000, 2,634, 4,000 and
8,000 tokens and the eight probes (Ling, LingSante) keep their logprobs
exactly. Prompts longer than a chunk still differ at rounding level, from
the once-per-chunk key expansion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… batched verify (#48)

Lift artificial speculative-decoding and batched-MoE limits on Ling-3.2-air
while preserving bit-exact greedy parity and zero quality regression:

- Unlock speculation inside <think> blocks by implementing verify_bit_exact
  and batch_verify_bit_exact for Ling.
- Support chained multi-step MTP drafting (num_drafts=1..=3, K=2..4) with
  post-norm hidden chaining, speculative row rollback, multi-window private
  MTP KV cache, K=3 Prometheus accept/reject counters, and ragged ks
  batched KDA/MLA verify (eliminating serial fallbacks on ragged batches).
- Fix 7-arg vs 8-arg ABI mismatch in batched MTP w4a16_gemv_batch2/batch3
  dispatch.
- Restore 9-32 row NVFP4 decode/verify projection tiers (keeping cuBLASLt
  BF16 GEMM above 8 rows) and lower grouped_a16_prefill threshold from 128
  to 33 to close the 33-127 row MoE dead zone.

Verified on GB10 (ennspark04): 60/60 Ling unit tests, clippy -D warnings
clean, draft_decode.py pass, task_probe.py 30/30 math & 10/10 tools,
SparkModelBench 15/15 decode gates (code 66.15 vs 49.80 tok/s, prose 57.10
vs 49.02, structured 67.14 vs 54.28; C1/C2/C4 concurrency +35%/+30%/+30%).
@AzeezIsh

Copy link
Copy Markdown
Contributor

@data-angel Since my 11-25 gate, this branch has 17 new commits (MLA latent cache, batched MTP verify and draft, the 128-row MLA prefill). Two questions before I re-gate:

  1. Is f9d0ebf95 ready for review, or are you still adding to it?
  2. Does any of it address the crash from jobs 191 and 193 (a mixed decode + long prefill-chunk step, CUDA_ERROR_ILLEGAL_ADDRESS in layer 29 at concurrency 4)? 4420a6110 ("Chunk batched MLA prompts when the model reads paged history") looks related.

It now conflicts with main in four files: factory/build.rs, vision_tower.rs, vision_encoder/glm/test_tower.rs and serve_phases/config.rs. build.rs is where #430 just added the Inkling window plan, beside the KV-cache construction. Once you say it's ready, I'll merge onto main and re-run 191's probe at concurrency 1 and 4, plus the no-regression set.

🤖 Generated with Claude Code

@data-angel

Copy link
Copy Markdown
Contributor Author

Ready for review and re-gating at 8c7a4e86f — no more feature commits planned on this PR.

1. Merged main + CI cleanups (0f64c6ae9, 8c7a4e86f)

  • Merged Atlas-Inf/atlas main (cb4dcf9a7), keeping Inkling 2: window-bounded KV for the sliding-window visits (1/4, SparkInkling 0.5.1 engine) #430's window_plan alongside Ling's v_aliases_k in factory/build.rs, both Ling and Inkling2 in vision_tower.rs / test_tower.rs / inkling2_vision.rs, and the bailing_moe_v3_vl vocab-cap exemption through both cap_vocab_size and cap_vocab_size_to_tokenizer.
  • Ran cargo fmt (entry.rs, mod.rs) and fixed a typos hit on the "ths" einsum subscript in tests/ling/ling_attention.py.

2. Jobs 191 / 193 crash (CUDA_ERROR_ILLEGAL_ADDRESS on layer 29 at C4)

4420a6110 only covered run_batched_prefill / run_batched_mixed (multiple prompts arriving together). It did not touch the run_standard mixed-forward path that hit in jobs 191 and 193.

In Ling-3.2-air, layer 29 is an MLA layer (layer_group_size = 6: layers 5, 11, 17, 23, 29, 35, 41), and grid=[2048,1,1], block=[512,1,1] is ops::rms_norm on kv_a_layernorm (kv_lora_rank = 512) surfacing the asynchronous fault.

The race was in crates/spark-model/src/model/trait_impl/decode_b.rs::mixed_forward_dispatch (fixed in b787d7d8f):

  • When self.is_mla_dispatch() takes the sequential fallback, it called self.decode_batch(..., stream) (which ignores stream and launches on self.gpu.default_stream()) and immediately launched self.prefill_chunk(..., stream) on prefill_stream with no synchronization between them.
  • Both passes then ran concurrently over the shared BufferArena (hidden_states, residual, scratch, gate_logits_f32) and LingLatentScratch, corrupting live metadata/tables on the GPU (same cross-stream race as tests: roster 'env' field passes container -e flags in run_all_models #110 in Model::mixed_forward_batch).
  • b787d7d8f synchronizes default_stream before prefill_chunk, runs prefill_chunk first on stream, copies a finishing prefill's logits row above 0..decode_rows so decode_batch cannot overwrite row 0, and synchronizes stream before launching decode_batch on default_stream.

We have not re-run a live GB10 C4 server benchmark after b787d7d8f (verified locally with cargo fmt, clippy, typos, and spark-runtime/spark-model/spark-server unit tests), so a fresh C4 mixed-forward run on the gate will confirm the fix end-to-end.

3. Ling FP8 strict (inclusionAI/Ling-3.2-air) at C2 (--max-num-seqs 8)

Yes — Strict FP8 (120.4 GiB weights, file-backed experts) is a reference/exactness path rather than a concurrent-throughput target; concurrent decode requests contend on disk-backed expert reads.

The 0.2–0.4 tok/s and ~94 s TTFT seen on 144e10776 (0.1.0) were also much worse than current HEAD: 144e10776 still used the uncapped expanded-KV pool (~68 GiB), which starved the Linux page cache for experts. Since f9d0ebf95 (0.1.1+), the 576-wide MLA latent cache is 14× smaller and Strict caps the KV pool at 8 windows (15.8 GiB at 262K), leaving RAM for page-caching experts (~1.9–2 tok/s single-stream).

@AzeezIsh

Copy link
Copy Markdown
Contributor

@data-angel Thanks, and thanks for tracing the 191/193 race. I started the re-gate at 8c7a4e86f, but the ling-3.2-air target doesn't build on that head:

kernels/gb10/ling-3.2-air/nvfp4/skinny_mma.cu:2:10: fatal error: ../../qwen3.6-27b/nvfp4/skinny_mma.cu: No such file or directory

#431 moved skinny_mma.cu from the qwen3.6-27b overlay to kernels/gb10/common/, and your Ling file includes it by the old path before appending ling_expert_mma. The merge applied cleanly because git saw no conflict, but the include broke. The fix is one line:

-#include "../../qwen3.6-27b/nvfp4/skinny_mma.cu"
+#include "../../common/skinny_mma.cu"

check_kernel_shadows.py passes with it. Could you push exactly that? Meanwhile I'm gating 8c7a4e86f with this line applied (tree 9decafaef; sparky job 218, queued behind one job): the C=4 quality probe from 191/193, a stall probe that forces the mixed decode + prefill step, 4 × ~37K concurrent prompts, C=1, tools, greedy, cachehit, cross-contamination, agentic, the FP8 strict boot, and the Qwen3.8-27B / Inkling no-regression set. If your push has the same tree, the results carry over.

The CI runs for the new head were awaiting approval; I've approved them. nvcc -> PTX (all gb10 targets) should show the same error.

🤖 Generated with Claude Code

@github-actions github-actions Bot removed the needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) label Nov 29, 2026
@AzeezIsh

Copy link
Copy Markdown
Contributor

@data-angel The race fix holds. I gated 8c7a4e86f + the one-line include fix from my last comment (a91ada9fa, tree 9decafaef) against main cb4dcf9a7 on one GB10 (sparky job 218), with 191's flags (Ling-3.2-air-NVFP4A16, 8 seqs, 0.85, BF16 KV, prefix cache; max seq 65,536).

The 191/193 crash is gone

check result
quality_probe at C=4 (191's trigger) arithmetic 40/40, needle 12/12, server alive
stall probe: 2 streaming decodes + a cold ~41K-token prompt, 3 reps (forces the mixed decode + prefill-chunk step every time) all served. The decoders' worst gap is 7.78 s, prompt TTFT 25.8 s
4 × ~25K concurrent needle prompts, then serial 4/4 · 4/4 answered, needles 4/4
quality_probe at C=1; tool probe 40/40 · 12/12; 14/14
greedy C1 twice; C1 vs C8 8/8; 8/8
cachehit warm == cold; cross-contamination 6/6; 8/8 identical, 0 contaminated
decode (sq_bench): C1 code / json; aggregate C1 / C2 / C4 / C8 27.6 / 27.7 tok/s; 27.0 / 43.4 / 67.1 / 93.3
inclusionAI/Ling-3.2-air (FP8 strict) boots and serves greedy yes
ERROR / panic lines in the serve logs 0 (my log scan flagged 4 "panicked" hits, but they were inside the model's own cargo test | grep panicked tool calls)

agentic-webserver ×10: webserver_ok 10/10, followed_directions 7/10, 15.6 s/turn. All three misses hit the 40-turn cap before finishing the run and teardown steps. Ling isn't on main, so there's no baseline; I'm noting it, not blocking on it (Qwen3.8-27B and Inkling score 10/10 on this harness).

No regression on main's models: Qwen3.8-27B QAD exact profile lp_dump 26,912 tokens max|Δ| 0.0000, greedy C1 / C8 8/8 · 8/8. Inkling 2 Mini Strict greedy C1 / C8 8/8 · 8/8, image 3/3.

CI: three items before I can merge

  1. The skinny_mma.cu include (my last comment). It also fixes cargo test's no_model_shadow_drops_a_common_kernel: the detector follows #includes, so the dangling path left your file with no kernels and produced 17 phantom drops. With the fix, kernel_shadow_detector passes 6/6.
  2. The 500-line cap. Nine files are over it and not allow-listed:
LoC file
928 layers/ling_mla.rs
763 layers/ling_decoder.rs
670 layers/ling_moe_a16.rs
539 layers/vision_encoder/enc_impl/init.rs (482 on main)
536 model/trait_impl/prefill_b/mrope_pos.rs (390)
519 model/trait_impl/prefill_b/mrope_pos_tests.rs (465)
518 layers/ling_moe.rs
505 model/trait_impl/decode_a.rs (473)
503 layers/ling_kda.rs

(all under crates/spark-model/src/). Code moves only (submodules in the layers/qwen3_attention/ style) are fine, and I'll re-check greedy identity on the result.
3. Env budget: +8 ATLAS_* names (1,141 → 1,149). main is over the ratchet too, so this isn't blocking, but fold what you can.

Once those are pushed, I'll confirm the tree differs from what I gated only by the splits, re-run greedy identity and the C=4 probe, and merge.

sparky nightq 218 · main cb4dcf9a7 q27 9c3261bd ink d3b020d8 · PR 8c7a4e86f + a91ada9fa ling 666f616f q27 325b4657 ink 87ec1d36 · 2026-11-28

🤖 Generated with Claude Code

@AzeezIsh

AzeezIsh commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@data-angel I pushed two commits to this branch so it can merge (please pull before you push again):

  • 9cac0e838 the one-line skinny_mma.cu include fix from my 11-28 comment (fixes nvcc -> PTX and no_model_shadow_drops_a_common_kernel).
  • b12e59113 code-move-only splits of the nine files over the 500-line cap. ling_mla, ling_decoder, ling_moe (+_a16) and ling_kda become directories in the layers/qwen3_attention/ style. In the four shared files, only the Ling code this PR added moved out: enc_impl/init_ling.rs, prefill_b/mrope_pos/ling.rs, prefill_b/mrope_pos_tests/ling.rs, and trait_impl/decode_position.rs (from decode_a.rs). No logic changed. The sorted non-blank code lines match before and after for every file.

The workspace CI jobs pass on b12e59113. I'm re-gating the merge chain main will get (#411 → #397 → #399 → #425) on sparky (job 219): Ling greedy identity against job 218's gated tree, the C=4 probe and stall probe, plus the no-regression set. I'll merge once it's clean.

🤖 Generated with Claude Code

@AzeezIsh

AzeezIsh commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@data-angel Gated and merging. Sparky job 219, one GB10, built from fresh worktrees: main cb4dcf9a7 vs the merge chain main gets, M1 = main + b12e59113 (tree 161a90f16), then #397 and #399 on top (M3). 191's flags (Ling-3.2-air-NVFP4A16, 8 seqs, 0.85, BF16 KV, prefix cache, max seq 65,536).

check result
the splits: greedy C1 / C8, M1 vs job 218's gated tree (9decafaef) 8/8 · 8/8 identical
Ling after #397 + #399: greedy C1 / C8, top of the chain vs M1 8/8 · 8/8
quality_probe C=4 (the 191/193 trigger); C=1 40/40 · 12/12, server alive; 40/40 · 12/12
stall probe (2 decodes + cold ~41K prompt, 3 reps) TTFT 25.75 s, worst decoder gap 7.78 s (218: 25.8 / 7.78)
4 × ~25K concurrent needle prompts, then serial 4/4 · 4/4, needles 4/4
tools; cachehit warm == cold; cross-contamination 14/14; 6/6; 8/8 identical, 0 contaminated
sq_bench C1 code / json; aggregate C1 / C2 / C4 / C8 27.8 / 27.8; 27.1 / 43.7 / 66.8 / 94.1 tok/s (218: 27.6 / 27.7; 27.0 / 43.4 / 67.1 / 93.3)
Qwen3.8-27B, Flash-Next FP4-Local, Inkling 2 Mini vs main all exact (lp_dump max|Δ| 0.0000, greedy 8/8, vision 4/4, tools 14/14)
ERROR / panic in serve logs 0

One follow-up for you, not blocking. Greedy decode of inclusionAI/Ling-3.2-air (the FP8 strict checkpoint) isn't reproducible run to run. Job 218's own binary (666f616f), re-run today with the same flags, is 0/8 identical to its 11-28 run, with first divergences at characters 120–338. M4 vs 218 shows the same pattern. NVFP4A16 is deterministic on every comparison above, so it looks specific to the FP8 path (file-backed experts?). Could you look into it? An exact-verify claim would need it fixed.

Agentic ×10 wasn't re-run (218: webserver_ok 10/10, followed_directions 7/10).

sparky nightq 219 / 219b · main cb4dcf9a7 · M1 267f39f88 ling 4a3a5811 · top 105890150 ling f2247f94 q27 61b27e7b fnext 0408f718 ink bef49147 · 2026-12-01

🤖 Generated with Claude Code

@AzeezIsh
AzeezIsh merged commit 4175fcc into Atlas-Inf:main Dec 1, 2026
24 of 27 checks passed
AzeezIsh added a commit to Enntity/atlas that referenced this pull request Dec 1, 2026
…pseek_v41

Conflicts in five files, each two additions in the same place (Ling-3.2-air from Atlas-Inf#411, DeepSeek-V4.1 here):
config.rs and config/dispatch.rs parser imports, the factory loader list and its Supported string,
model_type_ships_vanilla_norm_weights, and supports_chunked_mla_impl (DeepSeek-V4.1's early return
kept ahead of Atlas-Inf#411's Ling/GLM expression). Both sides kept everywhere.
@data-angel

Copy link
Copy Markdown
Contributor Author

@AzeezIsh Traced the FP8 strict non-determinism from your follow-up note to an ARM64 CONFIG_ARM64_CONTPTE=y (PTE_CONT) + GB10 hardware ATS fault bug on 64 KiB-aligned file mmaps. Details are on #439 and the fix is up in #445 (8/8 identical across two fresh cold-cache boots on GB10).

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