Improving Locality in Sparse and Dense Matrix Multiplications

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Dezfuli, Mohammad Mahdi Salehi, Cheshmi, Kazem
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866929403930345472
author Dezfuli, Mohammad Mahdi Salehi
Cheshmi, Kazem
author_facet Dezfuli, Mohammad Mahdi Salehi
Cheshmi, Kazem
contents Consecutive matrix multiplications are commonly used in graph neural networks and sparse linear solvers. These operations frequently access the same matrices for both reading and writing. While reusing these matrices improves data locality, it presents a challenge due to the irregular dependencies between iterations across the two multiplication operations. Existing fusion methods often introduce excessive synchronization overhead or overlapped computations with limited benefits. This paper proposes tile fusion, a runtime approach that fuses tiles of the two matrix-matrix multiplications, where at least one of the involved matrices is sparse. Tile fusion aims to improve data locality while providing sufficient workload for cores in shared-memory multi-core processors. For a pair of matrix-matrix multiplications, tile fusion outperforms unfused baseline and MKL implementations with a geometric mean speedup of 1.97$\times$ 1.64$\times$, respectively, on multi-core CPUs.
format Preprint
id arxiv_https___arxiv_org_abs_2407_00243
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Improving Locality in Sparse and Dense Matrix Multiplications
Dezfuli, Mohammad Mahdi Salehi
Cheshmi, Kazem
Distributed, Parallel, and Cluster Computing
Consecutive matrix multiplications are commonly used in graph neural networks and sparse linear solvers. These operations frequently access the same matrices for both reading and writing. While reusing these matrices improves data locality, it presents a challenge due to the irregular dependencies between iterations across the two multiplication operations. Existing fusion methods often introduce excessive synchronization overhead or overlapped computations with limited benefits. This paper proposes tile fusion, a runtime approach that fuses tiles of the two matrix-matrix multiplications, where at least one of the involved matrices is sparse. Tile fusion aims to improve data locality while providing sufficient workload for cores in shared-memory multi-core processors. For a pair of matrix-matrix multiplications, tile fusion outperforms unfused baseline and MKL implementations with a geometric mean speedup of 1.97$\times$ 1.64$\times$, respectively, on multi-core CPUs.
title Improving Locality in Sparse and Dense Matrix Multiplications
topic Distributed, Parallel, and Cluster Computing
url https://arxiv.org/abs/2407.00243