-
Notifications
You must be signed in to change notification settings - Fork 34
[ROCm] Jax Add softmax sink (learnable off-by-one) support for the ROCm/CK fused attention backend #678
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
shurale-nkn
wants to merge
12
commits into
dev
Choose a base branch
from
sink_support_ck
base: dev
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.
Open
[ROCm] Jax Add softmax sink (learnable off-by-one) support for the ROCm/CK fused attention backend #678
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ed56839
add FWD pass for atten kernels with sink from CK
e3e39a1
Merge remote-tracking branch 'origin/dev' into sink_support_test_merge
cd72520
add fmha-sink bwd support
shurale-nkn 9d4dca8
Merge remote-tracking branch 'origin/dev' into sink_support_ck
shurale-nkn 6f4a2fc
Update submodule
shurale-nkn 4268e24
post merge fix
shurale-nkn 85bb3d3
bug in TE
shurale-nkn 342335f
fix for swa + sink
shurale-nkn 1120c76
removed fixed code
shurale-nkn 2fc6952
Merge remote-tracking branch 'origin/dev'
shurale-nkn 0368904
format + small relocation
shurale-nkn 17cec09
CI fix. Fixed hlo check for Distributed test
shurale-nkn 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
Submodule QoLA
updated
3 files
| +3 −4 | patches/aiter/0003-ck-te-receipt-700.patch | |
| +21 −0 | patches/aiter/0008-fmha-bwd-sink-fix.patch | |
| +104 −0 | patches/aiter/0009-fmha-fwd-sink-window-offset-fix.patch |
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
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
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.
🟡 Dropping
softmax_typefromis_ck_backend_supportedalso flips the PyTorch ROCm path onto CK, which this PR neither mentions nor tests.Chain: PyTorch's Python-level gating already permits FusedAttention for non-vanilla softmax, and the ROCm carve-outs are explicit —
dot_product_attention/utils.py:1061skips the thd/cuDNN-version disable underIS_HIP_EXTENSION, and:1479skips the determinism disable the same way. Until this commit the only thing stopping it was the C++ layer: CK rejected sink here and AOTriton still does (fused_attn_aotriton.cpp:72), sonvte_get_fused_attn_backendreturnedNVTE_No_Backendand DPA silently fell back toUnfusedDotProductAttention. With the guard gone, CK is selected.Concretely,
tests/pytorch/attention/test_attention.py::test_dpa_softmaxand::test_dpa_softmax_thd(15 configs each,num_gqa_groups=8+ causal/padding/SWA(128,0)) now run against CK on ROCm — they aren't cuDNN-gated here becauseget_cudnn_version()returns(99, 0, 0)for HIP (pytorch/utils.py:698), andci/pytorch.sh:89runs the whole file atTEST_LEVEL 1. That's a meaningful surface: GQAdk/dvexpansion plus THD, i.e. theatomicAdd-per-headd_sinkpaths, on a framework whose aux-pack plumbing this PR didn't touch.The 486-test JAX sweep you cited answers the CK-kernel question, but not the PyTorch-binding one. Could you confirm the ROCm PyTorch attention job is green on this branch? If it isn't yet, gating on framework (or keeping a narrow CK-side guard until PyTorch is validated) would be safer than enabling both frameworks in one commit.