Repository navigation
[PyTorch] Fix unlimited attention window handling for FlashAttention 4 - #3570
Closed
yashaswikarnati wants to merge 1 commit into
Closed
yashaswikarnati wants to merge 1 commit into
yashaswikarnati wants to merge 1 commit into
Conversation
Translate Transformer's -1 unlimited-window sentinel to FA4's None convention for direct and context-parallel calls. Cover the non-CP tuple argument and raw CP window kwargs with focused tests. Signed-off-by: ykarnati <ykarnati@nvidia.com>
yashaswikarnati
marked this pull request as ready for review
September 29, 2026 19:09
Contributor
|
Collaborator
|
Closing because the fix was merged with #3540. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FlashAttention 4 changed its window handling in
4.0.0b30:(-1, 0)is now treated as an effectively empty local window rather than an unlimited causal window. Transformer Engine still uses-1as its unlimited-window sentinel.4.0.0b30(-1, 0)4.0.0b30without this PR(-1, 0)4.0.0b30with this PR(None, 0)This PR converts TE's
-1sentinel to FA4'sNoneconvention in standard and context-parallel forward and backward paths.Tests
Noneand finite windows.