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

Regression: Eigenvalue computation returns empty results for large symmetric matrices in Julia 1.11.0-beta1 #54517

Closed
singularitti opened this issue May 19, 2024 · 4 comments
Labels
domain:linear algebra Linear algebra external dependencies Involves LLVM, OpenBLAS, or other linked libraries kind:bug Indicates an unexpected problem or unintended behavior kind:correctness bug ⚠ Bugs that are likely to lead to incorrect results in user code without throwing system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips system:mac Affects only macOS
Milestone

Comments

@singularitti
Copy link
Contributor

singularitti commented May 19, 2024

I encountered an issue when computing the eigenvalues and eigenvectors of a large matrix using Julia 1.11.0-beta1. The same code works fine in Julia 1.10.3 but returns empty results in the beta version. This appears to be a regression introduced in the beta version.

Steps to reproduce

Here is the simplified code that sets up the Hamiltonian matrix and attempts to compute its eigenvalues and eigenvectors:

using LinearAlgebra

function setup(N, a=0.01)
    A = zeros(Float64, N, N)
    for i in 1:N
        for j in 1:N
            A[i, j] = exp(-a * (i - j)^2)
        end
    end
    return A
end

N = 1600
A = setup(N)

# Compute the eigenvalues and eigenvectors
eigen(A)

This issue does not only occur when N = 1600. On my computer, this happens when N >= 790.

Expected behavior

The code should return a non-empty list of eigenvalues and a corresponding matrix of eigenvectors.

Actual behavior

julia> eigen(A)
Eigen{Float64, Float64, Matrix{Float64}, Vector{Float64}}
values:
Float64[]
vectors:
1600×0 Matrix{Float64}

Additional information

julia> versioninfo()
Julia Version 1.11.0-beta1
Commit 08e1fc0abb9 (2024-04-10 08:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
@singularitti
Copy link
Contributor Author

Probably related to #54412, but not limited to Hermitian matrices.

@jishnub jishnub added the domain:linear algebra Linear algebra label May 19, 2024
@giordano giordano added this to the 1.11 milestone May 19, 2024
@dkarrasch
Copy link
Member

I can't reproduce:

julia> versioninfo()
Julia Version 1.11.0-beta1
Commit 08e1fc0abb9 (2024-04-10 08:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × 13th Gen Intel(R) Core(TM) i5-1340P
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, goldmont)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)

@singularitti
Copy link
Contributor Author

I suppose it is a macOS Julia problem? It's not only me who has this problem: https://julialang.slack.com/archives/C6A044SQH/p1716231131622339?thread_ts=1716230793.618259

@oscardssmith oscardssmith added system:mac Affects only macOS system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips kind:correctness bug ⚠ Bugs that are likely to lead to incorrect results in user code without throwing kind:bug Indicates an unexpected problem or unintended behavior labels May 20, 2024
@gbaraldi
Copy link
Member

This seems to have gotten fixed in #54237. Which means it's a backport away of being in fine in 1.11

@oscardssmith oscardssmith added the external dependencies Involves LLVM, OpenBLAS, or other linked libraries label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:linear algebra Linear algebra external dependencies Involves LLVM, OpenBLAS, or other linked libraries kind:bug Indicates an unexpected problem or unintended behavior kind:correctness bug ⚠ Bugs that are likely to lead to incorrect results in user code without throwing system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips system:mac Affects only macOS
Projects
None yet
Development

No branches or pull requests

6 participants