Repository navigation
Conversation
The storage-level `mul!(y, tA, A, x, α, β)` reshapes both vectors to n×1 matrices and forwards to the matrix-matrix `mul!`, so back-ends with a vendor gemm also handle matrix-vector products. For a non-contiguous view that reshape returns a `Base.ReshapedArray`, which isn't a strided GPU array, and the product fell through to LinearAlgebra's CPU fallback (scalar indexing on Julia 1.13, a MethodError before). Only forward when the reshape yields a strided GPU matrix, and otherwise run the generic kernel on the vectors directly, as this method did before #775. Fixes #816
This branch has not been deployed
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.
The storage-level
mul!(y, tA, A, x, α, β)reshapesyandxton×1matrices and forwards to the matrix-matrixmul!, so back-ends that only overload gemm still get matrix-vector products. For a non-contiguous view,reshapereturns aBase.ReshapedArrayrather than a strided GPU array. The call then fell through to LinearAlgebra's CPU fallback, which fails with a scalar-indexing error on Julia 1.13 and with aMethodErroron earlier versions. #775 introduced this; before it, the reshaped vectors went to GPUArrays' own kernel.This keeps the forwarding when the reshape yields a strided GPU matrix (plain vectors and contiguous views), and otherwise runs
generic_matmatmul!on the vectors directly. The test calls the storage-levelmul!with step-rangexandyfortAin'N','T'and'C'.Fixes #816