Skip to content

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

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

Implement LinearAlgebra's storage-specific mul! methods#775
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 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.

LinearAlgebra's strided BlasFloat mul! methods are more specific than that fallback, so on 1.13 our generic_matvecmul! overload for strided GPU arrays was never reached and products ended up in CPU BLAS (which only works for GPU array types that happen to expose a host pointer). The generic_matmatmul_wrapper! hooks likewise forwarded to the legacy name, which on 1.13 bypasses the mul! methods that back-ends provide.

Implement the generic fallback as the new mul! methods, route the wrapper hooks through them, 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. Back-ends should overload the same mul! signatures for their own array types.

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.

LinearAlgebra's strided BlasFloat `mul!` methods are more specific than
that fallback, so on 1.13 our `generic_matvecmul!` overload for strided
GPU arrays was never reached and products ended up in CPU BLAS (which
only works for GPU array types that happen to expose a host pointer).
The `generic_matmatmul_wrapper!` hooks likewise forwarded to the legacy
name, which on 1.13 bypasses the `mul!` methods that back-ends provide.

Implement the generic fallback as the new `mul!` methods, route the
wrapper hooks through them, 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. Back-ends should overload the same `mul!`
signatures for their own array types.
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