@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 825fdb11ad
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

[Bugfix][CPU] Add placeholder to avoid import errors when using fused_moe ops on platforms without triton (#25137)

Signed-off-by: jiang1.li <jiang1.li@intel.com>

Li, Jiang committed Sep 19, 2025 at 15:41 UTC 825fdb11add30237e7f592f1a132d3913cd632ec
1 file changed +9
vllm/model_executor/layers/fused_moe/__init__.py
+9
@@ -78,3 +78,12 @@ if HAS_TRITON:
78 "TritonOrDeepGemmExperts",
79 "BatchedTritonOrDeepGemmExperts",
80 ]
81 +else:
82 + # Some model classes directly use the custom ops. Add placeholders
83 + # to avoid import errors.
84 + def _raise_exception(method: str):
85 + raise NotImplementedError(
86 + f"{method} is not implemented as lack of triton.")
87 +
88 + fused_topk = lambda *args, **kwargs: _raise_exception("fused_topk")
89 + fused_experts = lambda *args, **kwargs: _raise_exception("fused_experts")