mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-10 09:42:15 +08:00
[Misc] Remove lru_cache in NvmlCudaPlatform (#14156)
Signed-off-by: Cody Yu <hao.yu.cody@gmail.com>
This commit is contained in:
parent
bb5b640359
commit
989f4f430c
@ -4,7 +4,7 @@ pynvml. However, it should not initialize cuda context.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from functools import lru_cache, wraps
|
from functools import wraps
|
||||||
from typing import (TYPE_CHECKING, Callable, List, Optional, Tuple, TypeVar,
|
from typing import (TYPE_CHECKING, Callable, List, Optional, Tuple, TypeVar,
|
||||||
Union)
|
Union)
|
||||||
|
|
||||||
@ -284,7 +284,6 @@ class CudaPlatformBase(Platform):
|
|||||||
class NvmlCudaPlatform(CudaPlatformBase):
|
class NvmlCudaPlatform(CudaPlatformBase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@lru_cache(maxsize=8)
|
|
||||||
@with_nvml_context
|
@with_nvml_context
|
||||||
def get_device_capability(cls,
|
def get_device_capability(cls,
|
||||||
device_id: int = 0
|
device_id: int = 0
|
||||||
@ -298,7 +297,6 @@ class NvmlCudaPlatform(CudaPlatformBase):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@lru_cache(maxsize=8)
|
|
||||||
@with_nvml_context
|
@with_nvml_context
|
||||||
def has_device_capability(
|
def has_device_capability(
|
||||||
cls,
|
cls,
|
||||||
@ -311,14 +309,12 @@ class NvmlCudaPlatform(CudaPlatformBase):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@lru_cache(maxsize=8)
|
|
||||||
@with_nvml_context
|
@with_nvml_context
|
||||||
def get_device_name(cls, device_id: int = 0) -> str:
|
def get_device_name(cls, device_id: int = 0) -> str:
|
||||||
physical_device_id = device_id_to_physical_device_id(device_id)
|
physical_device_id = device_id_to_physical_device_id(device_id)
|
||||||
return cls._get_physical_device_name(physical_device_id)
|
return cls._get_physical_device_name(physical_device_id)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@lru_cache(maxsize=8)
|
|
||||||
@with_nvml_context
|
@with_nvml_context
|
||||||
def get_device_uuid(cls, device_id: int = 0) -> str:
|
def get_device_uuid(cls, device_id: int = 0) -> str:
|
||||||
physical_device_id = device_id_to_physical_device_id(device_id)
|
physical_device_id = device_id_to_physical_device_id(device_id)
|
||||||
@ -326,7 +322,6 @@ class NvmlCudaPlatform(CudaPlatformBase):
|
|||||||
return pynvml.nvmlDeviceGetUUID(handle)
|
return pynvml.nvmlDeviceGetUUID(handle)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@lru_cache(maxsize=8)
|
|
||||||
@with_nvml_context
|
@with_nvml_context
|
||||||
def get_device_total_memory(cls, device_id: int = 0) -> int:
|
def get_device_total_memory(cls, device_id: int = 0) -> int:
|
||||||
physical_device_id = device_id_to_physical_device_id(device_id)
|
physical_device_id = device_id_to_physical_device_id(device_id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user