@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5206ab20ba
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[XPU] Fix circular import error. (#24927)

Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>

Kunshang Ji committed Sep 16, 2025 at 11:35 UTC 5206ab20ba7477e5457c2e64469590d548fa15e6
1 file changed +5 -1
vllm/platforms/xpu.py
+5 -1
@@ -9,7 +9,6 @@ import torch
9 import vllm.envs as envs
10 from vllm.logger import init_logger
11 from vllm.utils import DEFAULT_MAX_NUM_BATCHED_TOKENS
12 -from vllm.v1.attention.backends.utils import set_kv_cache_layout
12
13 from .interface import DeviceCapability, Platform, PlatformEnum, _Backend
14
@@ -164,11 +163,16 @@ class XPUPlatform(Platform):
163 vllm_config.scheduler_config.max_num_batched_tokens = max(
164 vllm_config.scheduler_config.max_model_len,
165 DEFAULT_MAX_NUM_BATCHED_TOKENS)
166 + from vllm.v1.attention.backends.utils import set_kv_cache_layout
167
168 set_kv_cache_layout("NHD")
169 logger.info("Setting VLLM_KV_CACHE_LAYOUT to 'NHD' for XPU; "
170 "only NHD layout is supported by XPU attention kernels.")
171
172 + @classmethod
173 + def support_hybrid_kv_cache(cls) -> bool:
174 + return True
175 +
176 @classmethod
177 def is_pin_memory_available(cls):
178 return True