@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / e255d92990
Fork 0

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 14, 05:30 UTC

[Chore] Remove duplicate `has_` functions in vllm.utils (#27372)

Signed-off-by: Jonathan <chenleejonathan@gmail.com>

Jonathan Chen committed Oct 23, 2025 at 02:11 UTC e255d929902dcf8968541d2cbf0d18f0fe3f9c49
1 file changed -41
vllm/utils/__init__.py
-41
@@ -5,7 +5,6 @@ import contextlib
5 import datetime
6 import enum
7 import getpass
8 -import importlib.util
8 import inspect
9 import json
10 import multiprocessing
@@ -1048,46 +1047,6 @@ def check_use_alibi(model_config: ModelConfig) -> bool:
1047 )
1048
1049
1051 -@cache
1052 -def _has_module(module_name: str) -> bool:
1053 - """Return True if *module_name* can be found in the current environment.
1054 -
1055 - The result is cached so that subsequent queries for the same module incur
1056 - no additional overhead.
1057 - """
1058 - return importlib.util.find_spec(module_name) is not None
1059 -
1060 -
1061 -def has_pplx() -> bool:
1062 - """Whether the optional `pplx_kernels` package is available."""
1063 -
1064 - return _has_module("pplx_kernels")
1065 -
1066 -
1067 -def has_deep_ep() -> bool:
1068 - """Whether the optional `deep_ep` package is available."""
1069 -
1070 - return _has_module("deep_ep")
1071 -
1072 -
1073 -def has_deep_gemm() -> bool:
1074 - """Whether the optional `deep_gemm` package is available."""
1075 -
1076 - return _has_module("deep_gemm")
1077 -
1078 -
1079 -def has_triton_kernels() -> bool:
1080 - """Whether the optional `triton_kernels` package is available."""
1081 -
1082 - return _has_module("triton_kernels")
1083 -
1084 -
1085 -def has_tilelang() -> bool:
1086 - """Whether the optional `tilelang` package is available."""
1087 -
1088 - return _has_module("tilelang")
1089 -
1090 -
1050 def length_from_prompt_token_ids_or_embeds(
1051 prompt_token_ids: list[int] | None,
1052 prompt_embeds: torch.Tensor | None,