Skip to content

vllm.v1.kv_offload.fs.worker

Abstract base for filesystem-backed offloading workers.

Classes:

  • FSOffloadingWorker –

    Abstract base for device <-> filesystem offloading workers.

  • FileOp –

    A single device-memory <-> file transfer operation.

  • StreamCompletion –

    IOCompletion backed by a CUDA event — no host thread required.

  • ThreadPoolFSWorker –

    FSOffloadingWorker that dispatches per-file I/O to a thread pool.

FSOffloadingWorker

Bases: OffloadingWorker

Abstract base for device <-> filesystem offloading workers.

Handles: key->path resolution, per-key pointer grouping, and completion tracking. Subclasses control how I/O is dispatched by implementing submit_io().

Methods:

  • shutdown_backend –

    Release backend resources (e.g. cuFileDriverClose).

  • shutdown_dispatch –

    Stop accepting I/O dispatches (e.g. tear down a thread pool).

  • submit_io –

    Submit a batch of per-file I/O operations.

_submit_io(device_ptrs, keys, is_store)

Build per-file ops from device pointers and delegate to submit_io.

shutdown_backend()

Release backend resources (e.g. cuFileDriverClose).

shutdown_dispatch()

Stop accepting I/O dispatches (e.g. tear down a thread pool).

submit_io(file_ops, is_store, ready_event) abstractmethod

Submit a batch of per-file I/O operations.

Parameters:

  • file_ops

    (list[tuple[str, list[FileOp]]]) –

    list of (file_path, ops) pairs.

  • is_store

    (bool) –

    True for device->file, False for file->device.

  • ready_event

    (Event) –

    device data is not valid until this event completes. Honor it with ready_event.synchronize() on an I/O thread, or stream.wait_event(ready_event) on a backend stream. Never wait on it on the calling thread.

Returns:

  • list[IOCompletion] –

    IOCompletions whose completion signals the I/O is done.

FileOp dataclass

A single device-memory <-> file transfer operation.

StreamCompletion

IOCompletion backed by a CUDA event — no host thread required.

ThreadPoolFSWorker

Bases: FSOffloadingWorker

FSOffloadingWorker that dispatches per-file I/O to a thread pool.

Subclasses implement write_block / read_block for the actual I/O.

Methods:

read_block(file_path, ops) abstractmethod

Read file data into device memory.

write_block(file_path, ops) abstractmethod

Write device data to a file.