AIAny
AI Infra2023
Icon for item

Flash Linear Attention

Triton kernels and PyTorch layers for linear-attention, state-space, and sparse-attention token mixers (GLA, RWKV, Mamba2, GSA) as drop-in replacements for multihead attention. Runs on NVIDIA, AMD, and Intel GPUs with Hugging Face support.

Introduction

Most clever efficient-attention ideas die in a research notebook: a neat recurrence that nobody can plug into a real training run. What actually made linear attention usable wasn't new math — it was a chunkwise-parallel, Triton-level implementation fast enough to compete with FlashAttention on wall-clock time. That implementation lives here, and it has quietly become the reference codebase the whole sub-field builds on.

What Sets It Apart
  • One home for a fragmenting field. GLA, RWKV-6/7, Mamba2, GSA, DeltaNet, HGRN2 and more share a single set of fused kernels and nn.Module token mixers, so switching architectures is a config change rather than a rewrite of custom CUDA.
  • The hard kernel is already written. The chunkwise-parallel form — the trick that lets these models train as fast as they infer — is implemented and tuned across NVIDIA, AMD and Intel hardware, not left as an exercise.
  • Hugging Face-native. Models expose standard generate() APIs alongside fused ops (rotary embeddings, RMSNorm, fused cross-entropy), so a linear-attention model slots into an existing training and eval stack instead of forcing a parallel one.
Great Fit / Look Elsewhere

Great fit if you research sub-quadratic sequence models, want to benchmark a new linear / SSM / sparse variant against strong baselines, or need to scale a non-Transformer LLM without hand-writing kernels. Look elsewhere if you want a turnkey chatbot or a frozen, stable API — this is a fast-moving research library where module signatures and kernels shift between releases, and correctness on less common hardware still warrants your own verification.

Information

  • Websitegithub.com
  • OrganizationsMIT CSAIL, Soochow University
  • Authorsfla-org, Songlin Yang, Yu Zhang
  • Published date2023/12/20

Categories

More Items

GitHub
AI Infra2025

Defines a vendor-neutral JSON/YAML semantic model specification and tooling to exchange metrics, dimensions, lineage and other business semantics across analytics, AI and BI platforms; includes a core spec, validators, converters (dbt, GoodData, Salesforce) and example models.

GitHub
AI Train2025

An asynchronous, high-throughput framework for large-scale reinforcement learning and agentic training that scales to 1T+ MoE models and 1000+ GPUs, with native verifiers integration, end-to-end SFT/RL/evals, and Slurm/Kubernetes deployment; requires NVIDIA GPUs.

GitHub

Runs a self-hosted meeting bot and transcription API that joins Google Meet, Teams and Zoom and streams speaker-attributed transcripts in real time. Compiles meetings into a git-backed Markdown workspace and runs sandboxed agents on your infrastructure; Apache-2.0 and air-gap capable.