# Systolic Linear Attention: Co-Designing Tile-Grouped Gated DeltaAttention for TPUs

> Systolic Linear Attention reshapes gated delta attention around TPU systolic arrays, achieving 2.1x-2.6x speedup over KDA with 49%-61% less HBM while matching perplexity.

- **Source:** [arXiv](https://arxiv.org/abs/2611.06828)
- **Published:** 2026-11-28
- **Permalink:** https://picx.dev/p/n0tT0q
- **Whiteboard:** https://picx.dev/p/n0tT0q/image

## Summary

## Summary (Overview)

- **Problem**: Gated-delta linear attention layers (GDN, KDA, GDN-2) are tuned for GPUs and map poorly onto Google TPUs, which use wide 256×256 systolic matrix units with a much slower vector unit (~128× throughput gap vs. ~15× on H100).
- **Solution**: **Systolic Linear Attention (SLA)** reshapes gated delta attention around the TPU's matrix unit via three key changes: (1) widening keys to 256 dimensions and sharing keys and write gates across grouped value heads (R× fewer chunk solves), (2) grouping decay gates into four 64-channel tiles, and (3) fusing exact FP32 block-doubling chunk inversion and backward reuse inside one on-chip VMEM kernel.
- **Performance**: SLA-R4 runs 2.1×–2.6× faster than open-source MaxText KDA and 1.4×–2.4× faster than Tokamax KDA on TPU v7x, while using 49%–61% less temporary HBM.
- **Quality**: Across a 2,048-chip TPU v7x pre-training study of MoE models (6.5B–63.1B parameters), SLA trains 11%–24% faster than MaxText KDA, matches KDA perplexity on paired seeds at 12.5B, and stays within 3% at other scales.
- **Extrapolation**: Without clamping decay gates, SLA extrapolates from 8K training to 32K–64K context far better than unclamped KDA.

---

## Introduction and Theoretical Foundation

### Background

Linear attention removes the quadratic compute and KV cache of softmax attention by storing context in a fixed-size state matrix $S_t \in \mathbb{R}^{d_k \times d_v}$, updated at each token $t$ with key $k_t \in \mathbb{R}^{d_k}$ and value $v_t \in \mathbb{R}^{d_v}$:

$$S_t = S_{t-1} + k_t v_t^\top$$

Because this sum grows without bound, gated models add a data-dependent forget (decay) gate $F_t \in (0,1]^{d_k \times d_k}$:

$$S_t = F_t S_{t-1} + k_t v_t^\top$$

### Evolution of Gated Delta Attention

**DeltaNet** introduced the delta rule with unit-norm key $k_t$ ($\|k_t\|_2 = 1$), scalar write gate $\beta_t$, and identity $I_{d_k}$:

$$S_t = (I_{d_k} - \beta_t k_t k_t^\top) S_{t-1} + \beta_t k_t v_t^\top$$

**Gated DeltaNet (GDN)** combines decay with the delta rule, using one scalar decay $\gamma_t \in (0,1]$ per head ($G=1$):

$$F_t = \gamma_t I_{d_k}, \quad \beta_t = \sigma(\tilde{\beta}_t) \in (0,1)$$

**Kimi Delta Attention (KDA)** expands GDN's scalar forget gate into a per-channel diagonal gate ($G = d_k$):

$$F_t = \text{diag}(f_t), \quad f_t \in (0,1]^{d_k}$$

**GDN-2** retains per-channel decay and replaces scalar $\beta_t$ with separate channel-wise erase and write gates.

### Three Hardware Bottlenecks on TPUs

1. **Narrow states and fixed per-step scan cost**: A 128-wide state leaves half of each 256×256 MXU tile's key axis padded, while paying full per-step cost for every head. Each scan step costs ≈12μs regardless of chunk size.

2. **Per-channel decay**: KDA/GDN-2 kernels must rescale keys elementwise in 16-token sub-blocks to avoid FP32 overflow. GPUs absorb this vector work cheaply; on TPUs where matrix:vector throughput is ~128×, it stalls the kernel.

3. **Per-value-head chunk solves**: Independent write gates per value head force $H_v$ solves per chunk, with unfused HBM round-trips. Ops 3–5 account for ~45% of core stateless KDA time.

---

## Methodology

### SLA Recurrence (Definition 2.1)

SLA uses $H_v$ value heads of width $d_v$ and $H_k = H_v/R$ query-key heads of width $d_k = 256$, where each query-key head is shared across $R \in \{2, 4\}$ value heads:

- **Shared query, key, write gate**: L2-normalized $q_t, k_t \in \mathbb{R}^{256}$ with $\|q_t\|_2 = \|k_t\|_2 = 1$, and scalar step size $\beta_t = 2\sigma(\tilde{\beta}_t) \in (0,2)$
- **Packed values**: $R$ value vectors stacked as $v_t = [v_{t,1}; \ldots; v_{t,R}] \in \mathbb{R}^{D_{v,\text{pack}}}$
- **Four-tile forget gate**: Block-diagonal gate splitting 256 channels into $G=4$ contiguous tiles of $b=64$ channels:

$$F_t = \text{diag}(\gamma_{t,1}\mathbf{1}_{64}, \gamma_{t,2}\mathbf{1}_{64}, \gamma_{t,3}\mathbf{1}_{64}, \gamma_{t,4}\mathbf{1}_{64})$$

**Token-level recurrence**:

$$S_t = F_t S_{t-1} + \beta_t k_t \left(v_t - (F_t S_{t-1})^\top k_t\right)^\top$$

$$o_{t,m} = \sigma(z_{t,m}) \odot \text{RMSNorm}\left(S_{t,m}^\top q_t\right)$$

### Three Algorithmic Pillars

#### 1. Wide Keys and Shared $\beta_t$ Across Grouped Value Heads

SLA widens keys to $d_k = 256$ and shares both each key head and the scalar write gate $\beta_t \in (0,2)$ across $R \in \{2,4\}$ value heads. This packs value heads into full 256×$Rd_v$ MXU tiles and cuts chunk solves by $R\times$ (2.45×–3.28× faster core forward, 1.87×–2.48× faster full-layer F+B).

#### 2. Tile-Grouped Forget Gate

SLA splits 256 key channels into 4 tiles of 64 channels, each with one scalar decay rate. Intra-chunk scores become four 64-wide MXU matmuls scaled by decay masks, with no VPU rescaling. This middle point between GDN's single rate ($G=1$) and KDA's per-channel rate ($G=d_k$) runs at near-scalar single-kernel VMEM speed while lowering perplexity over $G=1$.

#### 3. Fused VMEM Exact Inversion with Backward Reuse

SLA fuses $R\times$-fewer exact FP32 recursive block-doubling solves and custom-VJP backward reuse inside one VMEM kernel, with a chunk-size-independent conditioning bound (Theorem 2.3). Exact FP32 block-doubling holds $10^{-7}$ accuracy through $C=256$ while adding only 4.0%–7.7% to full-LM step time.

### Chunkwise WY Parallelization

The chunkwise WY algorithm partitions the sequence into $T/C$ contiguous chunks. Within chunk $c$ starting from boundary state $S_{c-1}$, the chunk writes satisfy:

$$E_c = \text{diag}(\beta_c) (I_C + M_c)^{-1} (V_c - \bar{K}_c S_{c-1})$$

where $M_c$ is the strictly lower-triangular Gram matrix of decayed key overlaps, and $A_c = (I_C + M_c)^{-1}$ is computed via exact FP32 block-doubling.

---

## Empirical Validation / Results

### Kernel and Layer Performance

**Table 1: SLA vs. KDA at a glance on TPU v7x**

| Benchmark | KDA | SLA | SLA vs. KDA |
|---|---|---|---|
| Full layer, 32K fwd+bwd (2-stage; MaxText/Tokamax) | 48.7/42.4 ms | 20.2 ms | 2.4×/2.1× faster |
| Temporary HBM, 32K layer | 9.1/9.3 GiB | 3.7 GiB | 60%/61% less |
| 131K prefill, 32-layer hybrid (Exact Inv., BF16) | 2.66 s | 1.62 s | 1.64× faster |
| MoE training throughput, 6.5B–63.1B (vs. MaxText KDA) | 1.00× | 1.11×–1.24× | 11%–24% faster |
| 12.5B equal-chip-h PPL vs. Tokamax (42.7 chip-h, n=3) | 19.52 | 19.15 [19.11] | −0.37 [−0.41] (3/3 seeds) |
| 63.1B equal-chip-h PPL vs. Tokamax (37.3 chip-h, n=3) | 26.56 | 25.08 [25.14] | −1.48 [−1.41] (3/3 seeds) |
| 12.5B iso-token PPL vs. MaxText (60.4B tok, n=3) | 15.60 | 15.58 | −0.02 (within noise) |
| 63.1B iso-token PPL vs. MaxText (120.8B tok, n=1) | 12.60 | 12.45 | −0.15 |
| 64K HotpotQA, 12.5B, no clamping | 50.3% | 77.9% | +27.6 pts |

### Pre-training Results

- **2,048-chip TPU v7x study**: MoE models from 6.5B to 63.1B nominal parameters. SLA trains 11%–24% faster than MaxText KDA (4%–21% faster than Tokamax KDA).
- **Equal-chip-hour comparisons** (64-chip slices, n=3 paired seeds): 1-kernel fused SLA-R4 lowers perplexity on all 3/3 seeds at both 12.5B (−0.37 ± 0.11) and 63.1B (−1.48 ± 0.21).
- **Fused SLA-R4 + GDN-2 hybrid**: Also beats safe-clipped Tokamax KDA on all 3/3 seeds at both scales (−0.41 ± 0.35 at 12.5B, −1.41 ± 0.16 at 63.1B).
- **$G=4$ outperforms scalar $G=1$** across 6/6 paired 12.5B MoE and dense-LM seeds.

### Hardware Specifications

**Table 2: Documented hardware specifications per chip**

| Accelerator | Cores | Array Tile | BF16 TF/s | 8-bit TF/s | VPU TF/s | MXU:VPU | HBM (GB) | HBM GB/s | Ridge |
|---|---|---|---|---|---|---|---|---|---|
| H100 SXM | 132 SM | 16×16 | 989 | 1,979 | 67.0 | 14.8× | 80 | 3,350 | 295 |
| TPU v4 | 2 | 128×128 | 275 | 275 | 3.2 | 85.9× | 32 | 1,200 | 229 |
| TPU v5p | 2 | 128×128 | 459 | 918 | 5.4 | 85.0× | 95 | 2,765 | 166 |
| TPU v6e | 1 | 256×256 | 918 | 1,836 | 7.2 | 127.5× | 32 | 1,600 | 574 |
| TPU v7x | 2 | 256×256 | 2,307 | 4,614 | 18.0 | 128.2× | 192 | 7,373 | 313 |

### Ablation Breakdown

The speedup against open-source Tokamax KDA decomposes into:
- **1.28×–1.41×** from 4:1 head packing
- **1.10×–1.12×** from VMEM fusion
- **1.07×–1.20×** from $G=4$ tile grouping

---

## Theoretical and Practical Implications

### Theoretical Contributions

- **Conditioning guarantee**: Theorem 2.3 proves a chunk-size-independent conditioning bound for SLA's exact FP32 block-doubling inversion.
- **Chunk-boundary momentum**: SLA offers an optional Schur-guarded momentum mode with $\mu_c \leq (1-\varphi_c)/(1+\varphi_c)$ for unconditional chunk-to-chunk stability, though $\mu=0$ is the recommended default.
- **Step-size extension**: SLA adopts $\beta_t = 2\sigma(\tilde{\beta}_t) \in (0,2)$, widening the eigenvalue range of $I_{d_k} - \beta_t k_t k_t^\top$ to $(-1, 1)$.

### Practical Implications

- **Hardware-aware architecture design**: SLA demonstrates that co-designing attention architectures around specific hardware (TPU systolic arrays) can yield substantial gains over simply optimizing kernels for existing GPU-tuned architectures.
- **Memory efficiency**: 49%–61% reduction in temporary HBM usage enables longer sequences and larger models on the same hardware.
- **Long-context extrapolation**: Without clamping decay gates, SLA extrapolates from 8K training to 32K–64K context far better than unclamped KDA, achieving 77.9% vs. 50.3% on 64K HotpotQA.
- **Complementary to richer update rules**: SLA is best understood as a hardware-efficient operating point complementary to richer update rules such as GDN-2; combining them (fused SLA-R4 + GDN-2) yields the best equal-chip-hour results.

---

## Conclusion

SLA demonstrates that reshaping gated delta attention around the TPU's 256×256 systolic matrix unit—rather than merely porting GPU-tuned kernels—yields substantial improvements in both speed (2.1×–2.8× faster than open-source KDA implementations) and memory efficiency (49%–61% less temporary HBM), while maintaining or improving model quality across scales from 6.5B to 63.1B parameters.

Key design choices—wide 256-dimensional keys with shared write gates across grouped value heads, four-tile grouped decay gates, and fused exact FP32 block-doubling chunk inversion with backward reuse inside a single VMEM kernel—directly address the three TPU-specific bottlenecks of narrow states, per-channel decay rescaling, and per-value-head chunk solves.

**Future directions** include:
- Exploring the SPD-SLA-W extension with chunk preconditioning for whitened keys
- Further combinations with richer update rules like GDN-2
- Application of the tile-grouped decay principle to other linear attention variants
- Extension to other systolic-array accelerators beyond TPUs

The paper positions SLA as a hardware-efficient operating point complementary to more expressive update rules, with the caveat that unclamped per-channel decay in KDA exhibits slow-channel long-context drift that SLA's tile-grouped decay naturally avoids.

---

_Markdown view of https://picx.dev/p/n0tT0q, served by PicX — AI-generated visual whiteboard summaries of research papers._
