[ROCm] Fix CK varlen_fwd binding argument mismatch - #2742
Merged
Conversation
Contributor
Author
|
@tridao @micmelesse @rocking5566 |
rocking5566
approved these changes
Aug 4, 2026
micmelesse
approved these changes
Aug 4, 2026
StevenWang-CY
pushed a commit
to StevenWang-CY/flash-attention
that referenced
this pull request
Aug 28, 2026
(cherry picked from commit 4a948e9) Signed-off-by: StevenWang-CY <stevenwang0805@outlook.com>
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
Fix an API mismatch between the Python
varlen_fwdwrapper and the ROCm CK binding.Problem
The Python wrapper passes
num_splitsas the trailing argument toflash_attn_gpu.varlen_fwd, but the CK binding still uses the previous function signature. This causes CK varlen attention calls to fail with an incompatible function arguments error.Fix
Add the trailing
num_splitsargument to the CKmha_varlen_fwddeclaration and definition.The argument is intentionally unused. CK continues to initialize
num_splitsinternally and select the split count using the existing heuristic, so this change does not alter kernel behavior.Testing
Tested tests/test_flash_attn_ck.py on gfx942: