[Bugfix][Intel] Fix XPU Dockerfile Build (#7824)
Signed-off-by: tylertitsworth <tyler.titsworth@intel.com> Co-authored-by: youkaichao <youkaichao@126.com>
This commit is contained in:
20
vllm/platforms/xpu.py
Normal file
20
vllm/platforms/xpu.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import torch
|
||||
|
||||
from .interface import DeviceCapability, Platform, PlatformEnum
|
||||
|
||||
|
||||
class XPUPlatform(Platform):
|
||||
_enum = PlatformEnum.XPU
|
||||
|
||||
@staticmethod
|
||||
def get_device_capability(device_id: int = 0) -> DeviceCapability:
|
||||
return DeviceCapability(major=int(
|
||||
torch.xpu.get_device_capability(device_id)['version'].split('.')
|
||||
[0]),
|
||||
minor=int(
|
||||
torch.xpu.get_device_capability(device_id)
|
||||
['version'].split('.')[1]))
|
||||
|
||||
@staticmethod
|
||||
def get_device_name(device_id: int = 0) -> str:
|
||||
return torch.xpu.get_device_name(device_id)
|
||||
Reference in New Issue
Block a user