a robust and efficient parallel svd solver based on
play

A Robust and Efficient Parallel SVD Solver Based on Restarted - PowerPoint PPT Presentation

Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation A Robust and Efficient Parallel SVD Solver Based on Restarted Lanczos Bidiagonalization Jose E. Roman Universidad Polit ecnica de Valencia, Spain (joint work with V.


  1. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation A Robust and Efficient Parallel SVD Solver Based on Restarted Lanczos Bidiagonalization Jose E. Roman Universidad Polit´ ecnica de Valencia, Spain (joint work with V. Hernandez and A. Tomas) Harrachov 2007

  2. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Outline Overview of SLEPc 1 Summary of Functionality The SVD in SLEPc Restarted Lanczos Bidiagonalization 2 Lanczos Bidiagonalization Dealing with Loss of Orthogonality Restarted Bidiagonalization Enhancements for Parallel Efficiency Evaluation 3 Numerical Robustness Parallel Performance

  3. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Overview of SLEPc

  4. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation What Users Need ◮ Abstraction of mathematical objects: vectors and matrices ◮ Efficient linear solvers (direct or iterative) ◮ Easy programming interface ◮ Run-time flexibility, full control over the solution process ◮ Parallel computing, mostly transparent to the user ◮ State-of-the-art eigensolvers and SVD solvers ◮ Spectral transformations

  5. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation What Users Need Provided by PETSc ◮ Abstraction of mathematical objects: vectors and matrices ◮ Efficient linear solvers (direct or iterative) ◮ Easy programming interface ◮ Run-time flexibility, full control over the solution process ◮ Parallel computing, mostly transparent to the user Provided by SLEPc ◮ State-of-the-art eigensolvers and SVD solvers ◮ Spectral transformations

  6. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Summary PETSc : Portable, Extensible Toolkit for Scientific Computation Software for the scalable (parallel) solution of algebraic systems arising from partial differential equation (PDE) simulations ◮ Developed at Argonne National Lab since 1991 ◮ Usable from C, C++, Fortran77/90 ◮ Focus on abstraction, portability, interoperability ◮ Extensive documentation and examples ◮ Freely available and supported through email Current version: 2.3.3 (released May 2007) http://www.mcs.anl.gov/petsc

  7. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Summary SLEPc : Scalable Library for Eigenvalue Problem Computations A general library for solving large-scale sparse eigenproblems on parallel computers ◮ For standard and generalized eigenproblems ◮ For real and complex arithmetic ◮ For Hermitian or non-Hermitian problems Current version: 2.3.3 (released June 2007) http://www.grycap.upv.es/slepc

  8. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation PETSc/SLEPc Numerical Components PETSc Nonlinear Systems Time Steppers Trust Pseudo Line Backward Other Euler Other Region Time Step Search Euler Krylov Subspace Methods GMRES CG CGS Bi-CGStab TFQMR Richardson Chebychev Other Preconditioners Additive Block Jacobi ILU ICC LU Other Schwarz Jacobi Matrices Compressed Block Compressed Block Dense Other Sparse Row Sparse Row Diagonal Index Sets Vectors Indices Block Indices Stride Other

  9. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation PETSc/SLEPc Numerical Components PETSc SLEPc Nonlinear Systems Time Steppers SVD Solvers Trust Pseudo Line Backward Cross Matrix Lanczos Thick Res. Cyclic Other Euler Other Region Time Step Search Euler Product Lanczos Krylov Subspace Methods Eigensolvers GMRES CG CGS Bi-CGStab TFQMR Richardson Chebychev Other Krylov-Schur Arnoldi Lanczos Other Preconditioners Spectral Transform Additive Block Jacobi ILU ICC LU Other Shift Shift-and-invert Cayley Fold Schwarz Jacobi Matrices Compressed Block Compressed Block Dense Other Sparse Row Sparse Row Diagonal Index Sets Vectors Indices Block Indices Stride Other

  10. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Singular Value Decomposition (SVD) A = U Σ V ∗ where ◮ A is an m × n rectangular matrix ◮ U = [ u 1 , u 2 , . . . , u m ] is a m × m unitary matrix ◮ V = [ v 1 , v 2 , . . . , v n ] is a n × n unitary matrix ◮ Σ is a m × n diagonal matrix with entries Σ ii = σ i ◮ σ 1 ≥ σ 2 ≥ · · · ≥ σ n ≥ 0 ◮ If A is real, U and V are real and orthogonal ◮ Each ( σ i , u i , v i ) is called a singular triplet

  11. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Thin SVD V ∗ n = U n Σ n A In SLEPc we compute a partial SVD, that is, only a subset of the singular triplets

  12. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation SVD Solvers Based on EPS Cross product matrix A ∗ Ax = λx AA ∗ y = λy The eigenvalues are λ i = σ 2 i and the eigenvectors x i = v i or y i = u i

  13. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation SVD Solvers Based on EPS Cross product matrix A ∗ Ax = λx AA ∗ y = λy The eigenvalues are λ i = σ 2 i and the eigenvectors x i = v i or y i = u i Cyclic matrix � 0 � A H ( A ) x = λx H ( A ) = A ∗ 0 � ± u i � 1 The eigenvalues are ± σ i and the eigenvectors √ v i 2

  14. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Basic Usage Usual steps for solving an SVD problem with SLEPc: 1. Create an SVD object 2. Define the SVD problem 3. (Optionally) Specify options for the solution 4. Run the SVD solver 5. Retrieve the computed solution 6. Destroy the SVD object All these operations are done via a generic interface, common to all the SVD solvers

  15. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Simple Example SVD svd; /* singular value solver context */ Mat A; /* matrix */ Vec u, v; /* singular vectors */ PetscReal sigma; /* singular value */

  16. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Simple Example SVD svd; /* singular value solver context */ Mat A; /* matrix */ Vec u, v; /* singular vectors */ PetscReal sigma; /* singular value */ SVDCreate(PETSC_COMM_WORLD, &svd); SVDSetOperator(svd, A); SVDSetFromOptions(svd);

  17. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Simple Example SVD svd; /* singular value solver context */ Mat A; /* matrix */ Vec u, v; /* singular vectors */ PetscReal sigma; /* singular value */ SVDCreate(PETSC_COMM_WORLD, &svd); SVDSetOperator(svd, A); SVDSetFromOptions(svd); SVDSolve(svd);

  18. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Simple Example SVD svd; /* singular value solver context */ Mat A; /* matrix */ Vec u, v; /* singular vectors */ PetscReal sigma; /* singular value */ SVDCreate(PETSC_COMM_WORLD, &svd); SVDSetOperator(svd, A); SVDSetFromOptions(svd); SVDSolve(svd); SVDGetConverged(svd, &nconv); for (i=0; i<nconv; i++) { SVDGetSingularTriplet(svd, i, &sigma, u, v); }

  19. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Simple Example SVD svd; /* singular value solver context */ Mat A; /* matrix */ Vec u, v; /* singular vectors */ PetscReal sigma; /* singular value */ SVDCreate(PETSC_COMM_WORLD, &svd); SVDSetOperator(svd, A); SVDSetFromOptions(svd); SVDSolve(svd); SVDGetConverged(svd, &nconv); for (i=0; i<nconv; i++) { SVDGetSingularTriplet(svd, i, &sigma, u, v); } SVDDestroy(svd);

  20. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Run-Time Examples % program -svd_type lanczos -svd_tol 1e-12 -svd_max_it 200 % program -svd_type trlanczos -svd_nsv 4 % program -svd_type cross -svd_eps_type krylovschur -svd_ncv 30 -svd_smallest -svd_monitor_draw % program -svd_type cyclic -svd_eps_type arpack -svd_st_type sinvert -svd_st_shift 1 % mpirun -np 16 program ...

  21. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Restarted Lanczos Bidiagonalization

  22. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Bidiagonalization Compute the SVD in two stages [Golub and Kahan, 1965]: Q ∗ 1. A = PBQ ∗ = A P B 2. B = X Σ Y ∗ , with U = PX and V = QY

  23. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Bidiagonalization Compute the SVD in two stages [Golub and Kahan, 1965]: Q ∗ 1. A = PBQ ∗ = A P B 2. B = X Σ Y ∗ , with U = PX and V = QY Lanczos bidiagonalization computes part of the info: P k , B k , Q k → Ritz approximations: ˜ σ i , u i = P k x i , ˜ ˜ v i = Q k y i

  24. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Lanczos Bidiagonalization Equating the first k columns AQ k = P k B k A ∗ P k = Q k B ∗ k + β k q k +1 e ∗ k   α 1 β 1 α 2 β 2     α 3 β 3 α j = p ∗ j Aq j   B k =   ... ... β j = p ∗ j Aq j +1       α k − 1 β k − 1   α k Double recursion: α j p j = Aq j − β j − 1 p j − 1 , β j q j +1 = A ∗ p j − α j q j

  25. Overview of SLEPc Restarted Lanczos Bidiagonalization Evaluation Golub-Kahan-Lanczos Bidiagonalization Golub-Kahan-Lanczos algorithm Choose a unit-norm vector q 1 Set β 0 = 0 For j = 1 , 2 , . . . , k p j = Aq j − β j − 1 p j − 1 α j = � p j � 2 p j = p j /α j q j +1 = A ∗ p j − α j q j β j = � q j +1 � 2 q j +1 = q j +1 /β j end Loss of orthogonality is an issue

Recommend


More recommend