Skip to content

[Feature Request] Introduce T.gemm_sp for 2:4 Sparse Tensor Core GEMM #273

@LeiWang1999

Description

@LeiWang1999

Background:

Sparse matrix operations have become an essential part of optimizing deep learning models, especially when dealing with large-scale data and sparse neural networks. Current hardware accelerators, such as Tensor Cores, offer significant performance improvements for dense matrix operations but lack full optimization for sparse matrix operations.

The Tensor Cores have already been optimized for dense matrix-multiplication (GEMM) workloads, providing substantial speedups. However, there is still room for improvement in efficiently handling sparse matrices on Tensor Cores, particularly with specific sparsity patterns such as 2:4 sparse format.

The 2:4 sparsity pattern, in which two consecutive elements of a matrix are non-zero, offers a common and highly efficient structure for many deep learning operations, including convolutions and dense layers. However, Tensor Core GEMM operations currently do not natively support this sparsity pattern, which limits performance for sparse workloads.

Request:

To better utilize Tensor Cores for sparse matrix operations, we propose introducing T.gemm_sp, a specialized function designed for 2:4 Sparse Tensor Core GEMM operations. This would optimize matrix multiplication for matrices that follow a 2:4 sparse pattern, leveraging the hardware’s efficiency in handling sparsity.

  • T.gemm_sp(A, B, C) should be defined to perform a GEMM operation between matrices A and B and store the result in matrix C.
  • A and B should be sparse tensors represented in a 2:4 sparsity format.
  • The implementation should ensure that non-zero values are efficiently processed using Tensor Core hardware, while zero values are skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions