
# cuLA — CUDA Linear Attention
**High-performance CUDA kernels for linear attention variants, written entirely in [CuTe DSL](https://github.com/NVIDIA/cutlass/tree/main/python/CuTeDSL).**
## Introduction
Linear attention mechanisms reformulate standard attention to use linear-time state updates instead of quadratic pairwise interactions, making them well suited for long-context LLM workloads. Recent variants such as [GLA](https://arxiv.org/abs/2312.06635), [KDA](http://arxiv.org/abs/2510.26692), [GDN](https://arxiv.org/abs/2412.06464), and [Lightning Attention](https://arxiv.org/abs/2405.17381) further improve expressiveness with gating, delta-style updates, and chunkwise decomposition.
**cuLA** provides hand-tuned CuTeDSL implementations of these linear attention variants, targeting NVIDIA Blackwell (SM10X) and Hopper (SM90) GPUs. The runtime is a standalone kernel library: it does not import or vendor FLA, Triton, or a C++/CUDA extension. Complete operators and deliberately exposed atomic kernels are available through `cula.kernels`.
> **⚠️ Early Stage:** cuLA is in its early development phase. Many kernels still have significant room for optimization, and the API may evolve. We warmly welcome contributions from the community — whether it's performance tuning, new algorithm support, bug fixes, or architectural improvements. Every contribution helps push the boundaries of linear attention on modern GPUs!
## Installation
cuLA supports both **Hopper (SM90)** and **Blackwell (SM10X)** GPUs.
> **Requirements (Hopper & Blackwell):** Python 3.12+, CUDA Toolkit 12.9+, PyTorch 2.8.0+, and a matching `nvidia-cutlass-dsl` installation. cuLA does not build a C++/CUDA extension.
> **Note:** The PyTorch CUDA version must match your system CUDA Toolkit version. Check with `nvcc --version` and `python -c "import torch; print(torch.version.cuda)"`.
### Pre-built Wheels
Platform-independent wheels containing the CuTeDSL sources are available on [GitHub Releases](https://github.com/inclusionAI/cuLA/releases):
pip install "cuda-linear-attention==