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 9, 12:30 UTC
[Attention] Use `has_flashinfer` helper (#33177)
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Matthew Bonanni committed
Jan 27, 2026 at 13:33 UTC
1cbccb6dbabd6f80d50d615a3987e813caf5c8af
1 file changed
+4
-11
vllm/model_executor/layers/attention/mla_attention.py
+4
-11
@@ -229,7 +229,7 @@ from vllm.model_executor.layers.quantization.utils.quant_utils import (
229
get_and_maybe_dequant_weights,
230
)
231
from vllm.platforms import current_platform
232
-from vllm.utils.flashinfer import has_nvidia_artifactory
232
+from vllm.utils.flashinfer import has_flashinfer, has_nvidia_artifactory
233
from vllm.utils.math_utils import cdiv, round_down
234
from vllm.utils.torch_utils import (
235
direct_register_custom_op,
@@ -599,13 +599,6 @@ except ImportError:
599
is_vllm_fa = False
600
601
602
-@functools.cache
603
-def flashinfer_available() -> bool:
604
- import importlib.util
605
-
606
- return importlib.util.find_spec("flashinfer") is not None
607
-
608
-
602
def dynamic_per_batched_tensor_quant(
603
x: torch.Tensor, dtype: torch.dtype = torch.float8_e4m3fn
604
):
@@ -824,7 +817,7 @@ def use_flashinfer_prefill() -> bool:
817
vllm_config = get_current_vllm_config()
818
if not (
819
not vllm_config.attention_config.disable_flashinfer_prefill
827
- and flashinfer_available()
820
+ and has_flashinfer()
821
and not vllm_config.attention_config.use_cudnn_prefill
822
and current_platform.is_device_capability_family(100)
823
):
@@ -838,7 +831,7 @@ def use_cudnn_prefill() -> bool:
831
832
vllm_config = get_current_vllm_config()
833
return (
841
- flashinfer_available()
834
+ has_flashinfer()
835
and vllm_config.attention_config.use_cudnn_prefill
836
and current_platform.is_device_capability_family(100)
837
and has_nvidia_artifactory()
@@ -851,7 +844,7 @@ def use_trtllm_ragged_deepseek_prefill() -> bool:
844
845
vllm_config = get_current_vllm_config()
846
if not (
854
- flashinfer_available
847
+ has_flashinfer()
848
and vllm_config.attention_config.use_trtllm_ragged_deepseek_prefill
849
and current_platform.is_device_capability_family(100)
850
):