Skip to content

syevd! is reporting more errors respect to syevr! #1313

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

Open
VinceNeede opened this issue Apr 25, 2025 · 0 comments
Open

syevd! is reporting more errors respect to syevr! #1313

VinceNeede opened this issue Apr 25, 2025 · 0 comments

Comments

@VinceNeede
Copy link

VinceNeede commented Apr 25, 2025

syevd! chosen as default algorithm for juliav v1.12.0+beta is reporting more errors respect to syevr!, creating
problems when a large number of eigen decompositions must be performed.

The same matrix can give LAPACKError (with info>0) on a device and pass on another and viceversa, furthermore the same matrix can give error or not based on the number of threads used, meaning that some instability is present (at least in OpenBLAS, haven't tested MKL yet).

test code with matrix saved in HDF5 The matrix is of medium size $658\times 658$ and resulted from a long computation, so it is stored in a `HDF5` file, if you tell me how can I attach the file for the debug I will send it to you. The code is just the following:
using HDF5
using LinearAlgebra

mat = nothing
h5open("mat_error.h5", "r") do file
	global mat = Hermitian(file["mat"][])
end

@info "exectuing with 2 threads"
BLAS.set_num_threads(2)
eigen(mat)

@info "exectuing with 1 thread"
BLAS.set_num_threads(1)
eigen(mat)
Error obtained The output is
[ Info: exectuing with 2 threads
[ Info: exectuing with 1 thread
ERROR: LoadError: LAPACKException(326121)
Stacktrace:
  [1] chklapackerror_positive(::Int64)
    @ LinearAlgebra.LAPACK ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/lapack.jl:44
  [2] chklapackerror
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/lapack.jl:40 [inlined]
  [3] _syevd!(jobz::Char, uplo::Char, A::Matrix{Float64})
    @ LinearAlgebra.LAPACK ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/lapack.jl:5463
  [4] syevd!
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/lapack.jl:5324 [inlined]
  [5] #eigen!#251
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetriceigen.jl:14 [inlined]
  [6] eigen!
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetriceigen.jl:12 [inlined]
  [7] #_eigen#253
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetriceigen.jl:55 [inlined]
  [8] _eigen
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetriceigen.jl:53 [inlined]
  [9] #eigen#252
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetriceigen.jl:49 [inlined]
 [10] eigen
    @ ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetriceigen.jl:48 [inlined]
 [11] eigen(A::Hermitian{Float64, Matrix{Float64}})
    @ LinearAlgebra ~/.julia/juliaup/julia-1.12.0-beta1+0.x64.linux.gnu/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetriceigen.jl:48
 [12] top-level scope
    @ ~/Tesi/lapack_error/study_from_mat.jl:15
 [13] include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./Base.jl:304
 [14] top-level scope
    @ REPL[2]:1
in expression starting at /home/bisogno/Tesi/lapack_error/study_from_mat.jl:15
@VinceNeede VinceNeede changed the title LAPACKError from syevd reported for only for 1 threaded diagonalization and only for v1.12 LAPACKError from syevd reported only for 1 threaded diagonalization and only for v1.12 Apr 25, 2025
@VinceNeede VinceNeede changed the title LAPACKError from syevd reported only for 1 threaded diagonalization and only for v1.12 syevd! is reporting more errors respect to syevr! Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant