Skip to content
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

intermittent failure in sparse test #24076

Closed
JeffBezanson opened this issue Oct 10, 2017 · 11 comments
Closed

intermittent failure in sparse test #24076

JeffBezanson opened this issue Oct 10, 2017 · 11 comments
Labels
linear algebra Linear algebra regression Regression in behavior compared to a previous version sparse Sparse arrays test This change adds or pertains to unit tests

Comments

@JeffBezanson
Copy link
Sponsor Member

E.g. here: https://travis-ci.org/JuliaLang/julia/jobs/285862539

Expression: !(Base.USE_GPL_LIBS) || abs(det(factorize(Symmetric(A)))) ≈ abs(det(factorize(Array(A))))
  MethodError: no method matching logabsdet(::Base.LinAlg.LDLt{Float64,SymTridiagonal{Float64,Array{Float64,1}}})
  Closest candidates are:
    logabsdet(!Matched::Base.LinAlg.UnitUpperTriangular{T,S} where S<:(AbstractArray{T,2} where T)) where T at linalg/triangular.jl:2193
    logabsdet(!Matched::Base.LinAlg.UnitLowerTriangular{T,S} where S<:(AbstractArray{T,2} where T)) where T at linalg/triangular.jl:2194
    logabsdet(!Matched::Union{LowerTriangular{T,S} where S<:(AbstractArray{T,2} where T), UpperTriangular{T,S} where S<:(AbstractArray{T,2} where T)}) where T at linalg/triangular.jl:2198
@JeffBezanson JeffBezanson added regression Regression in behavior compared to a previous version sparse Sparse arrays test This change adds or pertains to unit tests labels Oct 10, 2017
@JeffBezanson
Copy link
Sponsor Member Author

@JeffBezanson
Copy link
Sponsor Member Author

@rfourquet
Copy link
Member

rfourquet commented Oct 10, 2017

@vtjnash may have found a cause here, see also my answer to his comment.

@JeffBezanson JeffBezanson added the linear algebra Linear algebra label Oct 10, 2017
@vtjnash
Copy link
Sponsor Member

vtjnash commented Oct 10, 2017

../julia runtests.jl sparse/sparse --seed=0xa57677a41a6158abdaf4fc54c55c744c
reproduces it (thanks @rfourquet for the hint)

@vtjnash
Copy link
Sponsor Member

vtjnash commented Oct 10, 2017

@andreasnoack
Copy link
Member

These shouldn't be hard to fix. We'll need to set more seeds explicitly which is fine. I'll open a PR soon. However, the new seed actually revealed a missing method. The reason for this is that factorize is so type unstable. The new random matrix happens to be symmetric tridiagonal whereas the previous was just symmetric or pd.

@andreasnoack
Copy link
Member

However, the LU failure is more problematic. See

julia/test/linalg/lu.jl

Lines 196 to 208 in 10d470d

@testset "Rational{BigInt} and BigFloat Hilbert Matrix" begin
## Hilbert Matrix (very ill conditioned)
## Testing Rational{BigInt} and BigFloat version
nHilbert = 50
H = Rational{BigInt}[1//(i+j-1) for i = 1:nHilbert,j = 1:nHilbert]
Hinv = Rational{BigInt}[(-1)^(i+j)*(i+j-1)*binomial(nHilbert+i-1,nHilbert-j)*
binomial(nHilbert+j-1,nHilbert-i)*binomial(i+j-2,i-1)^2
for i = big(1):nHilbert,j=big(1):nHilbert]
@test inv(H) == Hinv
setprecision(2^10) do
@test norm(Array{Float64}(inv(float(H)) - float(Hinv))) < 1e-100
end
end
. There shouldn't be anything random in that test so something more serious is going on there.

@andreasnoack
Copy link
Member

It looks like Hinv occasionally has a single element set to zero instead the right value (the (36,42) element when I was able to reproduce locally). Notice again that this should be completely deterministic. There are no random numbers here.

@kshyatt
Copy link
Contributor

kshyatt commented Oct 10, 2017

That line, with all its wrapping, is making me really sad :(

@andreasnoack
Copy link
Member

I think the issue is somehow related to the comprehension. If I change the comprehension for to an array allocation and a double loop then I'm unable to get the corruption but with the comprehension it happens quite frequently. Hence, we could probably make the tests pass by avoiding the comprehension but it would probably be good to understand why this can happen at all.

@andreasnoack
Copy link
Member

Fixed by #24085. The other issue is genuine and tracked in #24098.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra regression Regression in behavior compared to a previous version sparse Sparse arrays test This change adds or pertains to unit tests
Projects
None yet
Development

No branches or pull requests

5 participants