Skip to content

Ling-3.2-air FP8 strict: greedy decode not reproducible run to run (NVFP4A16 is) #439

Backlog

Description

@AzeezIsh

Greedy decode of inclusionAI/Ling-3.2-air (the FP8 strict checkpoint) on the ling-3.2-air target is not reproducible run to run. The same binary with the same flags gives different text.

Evidence (sparky, one GB10). Flags: --kernel-target ling-3.2-air --gpu-memory-utilization 0.85 --kv-cache-dtype bf16 --max-num-seqs 8 --max-batch-size 8 --max-seq-len 65536 --enable-prefix-caching. Workload: greedy_eq C1, 8 prompts, temp 0.

  • Binary 666f616f (Serve Ling-3.2-air at 256K and LingSante Air-VL on one DGX Spark #411 head 8c7a4e86f + a91ada9fa): job 218 on 11-28 vs job 219b on 12-01 gives 0/8 identical. First differing character per prompt: 120, 157, 338, 259, 213, 166, 196, 208.
  • main 4f763f996's tree (binary f2247f94) vs that binary: 0/8, with divergences at similar positions.
  • primitive-ai/Ling-3.2-air-NVFP4A16 on the same binaries and harness is deterministic: C1 twice 8/8, C1 vs C8 8/8, and across builds 8/8 (jobs 218, 219).

So the non-determinism looks specific to the FP8 strict path (file-backed experts / FP8 expert GEMMs?). Each prompt is served alone (C1), so batch composition isn't the cause.

@data-angel could you take a look? It blocks any exactness claim for the FP8 strict recipe. Receipts: sparky ~/code/perf/nq-219-chain/greedy-LF*-c1.json, ~/code/perf/nq-216b-pr411/greedy-LF-c1.json.

🤖 Generated with Claude Code

Activity

  1. data-angel commented on Dec 3, 2026

    @data-angel
    Contributor

    @AzeezIsh Found the root cause and opened a fix in #445.

    NVFP4A16 stays deterministic because its weights are resident in device memory, whereas FP8 strict streams shards over GB10 hardware ATS from file-backed MAP_PRIVATE mappings (LingPagingReader). On Linux aarch64 (7.0.0-1019-nvidia, CONFIG_ARM64_4K_PAGES=y, CONFIG_ARM64_CONTPTE=y, NVIDIA 580.178.04, uvm_ats_mode=1, uvm_disable_hmm=Y), a 64 KiB-aligned file mapping lets Linux's contpte_set_ptes / __contpte_try_fold fold 16 contiguous 4 KiB PTEs of a large file folio into a 64 KiB PTE_CONT entry. When multiple GPU warps concurrently fault subpages 1..15 of an unmapped 64 KiB folio over ATS, faulting 32-byte cache sectors silently read subpage 0 ((addr & ~0xffff) | (addr & 0xfff)), returning FP8 weight bytes from 4-60 KiB earlier in the shard. Subsequent reads hit settled PTEs and return the real bytes.

    A standalone CUDA reproducer (no Atlas code) hit this 4 times on the inclusionAI/Ling-3.2-air shards with madvise(MADV_DONTNEED) alone (pgsteal_file=0, 54+ GiB free RAM), with every mismatched byte matching (foff & ~0xffff) | (foff & 0xfff). An interleaved A/B mapping the same 256 MiB pattern file twice in one process (64 KiB-aligned vs shifted by +4096) corrupted 29/5,000 (MAP_PRIVATE) and 16/5,000 (MAP_SHARED) on the aligned mapping against 0/5,000 and 0/5,000 on the +4096-shifted mapping (p < 3e-14). MADV_NOHUGEPAGE still failed (2/5,000 shared, 6/5,000 private) because it only disables PMD THP, not ARM64 contpte.

    #445 shifts LingPagingReader's MAP_PRIVATE shard base by +page_size off a 2 MiB boundary on linux/aarch64, breaking (va >> PAGE_SHIFT) % CONT_PTES == pfn % CONT_PTES for buddy large folios permanently across kswapd reclaim while keeping 4 KiB alignment and zero-copy ATS reads. On GB10 (4f763f9 + the +4096 shift), two fresh cold-cache server boots matched 8/8 on greedy_eq (reasoning, content, finish_reason, and completion_tokens) with unchanged speed (cold prompt 0: 193.2 s vs 191.4 s), and double-launching ling_fp8_gate_up_shared reported 0 mismatches across 1,760 token/layer launches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions