Skip to content

Implement LinearAlgebra's storage-specific mul! methods - #1064

Merged
maleadt merged 1 commit into
mainfrom
tb/linalg-mul-1.13
Sep 4, 2026
Merged

Implement LinearAlgebra's storage-specific mul! methods#1064
maleadt merged 1 commit into
mainfrom
tb/linalg-mul-1.13

Conversation

@maleadt

@maleadt maleadt commented Sep 3, 2026

Copy link
Copy Markdown
Member

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-argument mul! methods. LinearAlgebra's strided BlasFloat mul! is more specific than the fallback that still routes to the old names, so our generic_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 @static block per file, to be dropped when 1.13 becomes the floor). It requires GPUArrays 11.5.14 (JuliaGPU/GPUArrays.jl#775, now registered), whose generic_matmatmul_wrapper! hooks route through mul! on 1.13.

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 rocBLAS 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
with device pointers.

Implement the dense and sparse 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.
@maleadt
maleadt force-pushed the tb/linalg-mul-1.13 branch 2 times, most recently from b975380 to 490fafd Compare September 3, 2026 13:24
@maleadt
maleadt marked this pull request as ready for review September 3, 2026 14:33
@maleadt
maleadt merged commit c13e8bd into main Sep 4, 2026
4 of 5 checks passed
@maleadt
maleadt deleted the tb/linalg-mul-1.13 branch September 4, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant