inclusionAI/cuLA

CUDA kernels for linear attention variants, written in CuTe DSL and CUTLASS C++.

What it solves

Linear attention mechanisms are essential for handling long-context LLM workloads efficiently, but standard implementations often struggle to reach peak hardware performance. cuLA provides highly optimized, hand-tuned CUDA kernels that significantly accelerate these attention variants on modern NVIDIA GPUs.

How it works

cuLA uses the CuTe DSL (Domain Specific Language) to write low-level, high-performance CUDA kernels. It is designed as a drop-in performance upgrade for the flash-linear-attention (FLA) library. By replacing standard kernels with cuLA's hand-tuned versions, users can achieve faster computation for algorithms like Lightning Attention and KDA without changing their existing code beyond a simple import statement.

Who it’s for

This library is for developers and researchers working with long-context LLMs who need to maximize performance on NVIDIA Hopper (SM90) or Blackwell (SM10X) hardware. It is specifically useful for those already using the flash-linear-attention ecosystem who want to squeeze more speed out of their training and inference pipelines.

Highlights

  • Provides hand-tuned CUDA kernels for linear attention variants like GLA, KDA, GDN, and Lightning Attention.
  • Delivers significant speedups over existing implementations, with some configurations seeing performance gains up to 7x.
  • Designed for seamless integration with flash-linear-attention via a simple import change.
  • Supports advanced NVIDIA architectures including Hopper (SM90) and Blackwell (SM10X).
  • Built using CuTe DSL for fine-grained control over GPU dataflow and scheduling.

Related

  • Project
  • Project
  • Project
  • Project
  • Project