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.
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
Enable flash attention #20448
Enable flash attention #20448
Changes from 33 commits
37e2302
057aa66
1abc948
5784361
3a47c53
760e4b2
045f153
71bf0ce
3d2875f
6f99a57
4065bf3
a7390a6
71cbbd5
3af4c95
b9e075a
5b4d23d
59b0672
f269d06
02f3451
f622918
3cf22e4
5b7f81a
53e082a
0ee6752
e310f22
cb62bbc
d0e5de5
c28e460
a94a9e6
36c1131
58ae551
18d6ebd
a36d119
ae34d7f
98edd93
9a5200e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@divyashreepathihalli shouldn't
return_attention_scores
have a default value here?There might be many instances of
_compute_attention
call that don't passreturn_attention_scores
value and I think this change can break them. There is an example here. So I was wondering if it's possible to set a default value here so that other references of_compute_attention
work as before.I think this change is probably the reason that the test is failing in keras-team/keras-hub#1977
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.
This is tricky, right now the value passed to the call method is passed to
_compute_attention
. If we add a default value here and users don't pass the arg value from call it might override the call arg. and that could cause discrepancies.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.
Isn't there any other way to check and make sure the users pass the arg value (rather than lack of default value here)?
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.
I think a work around would be to add a
self._return_attention_scores
and then set it in the call method and use it in_compute_attention
. wdyt?