Simplify Sparse Deep Learning with Universal Sparse Tensor in nvmath-python

AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.

Why it matters

PyTorch researchers can now run linear layers on novel sparse weight formats without rewriting model code, with large speedups possible on pruned networks.

Read this as

NVIDIA's nvmath-python, a Python library for fast math on GPUs, added a feature called the Universal Sparse Tensor in version 0.9.0. Sparse tensors store only nonzero values, saving memory when a matrix is mostly empty, such as a neural network after pruning. The new format separates how sparsity is described from how data is laid out, and converts between formats like COO and CSR without copying data. Speedups of 1.1x to 444x were reported over existing tools on one benchmark matrix.

NVIDIA's nvmath-python v0.9.0 lets teams compress mostly-empty weight matrices in deep learning models without restructuring code or rewriting kernels. Benchmarks show up to 444x faster sparse matrix multiplication than CuPy's or PyTorch's native sparse paths on one Matrix Market matrix. The gains depend heavily on sparsity level and format: CSR matched cuSPARSE, and the benefit is largest for DIA and custom formats. Teams using pruned or heavily sparse models gain most; dense workloads see nothing.

Universal Sparse Tensor in nvmath-python v0.9.0 decouples sparsity from memory layout via a runtime DSL (e.g. '(i, j) -> (j: dense, i: compressed)' for CSC), with zero-copy conversion to and from PyTorch, SciPy, CuPy and NumPy across COO, CSR, CSC, BSR, BSC and DIA. Polymorphic matmul() and solve() dispatch to optimized kernels for standard formats or JIT-generate code for custom ones, with planning-phase caching. A torch.Tensor subclass enables UST injection and weight reformatting in linear layers. On the 1,489,752x1,489,752 atmosmodl matrix, UST SpMV ran 1.1x to 444x faster than CuPy and PyTorch; MACKO UST matched or beat the original MACKO CUDA kernel.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

nvmath-python Universal Sparse Tensor PyTorch SciPy CuPy Matrix Market MACKO

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading