Table of Contents

Enum SparseFormat

Namespace
AiDotNet.ModelCompression
Assembly
AiDotNet.dll

Sparse storage formats.

public enum SparseFormat

Fields

BSR = 3

Block Sparse Row (BSR) - like CSR but with dense blocks. Best for: Structured sparsity patterns.

COO = 0

Coordinate format (COO) - stores (row, col, value) triplets. Best for: Construction and incremental updates.

CSC = 2

Compressed Sparse Column (CSC) - column pointers + row indices + values. Best for: Column-wise operations.

CSR = 1

Compressed Sparse Row (CSR) - row pointers + column indices + values. Best for: Row-wise operations, matrix-vector multiplication.

DIA = 6

Diagonal format - for diagonal or banded matrices. Best for: Diagonal-dominant weight matrices.

ELL = 7

ELLPACK format - fixed number of non-zeros per row. Best for: Regular sparsity patterns, GPU acceleration.

Structured2to4 = 4

2:4 Structured Sparsity - 2 zeros per 4 elements (NVIDIA Ampere compatible). Best for: GPU acceleration with Sparse Tensor Cores (2x throughput).

StructuredNtoM = 5

N:M Fine-grained structured sparsity (generalized). Best for: Hardware-accelerated inference with customizable sparsity.