Skip to content
jax-linear-attention: fast linear attention, SSM and attention kernels for JAX on NVIDIA Hopper. 72.3% MFU on one H100 (1.3B transformer, FP8), 68.2% MFU per GPU on 8 H100s, kernels up to 5.37x faster (Mamba-3 MIMO against the official recurrence kernels), 1.04-1.67x flame end to end in bf16jax-linear-attention: fast linear attention, SSM and attention kernels for JAX on NVIDIA Hopper. 72.3% MFU on one H100 (1.3B transformer, FP8), 68.2% MFU per GPU on 8 H100s, kernels up to 5.37x faster (Mamba-3 MIMO against the official recurrence kernels), 1.04-1.67x flame end to end in bf16
Measured on H100 GPUs on 20 October 2026 with no other jobs on the GPUs, unless noted. Kernel ratios are forward + backward, the other implementation's time over ours. Every result
Why JLA

Kernels for the layers new models use.

The layers behind newer language models (Mamba, Gated DeltaNet, KDA, RWKV-7, GLA) are recurrences, and they need dedicated kernels to train fast. PyTorch has them in Flash Linear Attention's Triton kernels; in JAX they have mostly run as plain JAX ops, which XLA cannot fuse into one efficient pass.

Exact

Three implementations of every recurrence.

A token-by-token reference (the oracle), a chunk-parallel JAX op that runs on any JAX backend, and a Pallas Mosaic GPU kernel for Hopper. The tests hold each kernel to the reference on dense inputs, packed documents, initial and final states and every gradient.

Fail-closed

Slower, never wrong.

impl="auto" runs a kernel only for the shapes, dtypes and options its GPU tests cover; every other call runs the chunked JAX op.

Packed documents

Every kernel, every document.

segment_ids reset the state at document boundaries, so a packed batch trains exactly as its documents would one by one.

Training stack

One TOML file per experiment.

Data, FSDP, tensor, expert and pipeline parallelism; FP8 with delayed scaling; dropless MoE on grouped-GEMM kernels; crash-consistent checkpoints with exact resume; SFT and DPO; Hugging Face import and export; perplexity and lm-evaluation-harness. Every option

Kernels

Measured against the latest upstream code.

On one H100, forward + backward. Against the official code: the Mamba-2 scan 1.20–1.96× (Triton kernels), the whole Mamba-2 layer 1.17–1.41× (fused training path), Mamba-3 SISO 1.58–2.32× and MIMO 2.70–5.37× (recurrence kernels). Against FLA: GLA 1.52–1.77× (dense), KDA 1.47–1.78×, RWKV-7 1.06–1.46× and Gated DeltaNet 1.71–2.68×. Gated DeltaNet against FlashQLA: 0.73–1.26×. Every shape and version

Kernel speed against the strongest latest upstream code, forward + backward, on one H100Kernel speed against the strongest latest upstream code, forward + backward, on one H100
Each row is measured against the upstream code it names. Bars are medians over the benchmark shapes, whiskers the range; right of 1× ours is faster.
End to end

Training at 1.3B.

On one H100 and the same tokens, the transformer, sliding-window, Gated DeltaNet, KDA and Mamba-2 presets train 1.04–1.67× faster than flame (FLA's trainer, with torch.compile where it works) in bf16 and 1.10–1.77× in FP8, and Mamba-3 1.55× in bf16. Results

1.3B training throughput against flame on one H100, bf16 and FP8, for the 1.3B presets1.3B training throughput against flame on one H100, bf16 and FP8, for the 1.3B presets

transformer-1p3b reaches 72.3% MFU in FP8 on one H100 and 68.2% per GPU on eight, and gdn-hd128-1p3b 55.0% and 52.3% against flame's 36.1% and 33.4%. MFU is model FLOPs over the 989 TFLOP/s bf16 spec; a power-capped H100 sustains about 681 TFLOP/s in bf16. Eight GPUs

MFU of the 1.3B transformer and Gated DeltaNet presets against flame: one H100 in bf16 and FP8, eight H100s in FP8MFU of the 1.3B transformer and Gated DeltaNet presets against flame: one H100 in bf16 and FP8, eight H100s in FP8
A paper's own setting

In the Gated DeltaNet-2 paper's setting.

The paper's Figure 2 times 1.3B hybrids on one H100 at 16,384 tokens per step. In that setting, every model of the figure trains 1.14–1.41× faster than the paper's numbers with a 32,000-token vocabulary, and 0.99–1.23× with Llama-3's 128,256. The Gated DeltaNet-2 hybrid runs at 52.1 and 49.1 thousand tokens/s at 2K × 8 and 16K × 1, against the paper's 38.0 and 36.1. The settings and the caveats

Training throughput in the Gated DeltaNet-2 paper's setting: every 1.3B model of the paper's Figure 2 at 4K x 4 tokens on one H100, the paper's numbers against ours with a 32K and a 128K vocabularyTraining throughput in the Gated DeltaNet-2 paper's setting: every 1.3B model of the paper's Figure 2 at 4K x 4 tokens on one H100, the paper's numbers against ours with a 32K and a 128K vocabulary
Sequence length

From 2K to 64K tokens.

Forward + backward against the fastest upstream code that runs each shape: Mamba-2 and GLA lead at every length and head layout, Gated DeltaNet trails FlashQLA on long single rows of 8 heads of dim 128, and causal attention stays below FA3 (0.73–0.90× with the default backward). Attention results

Forward + backward speedup across sequence lengths from 2K to 64K tokens for Mamba-2, Gated DeltaNet, GLA and causal softmax attention, against the fastest upstream code at each shapeForward + backward speedup across sequence lengths from 2K to 64K tokens for Mamba-2, Gated DeltaNet, GLA and causal softmax attention, against the fastest upstream code at each shape

Every case where JLA trails, with the reason

Our linear-attention kernels port the Triton kernels of Flash Linear Attention and follow its layer definitions, and its trainer, flame, is our end-to-end baseline. FlashAttention-3 shaped our attention kernel, our Mamba kernels port Mamba's, FlashQLA and FlashKDA showed the way for the Gated DeltaNet and KDA kernels, and Tokamax and JAX's Pallas examples are where our attention and GEMM kernels began. Acknowledgements

JLA is an independent project. It is not affiliated with or endorsed by Google or the JAX team; “JAX” names the framework it is built on.

Open source

Built in
the open.

Version 0.1.0 is early development, and its APIs will change. Contributions are welcome, with a DCO sign-off on every commit.