[XPU] Support register KV offload mmap region as pinned host memory on XPU (#51956)

Signed-off-by: Chaojun Zhang <chaojun.zhang@intel.com>
This commit is contained in:
Chaojun Zhang
2026-10-09 18:58:07 +08:00
committed by GitHub
parent 5cadabfafd
commit b027ac8312
6 changed files with 151 additions and 100 deletions
+3
View File
@@ -307,6 +307,7 @@ def test_cpu_spec_replicated_disabled_without_shared_region(
# those private buffers empty and corrupting subsequent loads.
import vllm.v1.kv_offload.cpu.spec as cpu_spec_module
monkeypatch.setattr(cpu_spec_module.current_platform, "is_xpu", lambda: False)
monkeypatch.setattr(cpu_spec_module.current_platform, "is_cuda_alike", lambda: rocm)
monkeypatch.setattr(cpu_spec_module.current_platform, "is_rocm", lambda: rocm)
worker_kv_bytes_per_block = SharedOffloadRegion.BLOCK_SIZE_ALIGNMENT
@@ -341,6 +342,7 @@ def test_cpu_spec_replicated_layout_truth_matrix(
# actually allocates on the shared region.
import vllm.v1.kv_offload.cpu.spec as cpu_spec_module
monkeypatch.setattr(cpu_spec_module.current_platform, "is_xpu", lambda: False)
monkeypatch.setattr(
cpu_spec_module.current_platform, "is_cuda_alike", lambda: cuda_alike
)
@@ -417,6 +419,7 @@ def test_cpu_spec_create_worker_uses_tensor_path_without_shared_region(
worker_calls.append(kwargs)
return MagicMock()
monkeypatch.setattr(cpu_spec_module.current_platform, "is_xpu", lambda: False)
monkeypatch.setattr(cpu_spec_module.current_platform, "is_cuda_alike", lambda: rocm)
monkeypatch.setattr(cpu_spec_module.current_platform, "is_rocm", lambda: rocm)
monkeypatch.setattr(cpu_spec_module, "SharedOffloadRegion", fake_region_ctor)