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 10, 02:45 UTC
[Attention][AMD] Make flash-attn optional (#30361)
Signed-off-by: Matthias Gehre <matthias.gehre@amd.com>
Matthias Gehre committed
Jan 15, 2026 at 18:18 UTC
047413375c9de380213cb97fca4ce70915876939
1 file changed
+7
-5
vllm/v1/attention/backends/fa_utils.py
+7
-5
@@ -23,11 +23,13 @@ elif current_platform.is_xpu():
23
elif current_platform.is_rocm():
24
try:
25
from flash_attn import flash_attn_varlen_func # noqa: F401
26
- except ImportError as e:
27
- raise ImportError(
28
- "Rocm platform requires upstream flash-attn "
29
- "to be installed. Please install flash-attn first."
30
- ) from e
26
+ except ImportError:
27
+
28
+ def flash_attn_varlen_func(*args, **kwargs):
29
+ raise ImportError(
30
+ "ROCm platform requires upstream flash-attn "
31
+ "to be installed. Please install flash-attn first."
32
+ )
33
34
35
def get_flash_attn_version(requires_alibi: bool = False) -> int | None: