File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -66,3 +66,7 @@ def get_flash_attn_version(requires_alibi: bool = False) -> Optional[int]:
6666def flash_attn_supports_fp8 () -> bool :
6767 return get_flash_attn_version () == 3 and \
6868 current_platform .get_device_capability ().major == 9
69+
70+
71+ def is_flash_attn_varlen_func_available () -> bool :
72+ return current_platform .is_cuda () or current_platform .is_xpu ()
Original file line number Diff line number Diff line change 1414from vllm .attention .layer import Attention
1515from vllm .attention .ops .merge_attn_states import merge_attn_states
1616from vllm .attention .utils .fa_utils import (flash_attn_supports_fp8 ,
17- flash_attn_varlen_func ,
1817 get_flash_attn_version ,
19- get_scheduler_metadata ,
20- reshape_and_cache_flash )
18+ is_flash_attn_varlen_func_available )
19+
20+ if is_flash_attn_varlen_func_available ():
21+ from vllm .attention .utils .fa_utils import (flash_attn_varlen_func ,
22+ get_scheduler_metadata ,
23+ reshape_and_cache_flash )
24+
2125from vllm .config import VllmConfig , get_layers_from_vllm_config
2226from vllm .logger import init_logger
2327from vllm .utils import cdiv
You can’t perform that action at this time.
0 commit comments