-
Notifications
You must be signed in to change notification settings - Fork 55
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
Change of behavior/regression between julia 1.7 and 1.8 #251
Comments
+1 |
@dkarrasch I haven't looked closely at the concatenation code, it looks like in 1.7 we went through the abstractarray.jl code path, while in 1.8 we go through the machinery in sparsevector.jl. This likely occurred here: f341c79 when Linalg and SA were fully split? |
Concatenation is always so much fun!!! This is on v1.6.7: julia> vcat(x, zero(eltype(x)))
2-element SparseVector{Int64, Int64} with 1 stored entry:
[1] = 3
julia> vcat(zero(eltype(x)), x)
2-element Vector{Int64}:
0
3 |
As for the second issue, the offending line is this one: SparseArrays.jl/src/sparsematrix.jl Lines 1918 to 1919 in aa51c9b
In the sparse context, this is a very reasonable optimization. If you follow the call track, you see that it used to work only because the reduction was using generic, iterator-based code that is supposed to be slow for sparse matrices. In particular, it used to work only because it was tediously adding up all the zeros (or the values of Base.:*(x::LogSemiring{T}, n::Integer) where T = begin
z = zero(x)
iszero(n) && return z
if n > 0
for _ in 1:n
z += x
end
else
for _ in 1:n
z -= x
end
end
return z
end Note, this is not cheating, because this is what has been done inside |
I see... Then, we'll patch |
Closed by #253. |
Hello,
I've observed some inconsistencies between julia 1.7 and 1.8 with the SparseArrays module:
sum
with types not supporting integer multiplication:The text was updated successfully, but these errors were encountered: