-
Notifications
You must be signed in to change notification settings - Fork 131
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
Speedup for spectra for matrix sizes of around 1M! #19
Comments
I believe it was a compiler issue. It works perfectly with matrix as big as 80k. |
Great. And also note that the matrix in your example is not symmetric. |
Hi Yixuan, may I know which eigen solving algorithm is being leveraged by your library? Also is there anyway I can speed up the whole computation process for sparse matrices as big as 80k or even 1M x 1M? I understand reducing the number of maximum iterations might be a solution, but do you have any suggestion other than that? The issue is that I am computing the Laplacian matrix of a graph and aiming to compute its eigenvectors and for few cases the size is as big as 50k to 80k, in which cases it takes around 20-30 seconds to bring out the first 3 eigenvectors. I was wondering it would be great if this computational time can be sped up. |
It is based on the Implicitly Restarted Arnoldi Method, first implemented by the ARPACK package. I think it is not straightforward to gain general improvement on the algorithm, but if your matrix has special structures, there may be some way to do better. Do you have any information on this? For example, the matrix is banded, or is block-diagonal, etc. |
Hi Yixuan, From what I have observed from the code in spectra/include/MatOp/SparseSymShiftSolve.h, you are using the SimplicialLDLT to calculate (A-\sigma I)^{-1}x. I also noticed from the Eigen library that the SimplificialLDLT is recommended for very sparse and not too large problems (e.g., 2D Poisson eq.). Perhaps SparseLU or even ConjugateGradient might work for the case that I am talking about.(Solve the first 3 or 4 eigenvectors of a sparse symmetric matrix of size around 500k x 500k or even 1 million, that is not block-diagonal or banded). It could lead to significant speedup for large scale problems. I am struggling with trying to incorporate this idea in your library. Would love to hear your suggestion and obtain your guidance with this issue. Thanks a lot! |
It is possible to use different solvers to implement the |
Yes, I have a list of ISPD benchmark matrices which I have used. The time for computation is around 5-6 times more than that of PETSc/SLEPc for those matrices. I believe it is the linear solver and the preconditioner used in the present algorithm which is slowing things down. A same version of spectra but with the CG and ILU preconditioner implemented would result in considerable speedup, is my firm belief. |
One more question before I try to write a solver for you: do you only need the smallest eigenvalues such that |
Thanks for the wonderful response. |
Oh, I should have explained my question more clearly. If you only want the smallest |
You can try the example attached below. Note that in this case you have to make sure that the matrix is positive definite. |
Thanks a lot!. This will surely help! |
@bodhi1991 Do you have any success on this? |
I am working with a sparse symmetric positive semidefinite matrix. Is the Sparse Symmetric Shift solver the most optimum solver for computing the minimum eigenvalue of such a matrix? |
Hi Yixuan, |
@bodhi1991 I think you can first test the CG solver in one iteration, and see if is faster than an LDLT solver. And then you may compare the number of iterations via the |
@GYengera It's hard to say "optimum", but generally |
Hi Yixuan, Why are the dimension of the matrices indicated by a signed integer in the code? For example the Thank you. |
@y-yao I may change that to |
Hi Yixuan,
I would like to appreciate your help for taking care of the issue I had with the EigenSymShiftSolver. I have tried to leverage these techniques to try and calculate the eigenvalues of a sparse 40,000 x 40,000 matrix. The spectra library fails to generate the eigenvalues for some reason. The same source code manages to return the eigenvalues for a 30,000 x 30,000 matrix. Is it a limitation of the library?
The text was updated successfully, but these errors were encountered: