From 9b87a579aaf82338d5304219350932abae9b19ac Mon Sep 17 00:00:00 2001 From: Yan Ma Date: Mon, 17 Mar 2025 16:22:14 +0800 Subject: [PATCH] [Misc][XPU] Use None as device capacity for XPU (#14932) Signed-off-by: yan ma --- vllm/platforms/xpu.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vllm/platforms/xpu.py b/vllm/platforms/xpu.py index d99d4ef3dac06..225e756cd7ce8 100644 --- a/vllm/platforms/xpu.py +++ b/vllm/platforms/xpu.py @@ -37,10 +37,11 @@ class XPUPlatform(Platform): return "vllm.attention.backends.ipex_attn.IpexAttnBackend" @staticmethod - def get_device_capability(device_id: int = 0) -> DeviceCapability: - major, minor, *_ = torch.xpu.get_device_capability( - device_id)['version'].split('.') - return DeviceCapability(major=int(major), minor=int(minor)) + def get_device_capability( + device_id: int = 0) -> Optional[DeviceCapability]: + # capacity format differs from cuda's and will cause unexpected + # failure, so use None directly + return None @staticmethod def get_device_name(device_id: int = 0) -> str: