Skip to content

Commit 989f4f4

Browse files
authored
[Misc] Remove lru_cache in NvmlCudaPlatform (vllm-project#14156)
Signed-off-by: Cody Yu <[email protected]>
1 parent bb5b640 commit 989f4f4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

vllm/platforms/cuda.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
import os
7-
from functools import lru_cache, wraps
7+
from functools import wraps
88
from typing import (TYPE_CHECKING, Callable, List, Optional, Tuple, TypeVar,
99
Union)
1010

@@ -284,7 +284,6 @@ def get_device_communicator_cls(cls) -> str:
284284
class NvmlCudaPlatform(CudaPlatformBase):
285285

286286
@classmethod
287-
@lru_cache(maxsize=8)
288287
@with_nvml_context
289288
def get_device_capability(cls,
290289
device_id: int = 0
@@ -298,7 +297,6 @@ def get_device_capability(cls,
298297
return None
299298

300299
@classmethod
301-
@lru_cache(maxsize=8)
302300
@with_nvml_context
303301
def has_device_capability(
304302
cls,
@@ -311,22 +309,19 @@ def has_device_capability(
311309
return False
312310

313311
@classmethod
314-
@lru_cache(maxsize=8)
315312
@with_nvml_context
316313
def get_device_name(cls, device_id: int = 0) -> str:
317314
physical_device_id = device_id_to_physical_device_id(device_id)
318315
return cls._get_physical_device_name(physical_device_id)
319316

320317
@classmethod
321-
@lru_cache(maxsize=8)
322318
@with_nvml_context
323319
def get_device_uuid(cls, device_id: int = 0) -> str:
324320
physical_device_id = device_id_to_physical_device_id(device_id)
325321
handle = pynvml.nvmlDeviceGetHandleByIndex(physical_device_id)
326322
return pynvml.nvmlDeviceGetUUID(handle)
327323

328324
@classmethod
329-
@lru_cache(maxsize=8)
330325
@with_nvml_context
331326
def get_device_total_memory(cls, device_id: int = 0) -> int:
332327
physical_device_id = device_id_to_physical_device_id(device_id)

0 commit comments

Comments
 (0)