vllm.v1.kv_offload.fs.gds.worker
¶
GDS offloading worker — direct GPU<->NVMe via cuFile sync API.
Classes:
-
GDSOffloadingWorker–GPU<->NVMe transfers via NVIDIA cuFile synchronous API.
GDSOffloadingWorker
¶
Bases: ThreadPoolFSWorker
GPU<->NVMe transfers via NVIDIA cuFile synchronous API.
Each file's I/O is submitted to a thread pool so multiple operations overlap on the NVMe device (higher queue depth = higher throughput).
All file syscalls (open, cuFileHandleRegister, I/O, cuFileHandleDeregister, close) run inside pool threads to keep the scheduler thread free of blocking operations. Driver open/close and the direct-path probe (_validate_gds) run on the caller's thread at init/shutdown.
Compat mode is disabled, so cuFile cannot silently fall back to POSIX I/O through bounce buffers. At init the worker round-trips one KV block through root_dir to prove the direct path works on that mount.
Methods:
-
write_block–Write to a temp file, then atomically rename it into place, so
_validate_gds(device, kv_caches, root_dir, io_threads)
¶
Open cuFile with compat mode off and prove the direct path works.
Takes one KV block (block 0 of the first KV tensor), writes it to a temp file under root_dir, reads it back, and deletes the file. With compat mode off cuFile has no POSIX fallback, so success means GPU<->storage DMA works on this mount. The data is not checked, only that both transfers complete. This runs before the KV cache holds any data, so the read may overwrite the block freely.
write_block(file_path, ops)
¶
Write to a temp file, then atomically rename it into place, so readers never see a partially written file.