[Refactor] Extract has_flash_attn_pkg in OmniPlatform (#3068)
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com> Co-authored-by: Canlin Guo <canlinguosdu@gmail.com>
This commit is contained in:
1 parent
afa2b09684
commit
52f17bf292
6 files changed
+94
-58
No files matched your search
@@ -33,6 +33,20 @@ class CudaOmniPlatform(OmniPlatform, CudaPlatformBase):
|
||||
def get_default_stage_config_path(cls) -> str:
|
||||
return "vllm_omni/model_executor/stage_configs"
|
||||
|
||||
@classmethod
|
||||
def has_flash_attn_package(cls) -> bool:
|
||||
from vllm_omni.diffusion.attention.backends.utils.fa import is_flash_attn_installed
|
||||
|
||||
# Turing/Tesla/T4 GPUs don't support flash attention well
|
||||
gpu_name = cls.get_device_name()
|
||||
if "Turing" in gpu_name or "Tesla" in gpu_name or "T4" in gpu_name:
|
||||
return False
|
||||
|
||||
if not is_flash_attn_installed():
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def get_diffusion_attn_backend_cls(
|
||||
cls,
|
||||
|
||||
Reference in new issue
Block a user