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

SVD on big floats #42

Open
matbesancon opened this issue Feb 18, 2021 · 4 comments
Open

SVD on big floats #42

matbesancon opened this issue Feb 18, 2021 · 4 comments

Comments

@matbesancon
Copy link
Contributor

Observed on master and Julia 1.5, svdsolve does not seem to work with BigFloats:

julia> using KrylovKit
julia> direction = rand(BigFloat, 4, 3)

julia> svdsolve(direction)
ERROR: MethodError: no method matching bidiagsvd!(::LinearAlgebra.Bidiagonal{BigFloat,SubArray{BigFloat,1,Array{BigFloat,1},Tuple{UnitRange{Int64}},true}}, ::SubArray{BigFloat,2,Array{BigFloat,2},Tuple{UnitRange{Int64},UnitRange{Int64}},false}, ::SubArray{BigFloat,2,Array{BigFloat,2},Tuple{UnitRange{Int64},UnitRange{Int64}},false})
Stacktrace:
 [1] svdsolve(::Array{BigFloat,2}, ::Array{BigFloat,1}, ::Int64, ::Symbol, ::GKL{ModifiedGramSchmidt2,Float64}) at /home/mbesancon/.julia/packages/KrylovKit/OLgKs/src/eigsolve/svdsolve.jl:155
 [2] svdsolve(::Array{BigFloat,2}, ::Array{BigFloat,1}, ::Int64, ::Symbol; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/mbesancon/.julia/packages/KrylovKit/OLgKs/src/eigsolve/svdsolve.jl:109
 [3] svdsolve(::Array{BigFloat,2}, ::Array{BigFloat,1}, ::Int64, ::Symbol) at /home/mbesancon/.julia/packages/KrylovKit/OLgKs/src/eigsolve/svdsolve.jl:106
 [4] svdsolve(::Array{BigFloat,2}, ::Int64, ::Symbol, ::Type{T} where T; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/mbesancon/.julia/packages/KrylovKit/OLgKs/src/eigsolve/svdsolve.jl:101
 [5] svdsolve(::Array{BigFloat,2}, ::Int64, ::Symbol, ::Type{T} where T) at /home/mbesancon/.julia/packages/KrylovKit/OLgKs/src/eigsolve/svdsolve.jl:101 (repeats 2 times)
 [6] top-level scope at REPL[4]:1
@Jutho
Copy link
Owner

Jutho commented Feb 18, 2021

KrylovKit still uses the julia LinearAlgebra standard library, or thus BLAS and LAPACK, for dealing with the small problems projected on the Krylov subspace. So it is currently restricted to the same eltypes as LAPACK. I would love to see this changed in the future, but I don't expect to have any time for this anywhere soon.

@matbesancon
Copy link
Contributor Author

Thanks, indeed I tracked down some issues in the Julia repo itself. Could it rely on GenericSVD?
https://github.com/JuliaLinearAlgebra/GenericSVD.jl/

@Jutho
Copy link
Owner

Jutho commented Mar 26, 2021

It could, but so far I did not find the time to implement these backends. It also seems there is some fragmentation of linear algebra routines for generic numbers / BigFloat across different packages.

@matbesancon
Copy link
Contributor Author

Edit on this: GenericSVD is deprecated, GenericLinearAlgebra implements all the necessary features I believe?

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

2 participants