llama.cpp b13024 Pipelined Direct IO: 151.7s to 9.53s Cold Prefill on DGX Spark, Yet a 31% Decode Trap at 1.42x RAM
- Get link
- X
- Other Apps
Local AI · Breaking Engineering Brief
Release b13024 merges PR #33698 with zero CLI flags required, overlapping 8-thread NVMe reads with GPU uploads on Linux and Windows. Severe RAM overflow runs dramatically faster, but rigs hovering near the 1.2x auto-trigger lose 31% decode speed unless overridden.
By The Benchmarque Staff · · 4 min read · Read original at thebenchmarque.com
All throughput numbers, latency figures, memory ratios, and code caveats come directly from the official ggml-org/llama.cpp release b13024 and Pull Request #33698 benchmarks and maintainer review logs recorded on December 4-6, 2026.

llama.cpp b13024 pipelined direct IO in 4 cards
DGX Spark prefill
9.53 s
Down from 151.7 s on mmap and 15.62 s on #33490 for DeepSeek-V4-Flash (156 GB).
1.42x RAM decode trap
-31%
Maintainer @ngxson measured decode falling from 22.0 to 15.2 t/s at 16 GB VM RAM.
Pinned staging RAM
64 MiB
32 pinned slots of 2 MiB per device replace the prior 512 MiB staging buffer.
Auto-enable trigger
1.2x RAM
Activates automatically with 8 threads; override via LLAMA_MOE_CACHE_DIRECT_IO=0/1.
llama.cpp release b13024 shipped at 10:52 PM ET on December 5 with pipelined direct IO for Mixture-of-Experts (MoE) streaming (PR #33698). Cold prompt prefill for a 156 GB DeepSeek-V4-Flash file on a 121 GB NVIDIA DGX Spark drops from 151.7 s on mmap down to 9.53 s, while decode rises from 0.89 t/s to 4.50 t/s. Yet rigs hovering near the 1.2x auto-trigger face a 31% decode slowdown unless overridden.
What happened: verified vs. unconfirmed
Earlier direct IO work (#33490 by @carmenlok) read a 512 MiB staging block from disk, uploaded it to the GPU, and synchronized before pulling the next chunk. PR #33698 (by @am17an, with native Windows unbuffered overlapped ReadFile support by @ServeurpersoCom) replaces that staging block with a ring of 32 pinned slots of 2 MiB per device across 8 fixed reader threads. Each slot uploads as soon as its read finishes while a completion event gates slot reuse, keeping NVMe and the GPU copy engine busy simultaneously.
Confirmed (primary source): Pinned staging drops from 512 MiB down to 64 MiB per device, saving shared memory on unified-memory boxes like GB10 and Strix Halo. Direct IO activates automatically with no CLI flag whenever mapped host experts exceed 1.2x available memory (Linux MemAvailable or cgroup v2 memory.max, or Windows available physical memory). Numerical correctness against mmap on Qwen3.5-35B-A3B Q8_0 showed a max KLD of 5.5e-5 and 100% identical top tokens.
Still unconfirmed / watchlist: No broad PCIe 4.0 versus PCIe 5.0 NVMe crossover curve against the 1.2x threshold has been published yet, and three review cleanup nits (Windows file handles, per-read event creation, and legacy cgroup v1 detection) remain open for follow-up commits.
By the numbers: five verified hardware runs
| Hardware & OS | Model & mapped experts | Baseline (mmap / #33490) | b13024 pipelined | Outcome |
|---|---|---|---|---|
| DGX Spark (GB10, 121 GB, Linux) | DeepSeek-V4-Flash (156 GB / 137 GiB) | 151.7 s / 0.89 t/s | 9.53 s / 4.50 t/s | Cold-cache win (9.26 s / 4.57 t/s run 2) |
| RTX PRO 6000 (24 GiB cgroup, QLC 1.5 GiB/s) | Qwen3.8-Flash-Next IQ4_NL (63 GiB) | 32.34 s / 2.46 t/s | 20.48 s / 2.50 t/s | Major prefill cut on QLC NVMe |
| RTX 5060 Ti (32 GB RAM, Win, PCIe 5 SSD) | Qwen3.6-35B-A3B Q8_K_XL (38.5 GB) | 42 t/s / 13.6 t/s | 130 t/s / 15.2 t/s | Prompt triples; decode climbs |
| RTX 5080 (64 GB RAM, Linux) | DSv4.1 (123.00 GiB / 53.63 GiB free) | 4.5 tok/s | 6 tok/s | 2.5-3 GB/s vs. 1.0-1.6 GB/s reads |
| RTX 5060 Ti (16 GB Linux VM, 1.42x RAM) | Qwen3-30B-A3B Q6_K (22.15 GiB) | 106.5 t/s / 22.0 t/s | 146.2 t/s / 15.2 t/s | Prompt +37%; decode -31% trap |
On a 20 GB VM (1.13x ratio), b13024 leaves direct IO off and hits 28.1 t/s decode (vs. 15.3 t/s if forced on). On an 8 GB VM (22.15 / 7.65 GiB), direct IO jumps prompt speed from 42.9 to 140.3 t/s and decode from 11.0 to 15.1 t/s.
What builders should do right now
Heavy RAM overflow (experts roughly double free RAM or more): Upgrade to llama.cpp b13024 and keep the defaults. The 8-thread pipelined ring activates automatically, cuts pinned staging from 512 MiB to 64 MiB, and accelerates both Linux and Windows NVMe reads.
Tight overflow (just above 1.2x free RAM, such as 1.42x): Benchmark with LLAMA_MOE_CACHE_DIRECT_IO=0. When the OS page cache already holds most hot decode experts on a single NVMe drive, bypassing it drops generation speed by 31% even though prompt prefill rises 37%.
Caveats and open nits: Maintainer @ngxson noted that Windows currently holds 3 open handles per model file, creates and closes an event per 2 MiB read, and legacy Linux cgroup v1 containers are ignored. Contributor @zarbis also saw automatic fallbacks to mmap until clocking down an unstable 64 GB RAM kit cleared the read errors.
Quick answers
Does llama.cpp b13024 require a new CLI flag for pipelined direct IO?
No. Release b13024 removed the earlier --moe-cache-io-threads flag, fixes the reader pool at 8 threads, and enables direct IO automatically whenever mapped host experts exceed 1.2x available memory.
How can builders disable direct IO if decode speed drops in b13024?
Set the environment variable LLAMA_MOE_CACHE_DIRECT_IO=0 before launching llama-server or llama-cli. Setting LLAMA_MOE_CACHE_DIRECT_IO=1 forces direct IO on regardless of available memory.
Why did pinned staging memory drop from 512 MiB to 64 MiB?
Instead of reading a full 512 MiB staging block before synchronizing with the GPU, PR #33698 uses a ring of 32 pinned slots of 2 MiB per device (64 MiB total) so NVMe reads and GPU uploads overlap continuously while saving RAM on unified-memory machines like GB10 and Strix Halo.
Size your local AI RAM, NVMe, and GPU budget
Read full interactive edition on thebenchmarque.com
Related tools: Can It Run Local LLM Calculator · Live Local AI Hardware Leaderboard
Sources
- Get link
- X
- Other Apps
Comments
Post a Comment