Masked Matrix Multiplication for Emergent Sparsity

Brian Wheatman, Meghana Madhyastha, Randal Burns
2/21/2024
cs.DScs.AI

No confident code implementation found for this paper.

Abstract

Artificial intelligence workloads, especially transformer models, exhibit emergent sparsity in which computations perform selective sparse access to dense data. The workloads are inefficient on hardware designed for dense computations and do not map well onto sparse data representations.

Show full abstract

We build a vectorized and parallel matrix-multiplication system A X B = C that eliminates unnecessary computations and avoids branches based on a runtime evaluation of sparsity. We use a combination of dynamic code lookup to adapt to the specific sparsity encoded in the B matrix and preprocessing of sparsity maps of the A and B matrices to compute conditional branches once for the whole computation. For a wide range of sparsity, from 60% to 95% zeros, our implementation performs fewer instructions and increases performance when compared with Intel MKL's dense or sparse matrix multiply routines. Benefits can be as large as 2 times speedup and 4 times fewer instructions.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wheatman2024masked,
  title  = {Masked Matrix Multiplication for Emergent Sparsity},
  author = {Brian Wheatman and Meghana Madhyastha and Randal Burns},
  year   = {2024},
  eprint = {2402.14118},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.14118v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.14118.svg)](https://codeofpaper.com/paper/2402.14118)

Discussion