How the ring buffer works

The work builds on PR 33490, whose contributor is explicitly credited for the underlying direct-I/O implementation and fallback to mmap. The new layer overlaps reading and copying. Instead of reading a 512 MiB stage, uploading it and synchronizing before the next stage, it uses a ring of 32 pinned slots of 2 MiB per device. Each slot is uploaded as soon as its read completes.

An event recorded after the upload controls when that slot can be reused. Disk access and the copy engine can therefore work concurrently, while pinned staging memory falls from 512 to 64 MiB per device. The contributor highlights shared-memory systems such as GB10 and Strix Halo. That 64 MiB figure describes the transfer buffer, not the total memory required for the model or its expert cache.

Automatic I/O selection

For large batches, uploads belonging to one weight are collected and issued together at the end of expert-copy scheduling. This avoids draining the pipeline after each group between cached experts. Direct I/O is selected automatically when memory-mapped host experts exceed available memory by more than a factor of 1.2. An environment override can force that choice on or off.

Available-memory accounting uses MemAvailable or the cgroup limit on Linux and available physical memory on Windows. The reader thread count is fixed at eight. Windows support uses unbuffered overlapped ReadFile operations. Having a Windows path does not establish identical behavior on every filesystem or storage device; the underlying work also retains a fallback to mmap.

Benchmark conditions and results

On a DGX Spark with GB10 and 121 GB of memory, the contributor tested DeepseekV4-Flash with a 156 GB file, 137 GiB of mapped experts and a 16,000 MiB cache. With the model page cache dropped before each run, a 418-token prompt took 9.53 and 9.26 seconds, compared with 15.62 and 15.94 seconds for the preceding direct-I/O PR. Decoding 64 greedy tokens moved from 4.18–4.27 to 4.50–4.57 tokens per second.

A second test used an RTX PRO 6000, QLC NVMe at approximately 1.5 GiB/s, Qwen3.8-Flash-Next IQ4_NL with 63 GiB of experts, a 24 GiB cgroup and an 8000 MiB cache. Processing a 432-token prompt fell from approximately 32.3 to 20.48 seconds, while decoding changed only from 2.45–2.46 to 2.50 tokens per second. The two phases show substantially different gains.

Applying the results carefully

The contributor reports identical outputs in the listed runs and a separate correctness comparison against mmap uploads. Cyber Psycho News did not independently reproduce the tests. b13024 remains a pre-release and does not introduce model weights, LoRA training or retrieval. Its value depends on available memory, storage throughput, cache misses and prompt size. A model that fits fully in memory has a different performance profile from these storage-constrained configurations.