Performance Optimizations and Bounds for Sparse Matrix-Vector Multiply
Authors:
- J.W. DemmelJDJ.W. Demmel
- K.A. YelickKYK.A. Yelick
- S. KamilSKS. Kamil
- R. NishtalaRNR. Nishtala
- B. LeeBLB. Lee
- 1 January 2002
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- No. 10639535,p. 26
Abstract
We consider performance tuning, by code and data structure reorganization, of sparse matrix-vector multiply (SpM×V), one of the most important computational kernels in scientific applications. This paper addresses the fundamental questions of what limits exist on such performance tuning, and how closely tuned code approaches these limits. Specifically, we develop upper and lower bounds on the performance (Mflop/s) of SpM×V when tuned using our previously proposed register blocking optimization. These bounds are based on the non-zero pattern in the matrix and the cost of basic memory operations, such as cache hits and misses. We evaluate our tuned implementations with respect to these bounds using hardware counter data on 4 different platforms and on test set of 44 sparse matrices. We find that we can often get within 20% of the upper bound, particularly on class of matrices from finite element modeling (FEM) problems; on non-FEM matrices, performance improvements of 2× are still possible. Lastly, we present new heuristic that selects optimal or near-optimal register block sizes (the key tuning parameters) more accurately than our previous heuristic. Using the new heuristic, we show improvements in SpM×V performance (Mflop/s) by as much as 2.5× over an untuned implementation. Collectively, our results suggest that future performance improvements, beyond those that we have already demonstrated for SpM×V, will come from two sources: (1) consideration of higher-level matrix structures (e.g. exploiting symmetry, matrix reordering, multiple register block sizes), and (2) optimizing kernels with more opportunity for data reuse (e.g. sparse matrix-multiple vector multiply, multiplication of AT A by a vector).Keywords
This publication has 13 references indexed in Scilit:
- Compiler blockability of numerical algorithms2003
- MEMORY HIERARCHY PERFORMANCE PREDICTION FOR BLOCKED SPARSE ALGORITHMSParallel Processing Letters, 1999
- Cache miss equationsACM Transactions on Programming Languages and Systems, 1999
- Automatic Nonzero Structure AnalysisSIAM Journal on Computing, 1999
- Automatically Tuned Linear Algebra Software1998
- Matrix Market: a web resource for test matrix collections1997
- Optimizing matrix multiply using PHiPAC1997
- Improving data locality with loop transformationsACM Transactions on Programming Languages and Systems, 1996
- Block algorithms for sparse matrix computations on high performance workstations1996
- A data locality optimizing algorithm1991