From d5b32d92ef7b9b243a3bb962748294d41c0d6283 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 22 Oct 2025 18:42:21 -0400 Subject: [PATCH 1/2] [Chore] Remove duplicate `has_` functions in vllm.utils Signed-off-by: Jonathan --- vllm/utils/__init__.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/vllm/utils/__init__.py b/vllm/utils/__init__.py index 9bfb348a1d24..a630279e9e22 100644 --- a/vllm/utils/__init__.py +++ b/vllm/utils/__init__.py @@ -5,7 +5,6 @@ import datetime import enum import getpass -import importlib.util import inspect import json import multiprocessing @@ -1048,46 +1047,6 @@ def check_use_alibi(model_config: ModelConfig) -> bool: ) -@cache -def _has_module(module_name: str) -> bool: - """Return True if *module_name* can be found in the current environment. - - The result is cached so that subsequent queries for the same module incur - no additional overhead. - """ - return importlib.util.find_spec(module_name) is not None - - -def has_pplx() -> bool: - """Whether the optional `pplx_kernels` package is available.""" - - return _has_module("pplx_kernels") - - -def has_deep_ep() -> bool: - """Whether the optional `deep_ep` package is available.""" - - return _has_module("deep_ep") - - -def has_deep_gemm() -> bool: - """Whether the optional `deep_gemm` package is available.""" - - return _has_module("deep_gemm") - - -def has_triton_kernels() -> bool: - """Whether the optional `triton_kernels` package is available.""" - - return _has_module("triton_kernels") - - -def has_tilelang() -> bool: - """Whether the optional `tilelang` package is available.""" - - return _has_module("tilelang") - - def length_from_prompt_token_ids_or_embeds( prompt_token_ids: list[int] | None, prompt_embeds: torch.Tensor | None, From 168daeee21908d48dadd371b12d919d9e8730cba Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 22 Oct 2025 18:42:21 -0400 Subject: [PATCH 2/2] [Chore] Remove duplicate `has_` functions in vllm.utils Signed-off-by: Jonathan --- vllm/utils/__init__.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/vllm/utils/__init__.py b/vllm/utils/__init__.py index 9bfb348a1d24..a630279e9e22 100644 --- a/vllm/utils/__init__.py +++ b/vllm/utils/__init__.py @@ -5,7 +5,6 @@ import datetime import enum import getpass -import importlib.util import inspect import json import multiprocessing @@ -1048,46 +1047,6 @@ def check_use_alibi(model_config: ModelConfig) -> bool: ) -@cache -def _has_module(module_name: str) -> bool: - """Return True if *module_name* can be found in the current environment. - - The result is cached so that subsequent queries for the same module incur - no additional overhead. - """ - return importlib.util.find_spec(module_name) is not None - - -def has_pplx() -> bool: - """Whether the optional `pplx_kernels` package is available.""" - - return _has_module("pplx_kernels") - - -def has_deep_ep() -> bool: - """Whether the optional `deep_ep` package is available.""" - - return _has_module("deep_ep") - - -def has_deep_gemm() -> bool: - """Whether the optional `deep_gemm` package is available.""" - - return _has_module("deep_gemm") - - -def has_triton_kernels() -> bool: - """Whether the optional `triton_kernels` package is available.""" - - return _has_module("triton_kernels") - - -def has_tilelang() -> bool: - """Whether the optional `tilelang` package is available.""" - - return _has_module("tilelang") - - def length_from_prompt_token_ids_or_embeds( prompt_token_ids: list[int] | None, prompt_embeds: torch.Tensor | None,