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.
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:
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.
| Part | Configuration |
|---|---|
| GPU | AMD RDNA3 workstation GPU, PCIe Gen4 x16, ROCm 6.4.3, PyTorch 2.9.1 |
| Drive | One 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 system | XFS |
| Kernel | Linux 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) |
| Model | Qwen2.5-7B-Instruct, BF16, four shards, 15.23 GB, 339 tensors |
| Serving engine | vLLM 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
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.
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.
| Reader | Load time (s) | KV cache tokens after load |
|---|---|---|
| DMA-BUF copier | 2.212, 2.215, 2.218 | 241,808 |
| fastsafetensors nogds | 2.279, 2.285, 2.291 | 105,360 |
| vLLM default (safetensors) | 6.214, 6.234, 6.237 | 241,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.
| Reader | NVMe commands | Bytes from the drive | Drive rate | System calls, threads | Load time (s) |
|---|---|---|---|---|---|
| DMA-BUF copier | 7,260 of 2 MiB | 15.233 GB (+0.02%) | 7.2 GB/s | 451 on 3 threads | 2.121, 2.109 |
| fastsafetensors nogds | 116,212 of 128 KiB and 29,064 of 4 KiB | 15.352 GB (+0.8%) | 6.8 GB/s | 58,914 on 19 threads | 2.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
- Registration size. The kernel refuses a DMA-BUF larger than 4 GiB, because it stores the buffer offset in 32 bits. The copier starts at 4 GiB minus 2 MiB, so a typical shard is one registration. Earlier kernel revisions refused anything above 1 GiB; the copier then retries at 1 GiB. We tested both cases on a real kernel.
- Memory reuse. After the copier frees a piece, the
GPU's memory counter still shows it for 20 to 100 ms. The memory is
free: on a nearly full GPU, 20 of 20 new allocations succeeded, each in
about 42 ms. vLLM 0.18.1's loading loop holds one extra shard for both readers; the
copier itself needs no more live memory than
nogds. - Worker threads. On XFS, io_uring sends every DMA-BUF read to a kernel worker thread. A trace counted 228 of 228 reads, and one worker thread issued every 2 MiB command. The copier does not ask for this. The likely cause is that the block layer will not split a large non-blocking read, but we have not confirmed it. Different worker limits did not change the load time on one drive. With several drives, check whether one worker per ring is enough.
- Consumer NVIDIA GPUs. A GeForce GPU with driver
615.71.09 reports
CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED = 0, and CUDA refuses the export (error 801). The copier falls back tonogdsthere. NVIDIA data-center GPUs report support with the open kernel modules; we have not run the copier on one.
Not tested yet
| Case | Status | Why it matters |
|---|---|---|
| NVIDIA data-center GPUs | Code path written; not run | The main deployment target |
| arm64 hosts | The io_uring rings use acquire and release ordering for arm64; not run | Grace-based systems use arm64 |
| More than one drive | Not run | This is where the value is; see below |
| Several GPUs (tensor parallel) | Device selection is fixed for every GPU index; not run | Large models use several GPUs |
| PCIe Gen5 drives and GPUs | Not run | Twice the bandwidth per drive and per GPU link |
| ext4 | Kernel support only on the test branch; the copier was not run on ext4 | A common file system |
| The smallest kernel patch set | Not run (see kernel requirements) | The path most users will build |
| Serving on current vLLM | Only the loader call was reproduced | Confirms 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.
| Checkpoint | One 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 s | 1.3 s | $0.13 / $0.29 |
| 700 GB (671B-parameter FP8 mixture of experts) | 100 s | 6.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
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.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.git 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.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.FASTSAFETENSORS_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:
- the CPU architecture (x86-64 or arm64) and the number of GPUs and drives;
- whether each drive and GPU are below the same PCIe switch
(
lspci -tvshows this); - for a multi-drive run, how you spread the shards and, if you can, host memory bandwidth during the load;
- the full error text for any reader that failed.
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.