Skip to content

Commit aa05465

Browse files
MengqingCaoAngazenn
authored andcommitted
[Bugfix] Fix triton placeholder patch period (vllm-project#704)
Fix triton placeholder patch period Signed-off-by: MengqingCao <cmq0113@163.com>
1 parent 75e2005 commit aa05465

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

vllm_ascend/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ def register():
2323

2424

2525
def register_model():
26+
# TODO: fixme when TritonPlaceholder fixed
27+
from vllm_ascend.utils import vllm_version_is
28+
if vllm_version_is("0.8.4"):
29+
import vllm_ascend.patch.worker.patch_0_8_4.patch_tritonplaceholder # noqa
2630
from .models import register_model
2731
register_model()

vllm_ascend/patch/worker/patch_0_8_4/patch_tritonplaceholder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Adapted from vllm/triton_utils/importing.py
1818
#
1919

20+
import importlib
2021
import sys
2122
import types
2223
from importlib.util import find_spec
@@ -40,6 +41,8 @@ def __init__(self):
4041
self.autotune = self._dummy_decorator("autotune")
4142
self.heuristics = self._dummy_decorator("heuristics")
4243
self.language = TritonLanguagePlaceholder()
44+
self.__spec__ = importlib.machinery.ModuleSpec(
45+
name="triton", loader=None, origin="placeholder")
4346
logger.warning_once(
4447
"Triton is not installed. Using dummy decorators. "
4548
"Install it via `pip install triton` to enable kernel"

0 commit comments

Comments
 (0)