vllm.v1.kv_offload.tiering.fs.io ¶
Functions:
-
batch_load_block–Load a batch of KV blocks from disk into a shared buffer in one call.
-
batch_store_block–Store a batch of KV blocks from a shared buffer to disk in one call.
-
probe_o_direct–Return whether
O_DIRECTI/O works in directory.
_ensure_dirs(path) ¶
_get_tmp_suffix() ¶
Generate a thread-local unique suffix for temporary files.
Source code in vllm/v1/kv_offload/tiering/fs/io.py
_load_block(source_path, view, offset, block_size, use_o_direct=True) ¶
Load callback: read one KV block from disk. Remove the file on failure.
Source code in vllm/v1/kv_offload/tiering/fs/io.py
_store_block(dest_path, buffer, offset, block_size, use_o_direct=True) ¶
Store callback: Writes to a temp file then atomically replaces the destination.
Source code in vllm/v1/kv_offload/tiering/fs/io.py
_validate_offsets(view, offsets, block_size) ¶
Raise if any block would read/write past the bounds of view.
Without this, an out-of-range offset silently clips to a shorter (or empty) slice instead of failing, since memoryview slicing follows Python's slice-clamping semantics rather than raising.
Source code in vllm/v1/kv_offload/tiering/fs/io.py
batch_load_block(paths, view, offsets, block_size, use_o_direct=True) ¶
Load a batch of KV blocks from disk into a shared buffer in one call.
Block i is read from source_paths[i] into view[offsets[i] : offsets[i]+block_size]. Raises on first error and removes the offending file.
Source code in vllm/v1/kv_offload/tiering/fs/io.py
batch_store_block(paths, view, offsets, block_size, use_o_direct=True) ¶
Store a batch of KV blocks from a shared buffer to disk in one call.
Each block buffer[offsets[i] : offsets[i]+block_size] is written atomically to dest_paths[i] via a temp-file rename. Raises on first error.
Source code in vllm/v1/kv_offload/tiering/fs/io.py
probe_o_direct(directory) ¶
Return whether O_DIRECT I/O works in directory.
O_DIRECT is unsupported on some filesystems (e.g. the overlayfs backing a container /tmp, older tmpfs, or some NFS mounts), where opening or writing a file with it fails with EINVAL. Probe once with an aligned single-page write so callers can fall back to buffered I/O instead of failing on every block.