-
Notifications
You must be signed in to change notification settings - Fork 256
Cached inference for NSA #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mutiann
wants to merge
22
commits into
fla-org:main
Choose a base branch
from
mutiann:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,464
−237
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
4b42665
Fixing block_indices generation: for the first token in a block, its …
mutiann 9fd04a2
Adapt selective attention branch (parallel_nsa_fwd) to the cached inf…
mutiann 17f7f7c
Adapt compressive attention branch (parallel_nsa_compression_fwd) to …
mutiann b81b0b8
Adapt top-k selection (parallel_nsa_topk) to the cached inference sce…
mutiann 45a9444
Add tests on the complete NSA forward function
mutiann d32f335
Merge remote-tracking branch 'origin/main'
mutiann 9c52df6
Merge remote-tracking branch 'origin/main'
mutiann 7856f48
Fix NSA layer forward for inference
mutiann 52a6632
Merge branch 'fla-org:main' into main
mutiann fd32c4c
Fix varlen mode for NSA selective attention; add tests
mutiann 2dafac7
Cleanup test code
mutiann 2aa3851
Fix backward pass of compressive NSA & add tests
mutiann ebec03a
Fix varlen mode for NSA compressive attention; add tests
mutiann ccbd727
Fix varlen mode for top-k kernel & naive impl.; add tests
mutiann 72c7114
Clean up contiguity guards
mutiann 9ad97b7
Fix block indices generation to match kernel outputs & fix boundary c…
mutiann 79655c7
Impl. full naive path; add tests for full forward & backward func, va…
mutiann 002987f
Merge branch 'fla-org:main' into main
mutiann 368d47e
Merge remote-tracking branch 'origin/main'
mutiann 31e1806
Skip redundant tests on each individual op given tests on the whole N…
mutiann ff69e59
Varlen mode for NSA layer
mutiann bb2e32e
Fix lint, hints, and comments
mutiann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Device mismatch risk when attention_mask is on CPU and q/states are on CUDA.
indices_k and cu_seqlens_k can end up on a different device than q/states, breaking downstream varlen paths. Move them to q’s device after normalizing q to a tuple.
Apply:
📝 Committable suggestion
🤖 Prompt for AI Agents