forked from EngineX-Cambricon/enginex-mlu370-vllm
add qwen3
This commit is contained in:
25
vllm-v0.6.2/vllm/platforms/mlu.py
Normal file
25
vllm-v0.6.2/vllm/platforms/mlu.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from functools import lru_cache
|
||||
|
||||
import torch
|
||||
|
||||
from .interface import DeviceCapability, Platform, PlatformEnum
|
||||
|
||||
|
||||
class MluPlatform(Platform):
|
||||
_enum = PlatformEnum.MLU
|
||||
|
||||
@classmethod
|
||||
@lru_cache(maxsize=8)
|
||||
def get_device_capability(cls, device_id: int = 0) -> DeviceCapability:
|
||||
major, minor = torch.mlu.get_device_capability(device_id)
|
||||
return DeviceCapability(major=major, minor=minor)
|
||||
|
||||
@classmethod
|
||||
@lru_cache(maxsize=8)
|
||||
def get_device_name(cls, device_id: int = 0) -> str:
|
||||
return torch.mlu.get_device_name(device_id)
|
||||
|
||||
@classmethod
|
||||
def get_device_total_memory(cls, device_id: int = 0) -> int:
|
||||
device_props = torch.mlu.get_device_properties(device_id)
|
||||
return device_props.total_memory
|
||||
Reference in New Issue
Block a user