Skip to content

[XPU] Register KV offload mmap region as pinned host memory - #51956

Draft
chaojun-zhang wants to merge 2 commits into
vllm-project:mainfrom
chaojun-zhang:xpu/host-register-offload
Draft

[XPU] Register KV offload mmap region as pinned host memory#51956
chaojun-zhang wants to merge 2 commits into
vllm-project:mainfrom
chaojun-zhang:xpu/host-register-offload

Conversation

@chaojun-zhang

@chaojun-zhang chaojun-zhang commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends the CPU KV-cache offloading path's mmap host registration to Intel XPU, and factors the CUDA/ROCm cudaHostRegister/cudaHostUnregister calls out into a small platform-dispatching helper module.

Dependency

vllm-project/vllm-xpu-kernels#519 (xpu_host_register/xpu_host_unregister ops).

@mergify mergify Bot added the intel-gpu Related to Intel GPU label Aug 12, 2026
@chaojun-zhang chaojun-zhang changed the title [XPU] Register KV offload mmap region as pinned host memory via SYCL [XPU] Register KV offload mmap region as pinned host memory Aug 12, 2026
Adds vllm/v1/kv_offload/cpu/host_register.py, a platform-dispatching
host_register/host_unregister helper for CPU KV-cache offload. On
CUDA/ROCm it wraps the existing cudaHostRegister/cudaHostUnregister
calls (moved out of gpu_worker.py/shared_offload_region.py verbatim);
on XPU it calls the new torch.ops._C.xpu_host_register/
xpu_host_unregister custom ops (see vllm-project/vllm-xpu-kernels#519)
so the shared mmap KV-offload region can be pinned for direct DMA on
Intel GPUs as well, instead of falling back to unpinned/pageable
transfers.

CPUOffloadingSpec._uses_shared_region now also returns True for XPU so
the shared-mmap replicated-layout path (and therefore host
registration) is used on that platform too.

Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com>
Mirror the CUDA branch's logger.warning on cudaHostRegister/
cudaHostUnregister failure by also warning when the XPU
xpu_host_register/xpu_host_unregister ops report failure, instead of
silently swallowing it.

Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com>
@chaojun-zhang
chaojun-zhang force-pushed the xpu/host-register-offload branch from 0e902a0 to 3d8824c Compare August 12, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

intel-gpu Related to Intel GPU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant