Skip to content

Commit

Permalink
flash attention forward doesn't play well with torch.compile
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Dec 9, 2024
1 parent c8c8dff commit 92df994
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/transformers/modeling_flash_attention_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def fa_peft_integration_check(
deterministic_g = os.environ.get("FLASH_ATTENTION_DETERMINISTIC", "0") == "1"


@torch.compiler.disable(recursive=True)
def _flash_attention_forward(
query_states: torch.Tensor,
key_states: torch.Tensor,
Expand Down

0 comments on commit 92df994

Please sign in to comment.