Skip to content

Update schema in test_flash3_bw_compatibility#2153

Draft
guilhermeleobas wants to merge 2 commits intoDao-AILab:mainfrom
guilhermeleobas:guilhermeleobas/mark-test-xfail
Draft

Update schema in test_flash3_bw_compatibility#2153
guilhermeleobas wants to merge 2 commits intoDao-AILab:mainfrom
guilhermeleobas:guilhermeleobas/mark-test-xfail

Conversation

@guilhermeleobas
Copy link
Copy Markdown
Contributor

xref: #1769 (comment)

Pull request #1769 breaks backward compatibility of the backward function as the C++ mha_bwd function returns some of its inputs (dq, dk, dv).

cc: @janeyx99

@janeyx99
Copy link
Copy Markdown
Contributor

janeyx99 commented Jan 8, 2026

Thanks, I do think the longterm solution if we were to fix the test is to update the schema.

@guilhermeleobas
Copy link
Copy Markdown
Contributor Author

Isn't the test testing for backwards compatibility with Flash Attention 2?

@janeyx99
Copy link
Copy Markdown
Contributor

@guilhermeleobas
Copy link
Copy Markdown
Contributor Author

guilhermeleobas commented Jan 14, 2026

Let me double-check that info, if FA3 schema is backward compatible with FA2.

I'm not sure if that's feasible, but I can try to return empty tensors for dq, dk, dv in the backward function instead of breaking backward compatibility.

return { softmax_d, softmax_lse_log2, dq_accum, dk_accum, dv_accum };

@guilhermeleobas
Copy link
Copy Markdown
Contributor Author

I wasn't aware they were tied.

I think you're right, FA2 and FA3 schemas are not tied.

@guilhermeleobas guilhermeleobas changed the title Mark test test_flash3_bw_compatibility as xfail Update schema in test_flash3_bw_compatibility Jan 14, 2026
Copy link
Copy Markdown
Contributor

@janeyx99 janeyx99 left a comment

Choose a reason for hiding this comment

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

If we're okay BC breaking originally, this change now LGTM as long as the test passes locally.

I'm not sure if the alternative where we undo the BC break is better because it's already been a month or so and people have been building wheels with the current FA3. So changing it back will BC break those people 😬

pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Jan 14, 2026
This test will be broken until Dao-AILab/flash-attention#2153 is resolved, which doesn't seem soon.

Pull Request resolved: #172452
Approved by: https://github.com/mikaylagawarecki
mattteochen pushed a commit to mattteochen/pytorch that referenced this pull request Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants