io_uring + DMA-BUF · Experimental · Updated 23 November 2026

Loading model weights straight into GPU memory

vLLM can load a model from NVMe directly into GPU memory, with no copy through host memory, and serve the same output as its other loaders. We added a DMA-BUF reader to fastsafetensors and tested it on one AMD GPU with one NVMe drive. We now need measurements from other GPUs, more drives and arm64 hosts.

What we built

fastsafetensors is a library that loads safetensors checkpoints into GPU memory. vLLM uses it when you start a server with --load-format fastsafetensors. On NVIDIA systems with GPUDirect Storage it reads through NVIDIA's cuFile library. Everywhere else it uses its nogds reader: the drive writes each chunk into pinned host memory, and the GPU then copies that chunk into its own memory.

The new DMA-BUF copier removes the host copy. A DMA-BUF is the Linux handle that lets one driver share a buffer with another. The copier uses the io_uring DMA-BUF interface that the rest of this guide describes:

1. AllocateAllocate GPU memory for a shard with HIP or CUDA.
2. ExportExport that memory as a DMA-BUF.
3. RegisterRegister the DMA-BUF with io_uring as a fixed buffer for the shard file.
4. ReadSubmit READ_FIXED. The NVMe controller writes into GPU memory.

Tensors are views into that GPU memory. No payload byte goes through host memory, and no cuFile installation is necessary. When the kernel or the GPU driver refuses a step, the copier logs one warning and uses nogds. Set FASTSAFETENSORS_DMABUF_STRICT=1 to make that an error.

vLLM builds its loader with only a nogds choice, so it cannot ask for the new copier directly. Set FASTSAFETENSORS_USE_DMABUF=1 to select it without changes to vLLM.

By default the copier leaves each tensor where the file puts it, at its file offset modulo 4 KiB, as a memory-mapped file would. vLLM and other engines that copy weights into their own parameters need nothing more. A loader that runs kernels directly on the loaded buffer can call set_align(4096); see tensor alignment in DMA-BUF loads.

The code is five commits on the 2026-10-28-iouring-dma-buf branch of our fastsafetensors fork, on top of the 0.5.0 release. It is not yet a pull request upstream. We proposed it to the fastsafetensors maintainers in issue #139.

fastsafetensors considered io_uring before, in issue #9. That proposal read into pinned host memory, so every byte still passed through host memory on its way to the GPU. The issue was closed without io_uring code. The DMA-BUF copier goes one step further: the drive writes straight into GPU memory.

What we tested

One machine, one GPU, one drive and one model. These runs show that the path is correct and that it works with vLLM. They are not the value case; see why it matters at scale.

The test configuration
PartConfiguration
GPUAMD RDNA3 workstation GPU, PCIe Gen4 x16, ROCm 6.4.3, PyTorch 2.9.1
DriveOne consumer PCIe Gen4 x4 NVMe SSD, 4 TB class, about 7 GB/s rated sequential read, 512-byte logical blocks, 2 MiB largest DMA-BUF command
File systemXFS
KernelLinux 7.3-rc2 with the 2026-10-30-dmabuf-on-axboe-for-7.4 branch; the rerun on the current fastsafetensors tip used the same branch plus unrelated NFS client patches (see kernel requirements)
ModelQwen2.5-7B-Instruct, BF16, four shards, 15.23 GB, 339 tensors
Serving enginevLLM 0.18.1 (ROCm build), one GPU, eager mode

Every trial started with an empty page cache. We compared three readers: vLLM's default safetensors reader, fastsafetensors' nogds reader, and the DMA-BUF copier.

Results

SAME OUTPUT

In nine vLLM trials, three per reader, all 312 parameter and buffer hashes were identical. Greedy output for eight prompts was identical, with zero log-probability difference.

NO HOST COPY

The GPU's counter for host-mapped memory did not change during any DMA-BUF load. The copier read the file bytes plus 0.4 MB of alignment. The nogds reader read 119 MB more.

DRIVE SPEED

The DMA-BUF copier loaded the model at 6.9 GB/s, close to the drive's rated read speed. Both fastsafetensors readers are limited by the drive.

Weight load time in vLLM, three trials per reader, empty page cache
ReaderLoad time (s)KV cache tokens after load
DMA-BUF copier2.212, 2.215, 2.218241,808
fastsafetensors nogds2.279, 2.285, 2.291105,360
vLLM default (safetensors)6.214, 6.234, 6.237241,808

The DMA-BUF copier is 3% faster than nogds here, and the ranges do not overlap. Both fastsafetensors readers are about 2.8 times faster than vLLM's default reader.

KV cache capacity. vLLM sizes its KV cache after it loads the weights. On vLLM 0.18.1 the nogds reader leaves its buffers in PyTorch's memory cache, so the KV cache holds 56% fewer tokens. The DMA-BUF copier returns its memory to the driver. Current vLLM fixes the nogds loss (pull request #57516 empties the cache after loading). With that fix applied, nogds leaves 132 MiB in use and the DMA-BUF copier leaves none.

Current vLLM's loader call

There is no current vLLM build for the ROCm stack on this machine. We therefore called fastsafetensors' ParallelLoader exactly as current vLLM does, outside the engine, and checked every tensor against a SHA-256 of the file bytes. Eleven loads with the DMA-BUF copier took 2.18 to 2.21 s, and every tensor matched the file. nogds took 2.28 to 2.34 s. Each shard was read as one piece with no configuration.

We repeated this call on the current branch tip, 9f77b8c, with its default of no move: two runs of three cold loads per reader. The DMA-BUF copier took 2.17 to 2.21 s and nogds 2.28 to 2.32 s, with every tensor matching the file. Asking the copier to move every tensor to a 16-byte boundary (FASTSAFETENSORS_DMABUF_ALIGN=16) cost about 70 ms on this 15 GB model and cut its lead to about 30 ms. A copy-out loader such as vLLM's should keep the default. On the newer kernel branch described under kernel requirements, the copier took 2.11 to 2.14 s, 7 to 8% faster than nogds.

Why the copier is faster

The copier is faster because the drive gets larger commands. We traced cold loads of three checkpoints on the newer kernel branch. For each load we recorded every NVMe command, every system call and every io_uring event between the start and the end of the load. The drive limits for one command are different for the two readers. A normal read command can carry at most 128 KiB. A DMA-BUF read command can carry 2 MiB. The copier's reads therefore reach the drive as 2 MiB commands. nogds reads 516 KiB per pread64 call, and the drive gets four 128 KiB commands and one 4 KiB command for each call. The extra 4 KiB per call also makes nogds read 0.8% more bytes than the files hold.

Cold loads with tracing, Qwen2.5-7B (15.2 GB, four shards)
ReaderNVMe commandsBytes from the driveDrive rateSystem calls, threadsLoad time (s)
DMA-BUF copier7,260 of 2 MiB15.233 GB (+0.02%)7.2 GB/s451 on 3 threads2.121, 2.109
fastsafetensors nogds116,212 of 128 KiB and 29,064 of 4 KiB15.352 GB (+0.8%)6.8 GB/s58,914 on 19 threads2.252, 2.275

The drive had a command outstanding for 99% of each load with both readers. The drive is the limit, so its rate per command size sets the load time. The copier was 7.6% faster on Qwen3-0.6B (1.5 GB), 8.2% faster on Qwen2.5-7B, and 6.0% faster on a 27 GB mixture-of-experts checkpoint (EMO 1b14b, BF16, eleven shards). On the 27 GB checkpoint the drive read 7.2 GB/s for the copier and 7.0 GB/s for nogds. All 24 loads matched the file digests. Tracing changed the load times by between -2% and +0.5%, which is less than the difference between the readers. The copier also makes far fewer system calls. We did not measure host CPU time, so we do not claim a CPU saving.

The read-size page traces what each loader asks the kernel for, next to the NVMe commands, for four checkpoints and for single-expert fetches. It also shows how ten open checkpoints, dense and mixture-of-experts, store their tensors.

Details we found on the way

Not tested yet

Open questions, and why each one matters
CaseStatusWhy it matters
NVIDIA data-center GPUsCode path written; not runThe main deployment target
arm64 hostsThe io_uring rings use acquire and release ordering for arm64; not runGrace-based systems use arm64
More than one driveNot runThis is where the value is; see below
Several GPUs (tensor parallel)Device selection is fixed for every GPU index; not runLarge models use several GPUs
PCIe Gen5 drives and GPUsNot runTwice the bandwidth per drive and per GPU link
ext4Kernel support only on the test branch; the copier was not run on ext4A common file system
The smallest kernel patch setNot run (see kernel requirements)The path most users will build
Serving on current vLLMOnly the loader call was reproducedConfirms the end-to-end path

Why it matters at scale

On one 7 GB/s drive, every reader waits for the drive. The 3% gain above is not the reason for this work. The reason is cost. NVMe bandwidth is cheap to add: put more drives in the server. GPU time is expensive, and it costs more on each new GPU generation. A GPU that waits for weights does no work, and every load that waits on storage has a direct cost.

The table below is a projection, not a measurement. It assumes an 8-GPU server, one PCIe Gen5 drive per GPU at about 14 GB/s, and load time limited only by drive bandwidth.

Projected GPU cost of one cold load on an 8-GPU server
CheckpointOne Gen4 drive (7 GB/s)Eight Gen5 drives (112 GB/s)GPU cost saved per load at $3 / $7 per GPU-hour
140 GB (70B parameters, BF16)20 s1.3 s$0.13 / $0.29
700 GB (671B-parameter FP8 mixture of experts)100 s6.3 s$0.63 / $1.46

$3 per GPU-hour is a typical H100-class rental price. $7 is within the recent range of B200-class prices. Eight 7.68 TB Gen5 drives cost about $36,000 at about $4,500 each. For the 700 GB checkpoint, the drives repay themselves after about 58,000 loads on H100-class GPUs, or about 25,000 loads on B200-class GPUs. A server that changes models every ten minutes makes about 52,000 loads a year. One that changes models once an hour makes about 8,800. The faster and more expensive the GPU, the sooner the drives repay.

Where DMA-BUF fits. The nogds reader could also read from eight drives, but each byte then goes through host memory twice: the drive writes it, and the GPU reads it. At 112 GB/s that is about 224 GB/s of host memory traffic, plus pinned buffers and threads, on a host that also serves requests. With the DMA-BUF copier, the drive writes into GPU memory directly. When the drive and the GPU are below the same PCIe switch, the data does not go to the CPU at all. We do not know yet at what rate the host copy becomes the limit. A multi-drive, multi-GPU comparison of nogds and the DMA-BUF copier that also records host memory bandwidth will answer that. It is the most useful result you can send us.

Test it on your hardware

Check the GPUAMD GPUs export memory through ROCm's hsa_amd_portable_export_dmabuf; we used ROCm 6.4.3. NVIDIA GPUs need the open kernel modules and must report CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED. The benchmark below reports that attribute. Consumer GeForce GPUs report 0.
Build a kernel with DMA-BUF file readsNo released kernel supports this yet. The io_uring DMA-BUF series is queued for Linux 7.4 in Jens Axboe's for-7.4/io_uring-dmabuf branch, but it supports only raw block devices. To read files on XFS, also apply the three patches of the XFS RFC (b4 am 20261016091919.971295-1-anuj1072538@gmail.com). That is the smallest patch set. Our results used the 2026-10-30-dmabuf-on-axboe-for-7.4 branch instead. It has the same series and the XFS RFC, plus ext4 support and patches that let DMA-BUF reads use the drive's largest command size. With only the smallest set, reads can be split into smaller commands; we have not measured that difference. The later 2026-11-06-dmabuf-io-async-release branch builds on it and removes a wait of about 14 ms each time a DMA-BUF registration that did I/O is released. On it the DMA-BUF copier loads this four-shard model in 2.11 to 2.14 s, about 70 ms faster; nogds is unchanged at 2.27 to 2.36 s. We recommend that branch.
Put the checkpoint on XFS on a PCIe NVMe namespaceOnly PCIe NVMe namespaces implement DMA-BUF I/O today. Software RAID (md), device-mapper volumes and NVMe multipath devices do not. To test several drives, make one XFS file system on each drive, spread the shard files across them, and link them into one model directory with symbolic links.
Install the fastsafetensors branchgit clone -b 2026-10-28-iouring-dma-buf https://github.com/mcgrof/fastsafetensors and then pip install ./fastsafetensors in the Python environment that has PyTorch for your GPU. This builds a small C++ extension.
Run the benchmarkDownload dmabuf_load_bench.py and run it as root, so that it can empty the page cache before each trial: sudo /path/to/venv/bin/python dmabuf_load_bench.py --model /models/Qwen2.5-7B-Instruct --trials 3 --out result.json. It loads the checkpoint with nogds and with the DMA-BUF copier, each trial in a new process, and checks every tensor against the file on the first trial. Add --readers nogds,dmabuf,gds on an NVIDIA system with cuFile to include GPUDirect Storage. The model must fit in one GPU with room for two shards.
Optional: start vLLM with itFASTSAFETENSORS_USE_DMABUF=1 FASTSAFETENSORS_DMABUF_STRICT=1 vllm serve MODEL --load-format fastsafetensors. Compare the "Model loading took" line and the KV cache size in the log with a start without the two variables.

Send us your results

Open an issue on github.com/mcgrof/knlp and attach result.json. Please also tell us:

Failures are useful too: a refused export or registration tells us which GPU drivers and kernels still need work. The JSON file records the kernel version, the GPU architecture, the drive's block sizes, command limits, PCIe link and capacity, and no serial numbers. When we add your results to this page, we describe hardware by architecture, link and drive geometry, not by product name.

← Linux & reproduceOverview →