Skip to content

Fix FLUX attention by exposing is_causal in SDPA - #2309

Merged
wwwjn merged 1 commit into
mainfrom
fix-flux-attn
Feb 2, 2026
Merged

wwwjn merged 1 commit into
mainfrom
fix-flux-attn

Conversation

@wwwjn

@wwwjn wwwjn commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

fix #2297

the official implementation from black-forest-lab (https://github.com/black-forest-labs/flux/blob/main/src/flux/math.py#L6) they are using torch.nn.functional.scaled_dot_product_attention with default is_casual = False

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 2, 2026
@wwwjn

wwwjn commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

8 GPU Feature test failed because of loss mismatch
8 GPU model test failed because of OOM issue of "DeepSeek V3 FSDP+EP+compile", both failure are not related

@wwwjn
wwwjn merged commit fdd3a37 into main Feb 2, 2026
25 of 29 checks passed
TXacs pushed a commit to McmillanTAC/torchtitan that referenced this pull request Apr 13, 2026
fix pytorch#2297 

the official implementation from black-forest-lab
(https://github.com/black-forest-labs/flux/blob/main/src/flux/math.py#L6)
they are using `torch.nn.functional.scaled_dot_product_attention` with
default is_casual = False
ACharacterInASimulation pushed a commit to ACharacterInASimulation/torchtitan that referenced this pull request Apr 21, 2026
fix pytorch#2297 

the official implementation from black-forest-lab
(https://github.com/black-forest-labs/flux/blob/main/src/flux/math.py#L6)
they are using `torch.nn.functional.scaled_dot_product_attention` with
default is_casual = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flux attention is_causal need be False + Flex Attention support with is_causal=False

3 participants