Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/transformers/utils/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,13 @@ def is_mamba_2_ssm_available() -> bool:


@lru_cache
def is_flash_linear_attention_available():
def is_flash_linear_attention_available() -> bool:
is_available, fla_version = _is_package_available("fla", return_version=True)
return is_torch_cuda_available() and is_available and version.parse(fla_version) >= version.parse("0.2.2")
return (
(is_torch_cuda_available() or is_torch_mlu_available())
and is_available
and version.parse(fla_version) >= version.parse("0.2.2")
)


@lru_cache
Expand Down
Loading