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 15, 02:15 UTC
Fall back if flashinfer comm module not found (#20936)
Signed-off-by: Yong Hoon Shin <yhshin@meta.com>
Yong Hoon Shin committed
Jul 14, 2025 at 16:11 UTC
61e20828da1639c05a7bb7d1592c4834e10b33b7
1 file changed
+8
-5
vllm/compilation/collective_fusion.py
+8
-5
@@ -20,10 +20,12 @@ from vllm.utils import direct_register_custom_op
20
from .vllm_inductor_pass import VllmInductorPass
21
22
if find_spec("flashinfer"):
23
- import flashinfer.comm as flashinfer_comm
24
-
25
- flashinfer_comm = (flashinfer_comm if hasattr(
26
- flashinfer_comm, "trtllm_allreduce_fusion") else None)
23
+ try:
24
+ import flashinfer.comm as flashinfer_comm
25
+ flashinfer_comm = (flashinfer_comm if hasattr(
26
+ flashinfer_comm, "trtllm_allreduce_fusion") else None)
27
+ except ImportError:
28
+ flashinfer_comm = None
29
else:
30
flashinfer_comm = None
31
from vllm.platforms import current_platform
@@ -411,7 +413,8 @@ class AllReduceFusionPass(VllmInductorPass):
413
use_fp32_lamport = self.model_dtype == torch.float32
414
if flashinfer_comm is None:
415
logger.warning(
414
- "Flashinfer is not installed, skipping allreduce fusion pass")
416
+ "Flashinfer is not installed or comm module not found, "
417
+ "skipping allreduce fusion pass")
418
return
419
# Check if the world size is supported
420
if self.tp_size not in _FI_MAX_SIZES: