Skip to content

vllm.v1.simple_kv_offload.disk_backend

Disk I/O backend for GPU<->NVMe block transfers via pinned staging buffers.

Uses separate IO threads for store and load so that loads (latency-critical) never block behind stores (background work). Each thread owns its own pinned staging buffers to avoid contention.

Classes:

  • DiskBackend –

    Async disk offload backend with pipelined GPU DMA and interleaved IO.

DiskBackend

Async disk offload backend with pipelined GPU DMA and interleaved IO.

Architecture: - Separate coordinator threads for store and load (never block each other) - Interleaved pipeline: DMA slot N while preadv/pwritev slot N-1 - O_DIRECT by default; page cache is opt-in via use_page_cache

Same launch_copy interface as DmaCopyBackend so the worker can swap backends without changing calling code.

_do_load(disk_slots, gpu_blocks, stream)

Disk (preadv) -> buffer -> GPU (DMA), interleaved double-buffer.

_do_store(gpu_blocks, disk_slots, stream)

GPU -> buffer (DMA) -> disk (pwritev), interleaved double-buffer.

_alloc_aligned(num_slots, bpb)

Allocate a staging buffer whose base address is O_DIRECT aligned.

The CPU allocator only guarantees 64-byte alignment, so over-allocate by one alignment unit and return an aligned view. The view keeps the backing storage alive.