vllm.v1.kv_offload.fs.worker
¶
Abstract base for filesystem-backed offloading workers.
Classes:
-
FSLoadStoreSpec–Spec for loading/storing KV blocks from a filesystem tier.
-
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.
FSLoadStoreSpec
¶
Bases: LoadStoreSpec
Spec for loading/storing KV blocks from a filesystem tier.
Carries content-addressed OffloadKeys that the worker resolves to file paths via a FileMapper.
Source code in vllm/v1/kv_offload/fs/worker.py
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.
Source code in vllm/v1/kv_offload/fs/worker.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
_submit_io(device_ptrs, keys, is_store)
¶
Build per-file ops from device pointers and delegate to submit_io.
Source code in vllm/v1/kv_offload/fs/worker.py
shutdown_backend()
¶
shutdown_dispatch()
¶
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.
Source code in vllm/v1/kv_offload/fs/worker.py
FileOp
dataclass
¶
StreamCompletion
¶
IOCompletion backed by a CUDA event — no host thread required.
Source code in vllm/v1/kv_offload/fs/worker.py
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–Read file data into device memory.
-
write_block–Write device data to a file.