Pallas Mosaic GPU kernels for NVIDIA Hopper, forward and backward, for linear-attention and state-space layers, with an FA3-style attention kernel and an LLM training stack around them.
CPU only (reference and chunked ops, small models):
pip install jax-linear-attention
Python 3.12 or newer and JAX 0.11.2 (the version is pinned). The kernels need an NVIDIA Hopper GPU (H100 or H200) and a CUDA 13 driver; on any other device every op falls back to its plain-JAX implementation. Call jla.ops.linear_attention(..., impl="auto") from your own JAX model, or train a model with jla train. Quick start
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.
01
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.
02
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.
03
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.
04
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
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
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
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
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
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.