Enum SparseFormat
- Namespace
- AiDotNet.ModelCompression
- Assembly
- AiDotNet.dll
Sparse storage formats.
public enum SparseFormat
Fields
BSR = 3Block Sparse Row (BSR) - like CSR but with dense blocks. Best for: Structured sparsity patterns.
COO = 0Coordinate format (COO) - stores (row, col, value) triplets. Best for: Construction and incremental updates.
CSC = 2Compressed Sparse Column (CSC) - column pointers + row indices + values. Best for: Column-wise operations.
CSR = 1Compressed Sparse Row (CSR) - row pointers + column indices + values. Best for: Row-wise operations, matrix-vector multiplication.
DIA = 6Diagonal format - for diagonal or banded matrices. Best for: Diagonal-dominant weight matrices.
ELL = 7ELLPACK format - fixed number of non-zeros per row. Best for: Regular sparsity patterns, GPU acceleration.
Structured2to4 = 42:4 Structured Sparsity - 2 zeros per 4 elements (NVIDIA Ampere compatible). Best for: GPU acceleration with Sparse Tensor Cores (2x throughput).
StructuredNtoM = 5N:M Fine-grained structured sparsity (generalized). Best for: Hardware-accelerated inference with customizable sparsity.