[KV Offload] Split the CPU offload region across shm files (#59546)

Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Co-authored-by: Robert Shaw <114415538+robertgshaw2-redhat@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Kevin H. Luu <khluu000@gmail.com>
This commit is contained in:
Itay Etelis
2026-10-15 20:17:40 +00:00
committed by GitHub
co-authored by Robert Shaw Codex Kevin H. Luu
parent 16532876e7
commit 21f4b6dc84
3 changed files with 116 additions and 9 deletions
+5
View File
@@ -22,6 +22,10 @@ from vllm.v1.kv_offload.cpu.gpu_worker import CPUOffloadingWorker
from vllm.v1.kv_offload.cpu.manager import CPUOffloadingManager
from vllm.v1.kv_offload.cpu.shared_offload_region import SharedOffloadRegion
# Split the shared region into this many shm files so workers pre-fault them
# in parallel (page-cache inserts are serialized per file).
_REGION_SEGMENTS = 32
def _all_workers_barrier() -> None:
"""Block until every worker rank has reached this point (gloo cpu group).
@@ -188,6 +192,7 @@ class CPUOffloadingSpec(OffloadingSpec):
kv_bytes_per_chunk=self.kv_bytes_per_chunk,
cpu_page_size=self.cpu_page_size_per_worker,
barrier=_all_workers_barrier,
num_segments=_REGION_SEGMENTS,
populate_shard=(
(worker_index, world_size) if self.replicated_layout else None
),