[PyTorch] Normalize FA4 unlimited attention windows - #3570
Draft
yashaswikarnati wants to merge 1 commit into
Draft
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>
This branch has not been deployed
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
Transformer Engine represents an unlimited attention window with
-1. FlashAttention 4 expectsNone; passing(-1, 0)for causal attention can select an empty local window. Normalize the tuple for non-CP attention and the left/right kwargs for CP p2p, all-gather, and a2a forward and backward calls.Tests
Noneand finite windows.git diff --check, DCO, pre-commit, and all reported GitHub CI checks passed. A separate head-128 CP suite case (AGA 906243) was stopped after 45 minutes of compilation without a test result; the target head-256 CP32 training path is running as AGA 906508.The internal
nemotron4port is one cherry-picked commit on top of1ac66e5a, proposed in draft MR !4.