Manuscript Offprint

arXiv:2611.06828

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

Gagik Amirkhanyan, Nuojin Cheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Gated-delta linear attention layers such as Gated DeltaNet (GDN), Kimi Delta Attention (KDA), and GDN-2 are tuned for GPUs, where small tensor-core tiles and fast vector registers make per-channel decay rescaling and sequential in-block solves cheap. On Google TPUs, which concentrate compute in wide 256×256256 \times 256 systolic matrix units backed by a slower vector unit, porting these layers directly leaves half of each matrix tile empty and bottlenecks on vector operations. We present Systolic Linear Attention (SLA), which reshapes gated delta attention around the matrix unit by widening keys to 256 with grouped value heads, grouping decay gates into four 64-channel tiles, and computing the chunk solve entirely with block matrix products in a single fused kernel. On TPU v7x, a full SLA-R4 layer runs 1.6×−2.5×1.6\times-2.5\times faster than the open-source Tokamax KDA kernel (1.4×−2.4×1.4\times-2.4\times with exact chunk inversion), driven primarily by head sharing and kernel fusion. Across a 2,048-chip TPU v7x pre-training study of sparse Mixture-of-Experts (MoE) models from 6.5B to 63.1B parameters, SLA trains 11%–24% faster than KDA at similar perplexity, and reaches slightly lower perplexity than KDA in smaller matched-seed runs.

1 Introduction

Linear attention removes the quadratic compute and key-value (KV) cache of softmax attentions [15, 63] by storing the context in a fixed-size state matrix St∈Rdk×dvS_t \in \mathbb{R}^{d_k \times d_v} (for key width dkd_k and value width dvd_v), updated at each token tt with its key kt∈Rdkk_t \in \mathbb{R}^{d_k} and value vt∈Rdvv_t \in \mathbb{R}^{d_v} as [33]:

St=St−1+ktvt⊤.S_t = S_{t-1} + k_t v_t^\top.

Because this sum grows without bound, the state saturates on long sequences. Gated models such as Mamba-2 [14] and GLA [66] add a data-dependent forget (decay) gate Ft∈(0,1]dk×dkF_t \in (0,1]^{d_k \times d_k},

St=FtSt−1+ktvt⊤,S_t = F_t S_{t-1} + k_t v_t^\top,

but decay fades all stored keys together and hurts associative recall [5].

To overwrite individual keys selectively, DeltaNet [50, 67] introduced the delta rule with unit-norm key ktk_t (∥kt∥2=1\|k_t\|_2 = 1), scalar write gate βt\beta_t, and dk×dkd_k \times d_k identity IdkI_{d_k}:

St=(Idk−βtktkt⊤)St−1+βtktvt⊤.S_t = (I_{d_k} - \beta_t k_t k_t^\top)S_{t-1} + \beta_t k_t v_t^\top.

Viewing such updates as online gradient descent, prior work also added heavy-ball momentum so that a single noisy update cannot overwrite established memories [9, 44]. Combining decay with the delta rule produced Gated DeltaNet (GDN) [68], adopted in Qwen3-Next [48]. Kimi Delta Attention (KDA) [71] then expanded GDN's scalar forget gate into a per-channel diagonal gate Ft=diag(ft)F_t = \text{diag}(f_t)

Preprint.

Figure

Figure 1: Overview of SLA. (a) Direct ports of GPU-tuned gated-delta layers (GDN [68], KDA [71], GDN-2 [25]) run as an unfused pipeline on TPUs: intermediates round-trip through HBM, per-channel decay rescaling in KDA and GDN-2 and in-block triangular substitution run on the VPU, and 128-wide states leave at least half of each 256 × 256 MXU tile padded. (b) SLA fuses stages 2–5 into one VMEM kernel. (c) A head with key and value widths dk=dv=128d_k = d_v = 128 fills a quarter of an MXU tile, while SLA's wide packed state fills whole tiles. (d) Decay gates are grouped into four 64-channel tiles, so intra-chunk scores are four 64-wide MXU matmuls with no VPU rescaling. (e) The chunk solve uses only block matrix products on the MXU.

with channel-wise decay vector ft∈(0,1]dkf_t \in (0,1]^{d_k}, and GDN-2 [25] decoupled per-channel erase and write gates. Section 5 surveys further variants.

However, these architectures and their chunkwise WY training algorithms [10, 66, 68] were developed and tuned on NVIDIA GPUs (f1a [65]). They map less well onto 2D systolic-array accelerators such as Google TPUs [18, 31, 32], for three reasons:

Small tiles and unpacked heads. GPU Tensor Cores operate on small fragments, so dk=dv=128d_k = d_v = 128 with one key head per value head already reaches high occupancy. The TPU v6e/v7x Matrix Multiply Unit (MXU) is a 256 × 256 systolic array: a 128-wide state pads half of every tile, and projections, convolutions, and chunk solves are repeated for every head.

Per-channel decay gates. In KDA and GDN-2, each key channel decays at its own rate. Kernels must rescale keys elementwise in 16-token sub-blocks to avoid float32 overflow. GPUs absorb this vector work cheaply; on TPUs, where matrix throughput exceeds vector throughput by roughly 128×, it stalls the kernel.

Sequential triangular solves. The chunkwise WY algorithm [10, 68] partitions training sequences into chunks of length CC and solves a C×CC \times C unit lower-triangular system per head and chunk. Existing kernels [19, 65] substitute sequentially within diagonal blocks; on TPUs this runs on the Vector Processing Unit (VPU) and takes about half of the core kernel time in our measurements.

Kernel tuning alone does not close this gap: fusing a GPU-shaped KDA layer into on-chip memory speeds it up by only 1.03× on TPU v7x (Table 5), because the time goes to VPU solves and padded MXU tiles rather than High-Bandwidth Memory (HBM) traffic. We therefore change the layer itself. Systolic Linear Attention (SLA) applies a block-diagonal, tile-grouped forget gate Ft∈Rdk×dkF_t \in \mathbb{R}^{d_k \times d_k} to St−1S_{t-1} and then performs the delta update with key kt∈Rdkk_t \in \mathbb{R}^{d_k}, packed value vt∈Rdkv_t \in \mathbb{R}^{d_k} (stacking R∈{2,4}R \in \{2,4\} value heads per key head), and a write gate βt∈(0,2)\beta_t \in (0,2) shared across the packed value heads:

(1)$$

SLA also smooths chunk updates with a chunk-boundary momentum term with coefficient μ=0.25\mu = 0.25 that stays in on-chip SRAM (VMEM). SLA combines three changes (Section 2):

2

**Wide keys shared across value heads.** SLA widens keys to $d_k = 256$ and shares each key head and gate $\beta_t$ across $R \in \{2, 4\}$ value heads (SLA-R2, SLA-R4), following grouped value attention (GVA) [47]. The packed state fills whole MXU tiles, and key-query projections, convolutions, and chunk solves are computed $R \times$ less often. **Tile-grouped forget gate.** SLA splits the 256 key channels into 4 tiles of 64 channels, each with one scalar decay rate. Intra-chunk scores then become four 64-wide MXU matmuls scaled by decay masks, with no VPU rescaling. This is a middle point between GDN's single rate per head and KDA's rate per channel. **Chunk inversion on the MXU.** Because $\beta_t$ is shared, SLA needs one $C \times C$ solve per key head. It computes the inverse only with block matrix products on the MXU: an exact recursive block-doubling inverse by default, or an optional 1-step Neumann approximation for faster solves, fused with the rest of the layer in VMEM. We evaluate SLA on TPU v7x at the kernel, layer, serving, and context-parallel level, and across a 2,048-chip TPU v7x pre-training study of sparse Mixture-of-Experts (MoE) models [16, 52] from 6.5B to 63.1B parameters on Dolma [54, 60] (Section 3). We find that most of SLA's speedup comes from head sharing and fusion, which the tile-grouped gate and MXU chunk inversion make possible. On matched seeds, SLA improves on standard KDA and stays within about 0.1 perplexity of a wide-key per-channel KDA control while avoiding per-channel long-context drift; the optional 1-step Neumann inverse trades about 0.2 perplexity for speed. SLA is therefore best understood as a hardware-efficient operating point rather than a more expressive update rule; it is complementary to modeling advances such as GDN-2, which reaches lower perplexity per token (Section 3.5). In the following sections, Section 2 reviews gated delta attention, its TPU bottlenecks, and SLA's design; Section 3 evaluates SLA from kernels and serving to MoE pre-training; Section 4 details optional low-precision key whitening; and Section 5 covers related work.

References (58)