[Refactor] Create a function util and cache the results for has_deepgemm, has_deepep, has_pplx (#20187)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2025-06-28 22:06:38 +00:00
committed by GitHub
parent daec9dea6e
commit 4d36693687
12 changed files with 61 additions and 58 deletions
@@ -1,15 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
import importlib.util
import logging
import torch
from vllm.platforms import current_platform
from vllm.triton_utils import triton
from vllm.utils import direct_register_custom_op
from vllm.utils import direct_register_custom_op, has_deep_gemm
has_deep_gemm = importlib.util.find_spec("deep_gemm") is not None
if has_deep_gemm:
if has_deep_gemm():
import deep_gemm
logger = logging.getLogger(__name__)