Skip to content

Commit 5206ab2

Browse files
authored
[XPU] Fix circular import error. (vllm-project#24927)
Signed-off-by: Kunshang Ji <[email protected]>
1 parent 0af3ce1 commit 5206ab2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vllm/platforms/xpu.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import vllm.envs as envs
1010
from vllm.logger import init_logger
1111
from vllm.utils import DEFAULT_MAX_NUM_BATCHED_TOKENS
12-
from vllm.v1.attention.backends.utils import set_kv_cache_layout
1312

1413
from .interface import DeviceCapability, Platform, PlatformEnum, _Backend
1514

@@ -164,11 +163,16 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
164163
vllm_config.scheduler_config.max_num_batched_tokens = max(
165164
vllm_config.scheduler_config.max_model_len,
166165
DEFAULT_MAX_NUM_BATCHED_TOKENS)
166+
from vllm.v1.attention.backends.utils import set_kv_cache_layout
167167

168168
set_kv_cache_layout("NHD")
169169
logger.info("Setting VLLM_KV_CACHE_LAYOUT to 'NHD' for XPU; "
170170
"only NHD layout is supported by XPU attention kernels.")
171171

172+
@classmethod
173+
def support_hybrid_kv_cache(cls) -> bool:
174+
return True
175+
172176
@classmethod
173177
def is_pin_memory_available(cls):
174178
return True

0 commit comments

Comments
 (0)