A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 21:00 UTC
[Misc] Remove lru_cache in NvmlCudaPlatform (#14156)
Signed-off-by: Cody Yu <hao.yu.cody@gmail.com>
Cody Yu committed
Mar 3, 2025 at 19:09 UTC
989f4f430cd74a14d539d8b59b9d239301f1bdcd
1 file changed
+1
-6
vllm/platforms/cuda.py
+1
-6
@@ -4,7 +4,7 @@ pynvml. However, it should not initialize cuda context.
4
"""
5
6
import os
7
-from functools import lru_cache, wraps
7
+from functools import wraps
8
from typing import (TYPE_CHECKING, Callable, List, Optional, Tuple, TypeVar,
9
Union)
10
@@ -284,7 +284,6 @@ class CudaPlatformBase(Platform):
284
class NvmlCudaPlatform(CudaPlatformBase):
285
286
@classmethod
287
- @lru_cache(maxsize=8)
287
@with_nvml_context
288
def get_device_capability(cls,
289
device_id: int = 0
@@ -298,7 +297,6 @@ class NvmlCudaPlatform(CudaPlatformBase):
297
return None
298
299
@classmethod
301
- @lru_cache(maxsize=8)
300
@with_nvml_context
301
def has_device_capability(
302
cls,
@@ -311,14 +309,12 @@ class NvmlCudaPlatform(CudaPlatformBase):
309
return False
310
311
@classmethod
314
- @lru_cache(maxsize=8)
312
@with_nvml_context
313
def get_device_name(cls, device_id: int = 0) -> str:
314
physical_device_id = device_id_to_physical_device_id(device_id)
315
return cls._get_physical_device_name(physical_device_id)
316
317
@classmethod
321
- @lru_cache(maxsize=8)
318
@with_nvml_context
319
def get_device_uuid(cls, device_id: int = 0) -> str:
320
physical_device_id = device_id_to_physical_device_id(device_id)
@@ -326,7 +322,6 @@ class NvmlCudaPlatform(CudaPlatformBase):
322
return pynvml.nvmlDeviceGetUUID(handle)
323
324
@classmethod
329
- @lru_cache(maxsize=8)
325
@with_nvml_context
326
def get_device_total_memory(cls, device_id: int = 0) -> int:
327
physical_device_id = device_id_to_physical_device_id(device_id)