Fix missing seqlen_info param in softcap scoremod#2366
Open
rucnyz wants to merge 2 commits intoDao-AILab:mainfrom
Open
Fix missing seqlen_info param in softcap scoremod#2366rucnyz wants to merge 2 commits intoDao-AILab:mainfrom
rucnyz wants to merge 2 commits intoDao-AILab:mainfrom
Conversation
apply_score_mod_inner now passes seqlen_info to score_mod functions, but create_softcap_scoremod's scoremod_premask_fn was not updated to accept it, causing a TypeError when compiling softcap kernel variants.
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
apply_score_mod_innerinsoftmax.pycallsscore_modwith 7 arguments includingseqlen_infointroduced in #2043:https://github.com/Dao-AILab/flash-attention/blob/main/flash_attn/cute/softmax.py#L457-L465
But
create_softcap_scoremodinutils.pyreturns a function with only 6 parameters (missingseqlen_info):https://github.com/Dao-AILab/flash-attention/blob/main/flash_attn/cute/utils.py#L120
This causes
TypeError: got an unexpected keyword argument 'seqlen_info'when usingsoftcap.Fix
Add
seqlen_infoparameter toscoremod_premask_fnsignature to matchapply_score_mod_inner.