L20: Sparse Matrix Algorithms, SIMD review November 15, 2012.

Slides:



Advertisements
Similar presentations
§ 3.4 Matrix Solutions to Linear Systems.
Advertisements

Efficient Sparse Matrix-Matrix Multiplication on Heterogeneous High Performance Systems AACEC 2010 – Heraklion, Crete, Greece Jakob Siegel 1, Oreste Villa.
CSCI 317 Mike Heroux1 Sparse Matrix Computations CSCI 317 Mike Heroux.
Linear Transformations
L15: Review for Midterm. Administrative Project proposals due today at 5PM (hard deadline) – handin cs6963 prop March 31, MIDTERM in class L15: Review.
Sparse Matrix Algorithms CS 524 – High-Performance Computing.
1 Lecture 25: Parallel Algorithms II Topics: matrix, graph, and sort algorithms Tuesday presentations:  Each group: 10 minutes  Describe the problem,
L12: Sparse Linear Algebra on GPUs CS6963. Administrative Issues Next assignment, triangular solve – Due 5PM, Monday, March 8 – handin cs6963 lab 3 ”
Linear Equations in Linear Algebra
1 Matrix Addition, C = A + B Add corresponding elements of each matrix to form elements of result matrix. Given elements of A as a i,j and elements of.
Department of Geography and Urban Studies, Temple University GUS 0265/0465 Applications in GIS/Geographic Data Analysis Lecture 3: Network Data Models.
L11: Sparse Linear Algebra on GPUs CS6963. Administrative Issues Next assignment, triangular solve – Due 5PM, Tuesday, March 15 – handin cs6963 lab 3.
Section 8.1 – Systems of Linear Equations
ME451 Kinematics and Dynamics of Machine Systems Review of Matrix Algebra – 2.2 September 13, 2011 Dan Negrut University of Wisconsin-Madison © Dan Negrut,
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
Upcrc.illinois.edu OpenMP Lab Introduction. Compiling for OpenMP Open project Properties dialog box Select OpenMP Support from C/C++ -> Language.
L11: Sparse Linear Algebra on GPUs CS Sparse Linear Algebra 1 L11: Sparse Linear Algebra CS6235
ECON 1150 Matrix Operations Special Matrices
Little Linear Algebra Contents: Linear vector spaces Matrices Special Matrices Matrix & vector Norms.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Review for Chapter 4 Important Terms, Symbols, Concepts 4.1. Systems of Linear Equations in Two Variables.
L21: “Irregular” Graph Algorithms November 11, 2010.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
Sparse Matrix-Vector Multiplication on Throughput-Oriented Processors
After step 2, processors know who owns the data in their assumed partitions— now the assumed partition defines the rendezvous points Scalable Conceptual.
Matrices. Definitions  A matrix is an m x n array of scalars, arranged conceptually as m rows and n columns.  m is referred to as the row dimension.
L17: Introduction to “Irregular” Algorithms and MPI, cont. November 8, 2011.
L20: Introduction to “Irregular” Algorithms November 9, 2010.
Efficiency and Flexibility of Jagged Arrays Geir Gundersen Department of Informatics University of Bergen Norway Joint work with Trond Steihaug.
09/24/2010CS4961 CS4961 Parallel Programming Lecture 10: Thread Building Blocks Mary Hall September 24,
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA
L19: Putting it together: N-body (Ch. 6) November 22, 2011.
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
Lab 3. Why Compressed Row Storage –A sparse matrix has a lot of elements of value zero. –Using a two dimensional array to store a sparse matrix wastes.
Monte Carlo Linear Algebra Techniques and Their Parallelization Ashok Srinivasan Computer Science Florida State University
1. 2  Introduction  Array Operations  Number of Elements in an array One-dimensional array Two dimensional array Multi-dimensional arrays Representation.
Irregular Applications –Sparse Matrix Vector Multiplication
2.5 – Determinants and Multiplicative Inverses of Matrices.
Chapter 1 Section 1.6 Algebraic Properties of Matrix Operations.
Notes Over 4.2 Finding the Product of Two Matrices Find the product. If it is not defined, state the reason. To multiply matrices, the number of columns.
Do Now: Perform the indicated operation. 1.). Algebra II Elements 11.1: Matrix Operations HW: HW: p.590 (16-36 even, 37, 44, 46)
Large-scale geophysical electromagnetic imaging and modeling on graphical processing units Michael Commer (LBNL) Filipe R. N. C. Maia (LBNL-NERSC) Gregory.
L18: MPI, cont. November 10, Administrative Class cancelled, Tuesday, November 15 Guest Lecture, Thursday, November 17, Ganesh Gopalakrishnan CUDA.
College Algebra Chapter 6 Matrices and Determinants and Applications
MTH108 Business Math I Lecture 20.
Chapter 7: Systems of Equations and Inequalities; Matrices
13.4 Product of Two Matrices
12-1 Organizing Data Using Matrices
Lecture 13 Sparse Matrix-Vector Multiplication and CUDA Libraries
GPU Computing CIS-543 Lecture 10: CUDA Libraries
Lecture 13 Sparse Matrix-Vector Multiplication and CUDA Libraries
Introduction to Matrices
Matrix Operations.
MATHEMATICS Matrix Multiplication
Matrix Operations.
Abstract Data Types Sparse Matrices CSCI 240
Dr. Ameria Eldosoky Discrete mathematics
Reminder: Array Representation In C++
Reminder: Array Representation In C++
2. Matrix Algebra 2.1 Matrix Operations.
CSCE569 Parallel Computing
Chapter 4 Systems of Linear Equations; Matrices
Linear Algebra Lecture 18.
Parallel build blocks.
Solving Linear Systems: Iterative Methods and Sparse Systems
3.5 Perform Basic Matrix Operations
Chapter 4 Systems of Linear Equations; Matrices
© 2012 Elsevier, Inc. All rights reserved.
Matrix Addition, C = A + B Add corresponding elements of each matrix to form elements of result matrix. Given elements of A as ai,j and elements of B as.
Matrix Multiplication Sec. 4.2
Presentation transcript:

L20: Sparse Matrix Algorithms, SIMD review November 15, 2012

Administrative CUDA Project 5, due November 28 (no extension) -Available on CADE Linux machines (lab1 and lab3) and Windows machines (lab5 and lab6) -You can also use your own Nvidia GPUs

Project 5, Due November 28 at 11:59PM The code in sparse_matvec.c is a sequential version of a sparse matrix-vector multiply. The matrix is sparse in that many of its elements are zero. Rather than representing all of these zeros which wastes storage, the code uses a representation called Compressed Row Storage (CRS), which only represents the nonzeros with auxiliary data structures to keep track of their location in the full matrix. I provide: Sparse input matrices which were generated from the MatrixMarket (see Sequential code that includes conversion from coordinate matrix to CRS. An implementation of dense matvec in CUDA. A Makefile for the CADE Linux machines. You write: A CUDA implementation of sparse matvec

Outline Sources for this lecture: -“Implementing Sparse Matrix-Vector Multiplication on Throughput Oriented Processors,” Bell and Garland (Nvidia), SC09, Nov

Sparse Linear Algebra Suppose you are applying matrix-vector multiply and the matrix has lots of zero elements -Computation cost? Space requirements? General sparse matrix representation concepts -Primarily only represent the nonzero data values -Auxiliary data structures describe placement of nonzeros in “dense matrix”

Some common representations [] A = data = * 1 7 * * [] 1 7 * 2 8 * * [] 0 1 * 1 2 * * [] offsets = [-2 0 1] data =indices = ptr = [ ] indices = [ ] data = [ ] row = [ ] indices = [ ] data = [ ] DIA: Store elements along a set of diagonals. Compressed Sparse Row (CSR): Store only nonzero elements, with “ptr” to beginning of each row and “indices” representing column. ELL: Store a set of K elements per row and pad as needed. Best suited when number non-zeros roughly consistent across rows. COO: Store nonzero elements and their corresponding “coordinates”.

Connect to dense linear algebra Equivalent CSR matvec: for (i=0; i<nr; i++) { for (j = ptr[i]; j<ptr[i+1]; j++) t[i] += data[j] * b[indices[j]]; Dense matvec from L18: for (i=0; i<n; i++) { for (j=0; j<n; j++) { a[i] += c[j][i] * b[j]; }