Add linalg support via GPUArrays extension#3148
Open
rsenne wants to merge 3 commits into
Open
Conversation
Member
|
@kshyatt can you help review? |
kshyatt
reviewed
Jun 7, 2026
kshyatt
reviewed
Jun 7, 2026
| func::Const{typeof(mul!)}, | ||
| RT::Type{<:Annotation}, | ||
| C::Annotation{<:AbstractGPUArray}, | ||
| A::Annotation, |
Collaborator
There was a problem hiding this comment.
What if A and B are actually CPU arrays?
Author
There was a problem hiding this comment.
I now restricted it to gpu array types
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3148 +/- ##
==========================================
+ Coverage 66.76% 73.80% +7.04%
==========================================
Files 65 66 +1
Lines 21522 22611 +1089
==========================================
+ Hits 14369 16689 +2320
+ Misses 7153 5922 -1231 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
|
anything else I can do on this? |
Member
|
bump @kshyatt |
kshyatt
approved these changes
Jun 25, 2026
Extend the GPUArrays matmul rules to cover UpperTriangular, LowerTriangular, Symmetric, and Hermitian operands. The primal already dispatches to the specialized BLAS kernel (trmm/symm/hemm); the reverse pass now projects the dense cotangent onto each wrapper's stored entries via _accumulate_operand!. UnitTriangular is excluded since its fixed diagonal cannot carry a tangent. Verified against finite differences on JLArrays and CUDA.
bacc98b to
a173344
Compare
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.
Resolves #3122.
Adds custom rules for matmul/dot/sum on GPU arrays.
This came up while building GPU MCMC in ParallelMCMC.jl#32, where @wsmoses suggested overloading matmul for GPU arrays directly in Enzyme as an extension rather than keeping per-package wrappers.