forked from EngineX-Cambricon/enginex-mlu370-vllm
add qwen3
This commit is contained in:
20
vllm-v0.6.2/vllm/platforms/cpu.py
Normal file
20
vllm-v0.6.2/vllm/platforms/cpu.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import psutil
|
||||
import torch
|
||||
|
||||
from .interface import Platform, PlatformEnum
|
||||
|
||||
|
||||
class CpuPlatform(Platform):
|
||||
_enum = PlatformEnum.CPU
|
||||
|
||||
@classmethod
|
||||
def get_device_name(cls, device_id: int = 0) -> str:
|
||||
return "cpu"
|
||||
|
||||
@classmethod
|
||||
def get_device_total_memory(cls, device_id: int = 0) -> int:
|
||||
return psutil.virtual_memory().total
|
||||
|
||||
@classmethod
|
||||
def inference_mode(cls):
|
||||
return torch.no_grad()
|
||||
Reference in New Issue
Block a user