-
Notifications
You must be signed in to change notification settings - Fork 3
fused_ops: typed flash backward (FusedSDPA + VJP), not a generic CustomCall #13
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d291a82
function: add CustomCall to the backend Function interface
guygrigsby 9ae11d1
fused_ops: typed flash backward instead of a generic CustomCall escap…
guygrigsby 725aad0
Merged with main.
janpfeifer 8940377
fused_ops: add seqlen fields to attention config and direct test harness
guygrigsby 67997e2
fused_ops: implement seqlen padding mask in go backend
guygrigsby e8b8dbe
fused_ops: zero scores tail when seqlen masking restricts kvLen
guygrigsby 45cebd1
fused_ops: return ErrNotImplemented for float8 attention dtype
guygrigsby e479da1
fused_ops: fix option equality panic, seqlen type assertion, and clam…
guygrigsby d69f2d0
Merge pull request #1 from guygrigsby/stage1-seqlen-config
guygrigsby 502e5de
fused_ops: generalize softmaxStats to statesForVJP []Value
guygrigsby e815ee8
fused_ops: call dOutput the "adjoint output gradient" in VJP doc (jan…
guygrigsby 8eb259d
Added `OpTypeFusedScaledDotProductAttentionVJP`.
janpfeifer 20331a9
Skip fused ops tests when they are not implemented for the specific p…
janpfeifer 0058d22
Added BF16 with featureDim=8 tests for XLA CUDA FusedScaledDotProduct…
janpfeifer e738459
Added Float16 tests for Fused SDPA.
janpfeifer 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Since we are changing this a couple of suggestions (but I can do them later):
numHeadsandnumKVHeadsare redundant, since they can be inferred from the shapes, given theaxesLayout. Maybe we just remove them ? (the Go backend can trivially be changed to read these from the shape, and the XLA doesn't need them I think)mask,causal,scaleand eventuallybiasto theScaled.DotProductAttentionConfigsince they are also optional. And make it such thatscale == 0(the default) means no scale.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.
Deferring these to a follow-up PR to keep the statesForVJP refactor isolated: drop
numHeads/numKVHeads(infer from shape +axesLayout), and movemask/causal/scale/biasintoScaledDotProductAttentionConfigwithscale == 0meaning the default. No behavior change intended, just the ergonomics pass you suggested.