Repository navigation
Implement LinearAlgebra's storage-specific mul! methods - #3257
Merged
Merged
Conversation
maleadt
force-pushed
the
tb/linalg-mul-1.13
branch
3 times, most recently
from
September 3, 2026 13:24
1f0ac8e to
48cc607
Compare
maleadt
marked this pull request as ready for review
September 3, 2026 14:33
Julia 1.13-rc4 bumped LinearAlgebra to a version that includes JuliaLang/LinearAlgebra.jl#1671, which renamed the storage-level `generic_matvecmul!`/`generic_matmatmul!` entry points into 6- and 7-argument `mul!` methods, with the old names kept only as a fallback behind the generic `mul!` method. For matrix-vector products this breaks cuBLAS dispatch: LinearAlgebra's strided BlasFloat `mul!` method is more specific than that fallback, so it wins over our `generic_matvecmul!` overload and calls into CPU BLAS, failing with ArgumentError: Illegal conversion of a CUDACore.DeviceMemory to a Ptr{Float32} Implement the cuBLAS and cuSPARSE products as the new `mul!` methods, and keep the legacy names only as forwarding shims for Julia before 1.13 so that they can be dropped together once 1.13 becomes the floor. Require GPUArrays 11.5.14, whose `generic_matmatmul_wrapper!` hooks (used for element types cuBLAS does not cover) route through `mul!` rather than the legacy name, which on 1.13 would bypass these methods.
maleadt
force-pushed
the
tb/linalg-mul-1.13
branch
from
September 3, 2026 14:47
48cc607 to
6e6c88c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3257 +/- ##
==========================================
+ Coverage 92.18% 92.25% +0.06%
==========================================
Files 184 184
Lines 16291 16289 -2
==========================================
+ Hits 15018 15027 +9
+ Misses 1273 1262 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
CUDA.jl BenchmarksDetails
This comment was automatically generated by workflow using github-action-benchmark. |
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.
Julia 1.13-rc4 bumped LinearAlgebra to a version including JuliaLang/LinearAlgebra.jl#1671, which renamed the storage-level
generic_matvecmul!/generic_matmatmul!entry points into 6- and 7-argumentmul!methods. LinearAlgebra's strided BlasFloatmul!is more specific than the fallback that still routes to the old names, so ourgeneric_matvecmul!overload was never reached on 1.13 and matrix-vector products ended up in CPU BLAS.This implements the products as the new
mul!methods and keeps the legacy names only as forwarding shims for Julia < 1.13 (one@staticblock per file, to be dropped when 1.13 becomes the floor). It requires GPUArrays 11.5.14 (JuliaGPU/GPUArrays.jl#775, now registered), whosegeneric_matmatmul_wrapper!hooks route throughmul!on 1.13.