-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mul!
is failing with mul!(::Vector, ::Matrix, ::Matrix)
#79
Comments
Yes I encountered this bug too but I assumed it was due to uncommited changes. Hmmm... I couldn't work out what was causing it, but it's something since Julia 1.10, as the CI running 1.9 doesn't encounter it. |
I think JuliaSparse/SparseArrays.jl#469 could be related |
mul!
is failing with SparseMatrix and Matrix
The problematic line |
Yes, everything seems to be working if we use |
Yeah I get all tests passing with |
MWE: mat = diagm([1.0, 2.0, 3.0, 4.0, 5.0])
out = zeros(Float64, size(mat, 1))
f = (2 * ones(Float64, size(mat, 1)))
f2 = ones(Float64, (length(f), 1))
f2 .= f
mul!(out, mat, f2) |
Looking at the signature mul!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat, α::Number, β::Number) If you change the output array to also be a |
From my understanding this is okay: the memory layout should be exactly the same, since Julia is column major, but the wrapping type may differ. Since |
Examining all signatures with [134] mul!(y::AbstractVector, A::AbstractVecOrMat, x::AbstractVector, alpha::Number, beta::Number)
@ ~/.julia/juliaup/julia-1.10.1+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:66
[135] mul!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat, α::Number, β::Number)
@ ~/.julia/juliaup/julia-1.10.1+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:263 This feels like a bug? |
mul!
is failing with SparseMatrix and Matrixmul!
is failing with mul!(::Vector, ::Matrix, ::Matrix)
This follow on from #77. If you have loaded the data as described there and try to fit with, e.g, an XSPEC power law you get the following error.
I'm not suer what the problem is but it seems to be related to the fact that we want to get a vector by multiplying a sparse matrix by another matrix. This should be fine and has worked in the past. Could be some issue with the NuSTAR responses being sparse matrices? Although when I tested
mul!
by hand it works fine with sparse matrices. Could be related to automatic differentiation (?)I will investigate but am posting this issue here as a starting point.
The text was updated successfully, but these errors were encountered: