-
Performance of linear solvers in tensor-train format on current multicore architectures
Authors:
Melven Röhrig-Zöllner,
Manuel Joey Becklas,
Jonas Thies,
Achim Basermann
Abstract:
Tensor networks are a class of algorithms aimed at reducing the computational complexity of high-dimensional problems. They are used in an increasing number of applications, from quantum simulations to machine learning. Exploiting data parallelism in these algorithms is key to using modern hardware. However, there are several ways to map required tensor operations onto linear algebra routines ("bu…
▽ More
Tensor networks are a class of algorithms aimed at reducing the computational complexity of high-dimensional problems. They are used in an increasing number of applications, from quantum simulations to machine learning. Exploiting data parallelism in these algorithms is key to using modern hardware. However, there are several ways to map required tensor operations onto linear algebra routines ("building blocks"). Optimizing this mapping impacts the numerical behavior, so computational and numerical aspects must be considered hand-in-hand. In this paper we discuss the performance of solvers for low-rank linear systems in the tensor-train format (also known as matrix-product states). We consider three popular algorithms: TT-GMRES, MALS, and AMEn. We illustrate their computational complexity based on the example of discretizing a simple high-dimensional PDE in, e.g., $50^{10}$ grid points. This shows that the projection to smaller sub-problems for MALS and AMEn reduces the number of floating-point operations by orders of magnitude. We suggest optimizations regarding orthogonalization steps, singular value decompositions, and tensor contractions. In addition, we propose a generic preconditioner based on a TT-rank-1 approximation of the linear operator. Overall, we obtain roughly a 5x speedup over the reference algorithm for the fastest method (AMEn) on a current multicore CPU.
△ Less
Submitted 24 October, 2024; v1 submitted 13 December, 2023;
originally announced December 2023.
-
Algebraic Temporal Blocking for Sparse Iterative Solvers on Multi-Core CPUs
Authors:
Christie Alappat,
Jonas Thies,
Georg Hager,
Holger Fehske,
Gerhard Wellein
Abstract:
Sparse linear iterative solvers are essential for many large-scale simulations. Much of the runtime of these solvers is often spent in the implicit evaluation of matrix polynomials via a sequence of sparse matrix-vector products. A variety of approaches has been proposed to make these polynomial evaluations explicit (i.e., fix the coefficients), e.g., polynomial preconditioners or s-step Krylov me…
▽ More
Sparse linear iterative solvers are essential for many large-scale simulations. Much of the runtime of these solvers is often spent in the implicit evaluation of matrix polynomials via a sequence of sparse matrix-vector products. A variety of approaches has been proposed to make these polynomial evaluations explicit (i.e., fix the coefficients), e.g., polynomial preconditioners or s-step Krylov methods. Furthermore, it is nowadays a popular practice to approximate triangular solves by a matrix polynomial to increase parallelism. Such algorithms allow to evaluate the polynomial using a so-called matrix power kernel (MPK), which computes the product between a power of a sparse matrix A and a dense vector x, or a related operation. Recently we have shown that using the level-based formulation of sparse matrix-vector multiplications in the Recursive Algebraic Coloring Engine (RACE) framework we can perform temporal cache blocking of MPK to increase its performance. In this work, we demonstrate the application of this cache-blocking optimization in sparse iterative solvers.
By integrating the RACE library into the Trilinos framework, we demonstrate the speedups achieved in preconditioned) s-step GMRES, polynomial preconditioners, and algebraic multigrid (AMG). For MPK-dominated algorithms we achieve speedups of up to 3x on modern multi-core compute nodes. For algorithms with moderate contributions from subspace orthogonalization, the gain reduces significantly, which is often caused by the insufficient quality of the orthogonalization routines. Finally, we showcase the application of RACE-accelerated solvers in a real-world wind turbine simulation (Nalu-Wind) and highlight the new opportunities and perspectives opened up by RACE as a cache-blocking technique for MPK-enabled sparse solvers.
△ Less
Submitted 5 September, 2023;
originally announced September 2023.
-
Performance of the low-rank tensor-train SVD (TT-SVD) for large dense tensors on modern multi-core CPUs
Authors:
Melven Röhrig-Zöllner,
Jonas Thies,
Achim Basermann
Abstract:
There are several factorizations of multi-dimensional tensors into lower-dimensional components, known as `tensor networks'. We consider the popular `tensor-train' (TT) format and ask: How efficiently can we compute a low-rank approximation from a full tensor on current multi-core CPUs?
Compared to sparse and dense linear algebra, kernel libraries for multi-linear algebra are rare and typically…
▽ More
There are several factorizations of multi-dimensional tensors into lower-dimensional components, known as `tensor networks'. We consider the popular `tensor-train' (TT) format and ask: How efficiently can we compute a low-rank approximation from a full tensor on current multi-core CPUs?
Compared to sparse and dense linear algebra, kernel libraries for multi-linear algebra are rare and typically not as well optimized. Linear algebra libraries like BLAS and LAPACK may provide the required operations in principle, but often at the cost of additional data movements for rearranging memory layouts. Furthermore, these libraries are typically optimized for the compute-bound case (e.g.\ square matrix operations) whereas low-rank tensor decompositions lead to memory bandwidth limited operations.
We propose a `tensor-train singular value decomposition' (TT-SVD) algorithm based on two building blocks: a `Q-less tall-skinny QR' factorization, and a fused tall-skinny matrix-matrix multiplication and reshape operation. We analyze the performance of the resulting TT-SVD algorithm using the Roofline performance model. In addition, we present performance results for different algorithmic variants for shared-memory as well as distributed-memory architectures. Our experiments show that commonly used TT-SVD implementations suffer severe performance penalties. We conclude that a dedicated library for tensor factorization kernels would benefit the community: Computing a low-rank approximation can be as cheap as reading the data twice from main memory. As a consequence, an implementation that achieves realistic performance will move the limit at which one has to resort to randomized methods that only process part of the data.
△ Less
Submitted 2 March, 2022; v1 submitted 29 January, 2021;
originally announced February 2021.
-
A staggered-grid multilevel incomplete LU for steady incompressible flows
Authors:
Sven Baars,
Mark van der Klok,
Jonas Thies,
Fred W. Wubs
Abstract:
Algorithms for studying transitions and instabilities in incompressible flows typically require the solution of linear systems with the full Jacobian matrix. Other popular approaches, like gradient-based design optimization and fully implicit time integration, also require very robust solvers for this type of linear system. We present a parallel fully coupled multilevel incomplete factorization pr…
▽ More
Algorithms for studying transitions and instabilities in incompressible flows typically require the solution of linear systems with the full Jacobian matrix. Other popular approaches, like gradient-based design optimization and fully implicit time integration, also require very robust solvers for this type of linear system. We present a parallel fully coupled multilevel incomplete factorization preconditioner for the 3D stationary incompressible Navier-Stokes equations on a structured grid. The algorithm and software are based on the robust two-level method developed by Wubs and Thies. In this paper, we identify some of the weak spots of the two-level scheme and propose remedies such as a different domain partitioning and recursive application of the method. We apply the method to the well-known 3D lid-driven cavity benchmark problem, and demonstrate its superior robustness by comparing with a segregated SIMPLE-type preconditioner.
△ Less
Submitted 11 November, 2020;
originally announced November 2020.
-
A robust two-level incomplete factorization for (Navier-)Stokes saddle point matrices
Authors:
Fred Wubs,
Jonas Thies
Abstract:
We present a new hybrid direct/iterative approach to the solution of a special class of saddle point matrices arising from the discretization of the steady incompressible Navier-Stokes equations on an Arakawa C-grid. The two-level method introduced here has the following properties: (i) it is very robust, even close to the point where the solution becomes unstable; (ii) a single parameter controls…
▽ More
We present a new hybrid direct/iterative approach to the solution of a special class of saddle point matrices arising from the discretization of the steady incompressible Navier-Stokes equations on an Arakawa C-grid. The two-level method introduced here has the following properties: (i) it is very robust, even close to the point where the solution becomes unstable; (ii) a single parameter controls fill and convergence, making the method straightforward to use; (iii) the convergence rate is independent of the number of unknowns; (iv) it can be implemented on distributed memory machines in a natural way; (v) the matrix on the second level has the same structure and numerical properties as the original problem, so the method can be applied recursively; (vi) the iteration takes place in the divergence- free space, so the method qualifies as a 'constraint preconditioner'; (vii) the approach can also be applied to Poisson problems.
This work is also relevant for problems in which similar saddle point matrices occur, for instance when simulating electrical networks, where one has to satisfy Kirchhoff's conservation law for currents.
△ Less
Submitted 9 June, 2010;
originally announced June 2010.