[XPU] Register KV offload mmap region as pinned host memory - #51956
Draft
chaojun-zhang wants to merge 2 commits into
Draft
[XPU] Register KV offload mmap region as pinned host memory#51956chaojun-zhang wants to merge 2 commits into
chaojun-zhang wants to merge 2 commits into
Conversation
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
force-pushed
the
xpu/host-register-offload
branch
from
August 12, 2026 08:40
0e902a0 to
3d8824c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the CPU KV-cache offloading path's mmap host registration to Intel XPU, and factors the CUDA/ROCm
cudaHostRegister/cudaHostUnregistercalls out into a small platform-dispatching helper module.Dependency
vllm-project/vllm-xpu-kernels#519 (
xpu_host_register/xpu_host_unregisterops).