# openai/sparse_attention

Examples of using sparse attention, as in "Generating Long Sequences with Sparse Transformers"

Repository: https://github.com/openai/sparse_attention
Canonical: https://ross.abutalabs.com/products/sparse_attention
Language: Python
License Family: other
Archived: true
Last push: 2020-08-12T16:54:02+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2700, "days_push": 2212, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1613, forks 192 (observed 2026-08-28T04:05:11.174964+00:00)

## What it is
A Python library of sparse attention primitives from OpenAI's Sparse Transformers paper, including fused normal attention and strided/fixed block-sparse attention kernels built on the blocksparse package. It also provides a recompute decorator for memory-efficient attention.

## Use cases
- implement sparse transformers for long sequences
- speed up attention computation on GPUs
- use strided and fixed attention patterns
- reduce memory usage in transformer training with recomputation
- experiment with block-sparse attention kernels
- model long documents or sequences efficiently

## When to choose
- you need block-sparse attention kernels matching the Sparse Transformers paper
- you work with TensorFlow and NVIDIA GPUs including Tensor Cores
- you want reference implementations of strided and fixed attention

## When to avoid
- you need maintained or updated code - the repository is archived
- you use PyTorch rather than TensorFlow
- you lack an NVIDIA GPU with the required compute capability
- you want modern efficient attention like FlashAttention

## Facets
- artifact type: library
- maturity: abandoned
- function: machine-learning, deep-learning, gpu-computing
- domain: deep-learning, large-language-models, gpu-computing
- platform: python
- tags: sparse-attention, transformers, cuda-kernels, blocksparse, archived, gpu, linux

## Member repositories
- openai/sparse_attention (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:11.174964+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-30T03:51:07.426750+00:00, confidence not recorded.
  - readme: https://github.com/openai/sparse_attention (fetched 2026-08-28T04:05:11.174964+00:00, sha 5cd18d399865)
- Data as of 2026-08-30T08:39:29.467469+00:00.
