You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ling-3.2-air FP8 strict: greedy decode not reproducible run to run (NVFP4A16 is) #439
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.
main4f763f996'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.
@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.
Activity
data-angel commentedon Dec 3, 2026
@AzeezIsh Found the root cause and opened a fix in #445.
NVFP4A16stays deterministic because its weights are resident in device memory, whereas FP8 strict streams shards over GB10 hardware ATS from file-backedMAP_PRIVATEmappings (LingPagingReader). On Linux aarch64 (7.0.0-1019-nvidia,CONFIG_ARM64_4K_PAGES=y,CONFIG_ARM64_CONTPTE=y, NVIDIA580.178.04,uvm_ats_mode=1,uvm_disable_hmm=Y), a 64 KiB-aligned file mapping lets Linux'scontpte_set_ptes/__contpte_try_foldfold 16 contiguous 4 KiB PTEs of a large file folio into a 64 KiBPTE_CONTentry. When multiple GPU warps concurrently fault subpages1..15of an unmapped 64 KiB folio over ATS, faulting 32-byte cache sectors silently read subpage0((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-airshards withmadvise(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) corrupted29/5,000(MAP_PRIVATE) and16/5,000(MAP_SHARED) on the aligned mapping against0/5,000and0/5,000on the+4096-shifted mapping (p < 3e-14).MADV_NOHUGEPAGEstill failed (2/5,000shared,6/5,000private) because it only disables PMD THP, not ARM64contpte.#445 shifts
LingPagingReader'sMAP_PRIVATEshard base by+page_sizeoff a 2 MiB boundary onlinux/aarch64, breaking(va >> PAGE_SHIFT) % CONT_PTES == pfn % CONT_PTESfor buddy large folios permanently acrosskswapdreclaim while keeping 4 KiB alignment and zero-copy ATS reads. On GB10 (4f763f9+ the+4096shift), two fresh cold-cache server boots matched 8/8 ongreedy_eq(reasoning,content,finish_reason, andcompletion_tokens) with unchanged speed (cold prompt 0: 193.2 s vs 191.4 s), and double-launchingling_fp8_gate_up_sharedreported 0 mismatches across 1,760 token/layer launches.