[Bugfix] Fix triton placeholder patch period (#704)

Fix triton placeholder patch period

Signed-off-by: MengqingCao <cmq0113@163.com>
This commit is contained in:
Mengqing Cao
2025-04-28 18:52:03 +08:00
committed by GitHub
parent 58f9d932d3
commit be9e3e8545
2 changed files with 7 additions and 0 deletions

View File

@@ -23,5 +23,9 @@ def register():
def register_model():
# TODO: fixme when TritonPlaceholder fixed
from vllm_ascend.utils import vllm_version_is
if vllm_version_is("0.8.4"):
import vllm_ascend.patch.worker.patch_0_8_4.patch_tritonplaceholder # noqa
from .models import register_model
register_model()

View File

@@ -17,6 +17,7 @@
# Adapted from vllm/triton_utils/importing.py
#
import importlib
import sys
import types
from importlib.util import find_spec
@@ -40,6 +41,8 @@ if not HAS_TRITON:
self.autotune = self._dummy_decorator("autotune")
self.heuristics = self._dummy_decorator("heuristics")
self.language = TritonLanguagePlaceholder()
self.__spec__ = importlib.machinery.ModuleSpec(
name="triton", loader=None, origin="placeholder")
logger.warning_once(
"Triton is not installed. Using dummy decorators. "
"Install it via `pip install triton` to enable kernel"