# rusty1s/pytorch_sparse

PyTorch Extension Library of Optimized Autograd Sparse Matrix Operations

Repository: https://github.com/rusty1s/pytorch_sparse
Canonical: https://ross.abutalabs.com/products/pytorch_sparse
Language: Python
License: MIT
License Family: permissive
Topics: pytorch, sparse, sparse-matrices, autograd
Last push: 2026-06-03T04:07:55+00:00

## Health v2 (maintenance only)
Score: 61/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 85, release rhythm 8, longevity 100
- inputs: {"age_days": 2958, "days_push": 91, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1104, forks 162 (observed 2026-08-28T04:03:36.257100+00:00)

## What it is
A PyTorch extension library providing optimized sparse matrix operations (coalesce, transpose, sparse-dense and sparse-sparse multiplication) with autograd support. Operations work on CPU and GPU across varying data types and use index/value tensors instead of torch.sparse_coo_tensor.

## Use cases
- multiply sparse and dense matrices in pytorch with gradients
- speed up sparse matrix ops on gpu for gnn training
- transpose large sparse tensors efficiently
- coalesce sparse tensor indices and values
- avoid building torch.sparse_coo_tensor manually
- sparse matrix multiplication with autograd support

## When to choose
- you need differentiable sparse matrix operations in PyTorch on CPU or GPU
- you are building graph neural networks with PyTorch Geometric
- you want optimized CUDA kernels for sparse-dense and sparse-sparse matmul

## When to avoid
- you only need basic sparse tensors already covered by native torch.sparse
- you work outside the PyTorch ecosystem (e.g. TensorFlow, JAX, SciPy)
- you need sparse operations on indices with gradients, since index tensors are not differentiable

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, gpu-computing, math
- domain: machine-learning, deep-learning
- platform: python, windows
- tags: pytorch, sparse-matrices, autograd, cuda, extension-library, graph-neural-networks, algorithms, linux, macos, gpu

## Member repositories
- rusty1s/pytorch_sparse (main) score 61

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:36.257100+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:45:29.451149+00:00, confidence not recorded.
  - readme: https://github.com/rusty1s/pytorch_sparse (fetched 2026-08-28T04:03:36.257100+00:00, sha d899a5f60cf0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
