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 17, 04:15 UTC
Revert "[Core] Cache some utils" (#3507)
Simon Mo committed
Mar 19, 2024 at 13:22 UTC
cc63d03fbb93f2b984d38e1f5626f523c1f9f1a4
1 file changed
-5
vllm/utils.py
-5
@@ -4,7 +4,6 @@ import socket
4
import subprocess
5
import uuid
6
import gc
7
-from functools import cache
7
from platform import uname
8
from typing import List, Tuple, Union
9
from packaging.version import parse, Version
@@ -121,7 +120,6 @@ def is_hip() -> bool:
120
return torch.version.hip is not None
121
122
124
-@cache
123
def is_neuron() -> bool:
124
try:
125
import transformers_neuronx
@@ -130,7 +128,6 @@ def is_neuron() -> bool:
128
return transformers_neuronx is not None
129
130
133
-@cache
131
def get_max_shared_memory_bytes(gpu: int = 0) -> int:
132
"""Returns the maximum shared memory per thread block in bytes."""
133
# NOTE: This import statement should be executed lazily since
@@ -154,7 +151,6 @@ def random_uuid() -> str:
151
return str(uuid.uuid4().hex)
152
153
157
-@cache
154
def in_wsl() -> bool:
155
# Reference: https://github.com/microsoft/WSL/issues/4071
156
return "microsoft" in " ".join(uname()).lower()
@@ -229,7 +225,6 @@ def set_cuda_visible_devices(device_ids: List[int]) -> None:
225
os.environ["CUDA_VISIBLE_DEVICES"] = ",".join(map(str, device_ids))
226
227
232
-@cache
228
def get_nvcc_cuda_version() -> Optional[Version]:
229
cuda_home = os.environ.get('CUDA_HOME')
230
if not cuda_home: