-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Generalized svd throws #29553
Comments
Here is code that produces LAPACK bugs, also has a curiosity that maybe someone would like using LinearAlgebra
#print all the digits
Base.show(io::IO, x::Union{Float64,Float32}) = Base.Grisu._show(io, x, Base.Grisu.SHORTEST, 0, true, false)
m1,m2,n,r,rA,rB =2,2,3,2,1,2
v=[0,0,0]
trials = 200_000
for i = 1:trials
E = randn(r,n)
A = randn(m1,rA)*randn(rA,r)*E
B = randn(m2,rB)*randn(rB,r)*E
try
U,V,Q,C,S,R =svd(A,B)
v[size(C,2)] +=1
catch
println("Found an LAPACK Bug on trial #$i")
show(A);show(B)
println(v*100 ./trials)
end
end
println("% of time, C is 2x2: ", v[2]*100 ./ trials)
println("% of time, C is 2x3: ", v[3]*100 ./ trials); Sample run:
|
Both of you are almost certainly correct. What I suspect happens is the following. According to the documentation of xGGSVD3 The problem with xTGSJA also has to do with floating-point woes, but is unrelated otherwise. For context, xTGSJA works on n-by-n upper-triangular matrices TL;DR: these are LAPACK issues, not Julia issues. |
Should we file this upstream? |
I'm not sure. Rank decisions are ill-posed problems and can be notoriously difficult, especially, in my experience, when rank decisions of submatrices are involved that depend on other rank decisions. The second problem could be addressed with a more relaxed tolerance; however, then you'd have to decide what convergence means in the face of round-off errors and if it is acceptable to stop iterating when the columns of It could be interesting to talk to the LAPACK people about this, but at the same time I think it's important to realize that methods like this can fail. |
Refiling JuliaLinearAlgebra/LAPACK.jl#6 here
I think this might be an issue with the LAPACK routine and not our wrappers. The error means
and the error is DTGSJA means
cc: @alanedelman
The text was updated successfully, but these errors were encountered: