[Cute,Fwd,Sm100] Add r2p for local mask#2185
Merged
v0i0 merged 12 commits intoDao-AILab:mainfrom Jan 17, 2026
Merged
Conversation
Add mask_r2p_dual_bound function using XOR of two bitmasks to efficiently mask elements outside [col_limit_left, col_limit_right) range for SM100 local attention.
Add mask_r2p_dual_bound function using XOR of two bitmasks to efficiently mask elements outside [col_limit_left, col_limit_right) range for SM100 local attention.
Contributor
Author
v0i0
reviewed
Jan 16, 2026
Contributor
Author
|
|
Member
|
This is awesome! |
53adeb0 to
e94012a
Compare
v0i0
approved these changes
Jan 16, 2026
Contributor
Author
|
@v0i0 noob question: I don't see a merge button. Can you help merge for me? tests just finished running |
elewarr
pushed a commit
to elewarr/flash-attention
that referenced
this pull request
Feb 4, 2026
[Cute,Fwd,Sm100] Add r2p for local mask
YangWang92
pushed a commit
to YangWang92/flash-attention
that referenced
this pull request
Feb 15, 2026
[Cute,Fwd,Sm100] Add r2p for local mask
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.
The idea is similar to mask_r2p.
Using
xormask_range = mask_right & ~ mask_leftbecause:Notes:
OverflowError: Python int too large to convert to C longatmask_range = mask_right & ~mask_leftBenchmark
Before
After
test
============================================================================================ 49957 passed, 34769 skipped, 1325295 warnings in 20300.02s (5:38:20) ============================================================================================