[Refactor]A simple device-related refactor (#11163)

Signed-off-by: noemotiovon <noemotiovon@gmail.com>
Co-authored-by: noemotiovon <noemotiovon@gmail.com>
This commit is contained in:
Chenguang Li
2024-12-13 13:39:00 +00:00
committed by GitHub
co-authored by noemotiovon
parent 969da7d70b
commit d1fa714cb1
7 changed files with 51 additions and 31 deletions
+9
View File
@@ -2,6 +2,8 @@ from typing import TYPE_CHECKING, Optional
import torch
from vllm.logger import init_logger
from .interface import Platform, PlatformEnum, _Backend
if TYPE_CHECKING:
@@ -9,6 +11,8 @@ if TYPE_CHECKING:
else:
VllmConfig = None
logger = init_logger(__name__)
class HpuPlatform(Platform):
_enum = PlatformEnum.HPU
@@ -43,3 +47,8 @@ class HpuPlatform(Platform):
parallel_config = vllm_config.parallel_config
if parallel_config.worker_cls == "auto":
parallel_config.worker_cls = "vllm.worker.hpu_worker.HPUWorker"
@classmethod
def is_pin_memory_available(cls):
logger.warning("Pin memory is not supported on HPU.")
return False