# tspeterkim/flash-attention-minimal

Flash Attention in ~100 lines of CUDA (forward pass only)

Repository: https://github.com/tspeterkim/flash-attention-minimal
Canonical: https://ross.abutalabs.com/products/flash-attention-minimal
Language: Cuda
License: Apache-2.0
License Family: permissive
Last push: 2024-12-30T04:17:28+00:00

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

## Adoption (not part of the score)
Stars 1179, forks 115 (observed 2026-08-28T04:03:53.255338+00:00)

## What it is
A minimal ~100-line CUDA re-implementation of the Flash Attention forward pass, loadable as a PyTorch extension. It is designed as an educational resource for CUDA beginners, following the notation of the original Flash Attention paper.

## Use cases
- learn how flash attention works in CUDA
- understand shared memory tiling for attention
- benchmark flash attention vs manual attention
- study a minimal CUDA kernel for transformer attention
- starting point for writing custom attention kernels

## When to choose
- you want to learn how Flash Attention is implemented in CUDA
- you need a small readable reference implementation of the attention forward pass
- you are teaching or studying GPU kernel design for transformers

## When to avoid
- you need a backward pass for training
- you need production performance or float16/tensor core support
- you need long sequence attention at scale
- you want a maintained, feature-complete attention library

## Facets
- artifact type: library
- maturity: experimental
- function: machine-learning, deep-learning, gpu-computing
- domain: deep-learning, large-language-models, gpu-computing, developer-tools
- platform: python
- tags: flash-attention, cuda-kernel, educational, pytorch-extension, transformer-attention, cuda, gpu, linux

## Member repositories
- tspeterkim/flash-attention-minimal (main) score 25

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:53.255338+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:26:04.283681+00:00, confidence not recorded.
  - readme: https://github.com/tspeterkim/flash-attention-minimal (fetched 2026-08-28T04:03:53.255338+00:00, sha 9abd545cbe21)
- Data as of 2026-08-30T08:39:29.467469+00:00.
