Skip to content

Conversation

sandyhouse
Copy link

What does this PR do?

Add support for flash attention 3

Fixes # (issue)
#4854

@hiyouga hiyouga added the pending This problem is yet to be addressed label Aug 6, 2025
@@ -14,7 +14,7 @@

from typing import TYPE_CHECKING

from transformers.utils import is_flash_attn_2_available, is_torch_sdpa_available
from transformers.utils import is_flash_attn_2_available, is_flash_attn_3_available, is_torch_sdpa_available
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a version check here? AFAIK, FA3 utils were introduced recently.

Copy link
Author

@sandyhouse sandyhouse Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FA3 was introduced starting from transformers version 4.53.0. Therefore, the dependency on transformers was updated in the requirements.txt file. @Kuangdd01

penfever pushed a commit to mlfoundations/LLaMA-Factory that referenced this pull request Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending This problem is yet to be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants