[bugfix] fix early import of flash attention (#12959)
Signed-off-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
@@ -587,11 +587,11 @@ def get_num_prefill_decode_query_kv_tokens(
|
||||
num_decode_query_tokens)
|
||||
|
||||
|
||||
try:
|
||||
from vllm.vllm_flash_attn.flash_attn_interface import (
|
||||
fa_version_unsupported_reason, is_fa_version_supported)
|
||||
def get_flash_attn_version():
|
||||
try:
|
||||
from vllm.vllm_flash_attn.flash_attn_interface import (
|
||||
fa_version_unsupported_reason, is_fa_version_supported)
|
||||
|
||||
def flash_attn_version():
|
||||
# if hopper default to FA3, otherwise stick to FA2 for now
|
||||
# TODO(lucas): profile FA3 on ampere to see if it makes sense to
|
||||
# use FA3 as default for both
|
||||
@@ -610,7 +610,5 @@ try:
|
||||
|
||||
assert is_fa_version_supported(fa_version)
|
||||
return fa_version
|
||||
|
||||
VLLM_FLASH_ATTN_VERSION = flash_attn_version()
|
||||
except (ImportError, AssertionError):
|
||||
VLLM_FLASH_ATTN_VERSION = None
|
||||
except (ImportError, AssertionError):
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user