spmv

youtube

【HURRICANE】Crenny - South Park
“We said, no more war, no more clothes, give me peace… oh, kiss me.”

____________________CREDITS:

SHIP: Crenny McTucker (Kenny McCormick x Craig Tucker)

EDITOR: rosaci / xXRosaciXx

MUSIC: Hurricane by Panic! at the Disco

ART USED IN THIS VIDEO ARE BY:

preoprix, sujk0823, runmonsterrun, yardale, delija. purplereed. xNowherex, 毒, eda1102-sketches, Shiftly (I might be missing some users! If you see your art here, and it’s not on the list, please notify, and I’m really sorry!)
_____________________________

Review: Computational Study of Sparse Matrix Storage Schemes

This dissertation is by Sardar Ansul Haque, University of Lethbridge, Alberta, Canada. 

I’ll be doing this review in stages as I go through the dissertation in parts during the next few days. The review will contain content from the dissertation as well as some of my own input.

The SpMV problem is solving Ax=y; where A is a matrix that is mostly zeros and x is a dense vector. This kernel displays irregular vector writes but regular matrix reads and regular vector (y) writes. The problem is natural memory bound and providing intuition into data reuse is hard particularly when the sparsity is unknown prior to run time. This irregular access leads to a large number of cache misses. This is intensified when the matrix and vector do not fit inside of cache. Several machine learning algorithms, PDEs, mesh calculations, and several computational problems utilize sparse structures where sparsity structure is not really known until during runtime. (Hint hint: we need better Top500 benchmarks ;) )

Most data structures for storing sparse matrices use array-based data structures to introduce some sort of regularity into the data access patterns. Most commonly, column indices and row indices of every non zero element are stored into arrays leading to a form of compressed storage. Compressed Row Storage and Compressed Column Storage are some of the popular storage formats. The whole point of these different storages is to regularize data access and ensure either Spatial or Temporal Locality. Spatial locality of A is reordering A such that the nonzeros in each row are consecutive. This improves the regularity of accessing A. Temporal locality says that the data (parts of the vector) recently used will be used again by A.

In the next posts I will review different storage techniques as presented in the thesis and also go through the MatMult algorithm for each storage technique. Later posts will be on columns reordering algorithms (something I myself am rather new to :) ).