SparseWafer: Fast Dynamic Sparse Prefill on a Wafer-Scale Accelerator
Abstract
Dynamic block-sparse attention skips most of the attention work of a long prompt. On accelerators whose multicast is statically routed and flow-controlled, such as wafer-scale engines, the pruning gains far less than the skipped work suggests: with the conventional placement, sparse attention that skips most of the blocks still takes most of the dense attention time. The cause is multicast backpressure: a route advances only when every destination has a free buffer, so processing elements (PEs) that receive the same key-value stream stall each other when their work falls at different points of it. We present SparseWafer, which reduces this stall by placing query rows. The rows that share one selection decision select the same key blocks, so spreading them cyclically over the PEs of a stream gives every PE the same work on every block, and we prove that such PEs run as fast as one PE alone, for any buffer depth. A per-head start offset, which starts each query head at a different set of PEs, extends this balance across the multicast routes that share one key-value stream; it depends only on tensor shapes and is fixed before run time. We evaluate SparseWafer on the Cerebras SDK's WSE-3 simulator and a model calibrated on it, with selection and data movement included. With the masks of a published selection method (XAttention), SparseWafer is 1.31-1.49x faster than sparse prefill with the conventional placement at each model's longest context. With these masks, sparse prefill loses at most 1.8 points of accuracy on the RULER long-context benchmark, and on the denser masks of RULER prompts SparseWafer is still 1.28-1.54x faster than dense prefill at 128K. It is also faster than mask-aware load balancers and within 5-10% in attention time of an idealized, zero-cost one: on such networks, the shape of the computation decides almost all of where each row belongs.
Create a lesson
Metadata
- Categories
- cs.AR, cs.LG
Related papers
PAISF: A Partially Adaptive In-Order Selection Function for Routing in On-Chip, Inter-Chiplet, and Wafer-Scale Networks
Shared title terminologycs.ARPatrick Iff, Luca Oertig, Andrin Weber et al.
TriSpark: A Sparse Ternary Spiking Transformer with Event-Driven Acceleration on Edge FPGAs
Shared title terminologycs.ARJun Yang, Yingxuan Xiao, Feiyang Li et al.
CAMPA: A Cross-Algorithm Multithreaded PQC Accelerator with Dynamic Scheduling
Shared title terminologycs.ARZhengpeng Zhao, Wenbo Xu, Jiayi Li et al.
Tetris: Accelerating Composable Test-Time Scaling on GPU-PIM Systems via Adaptive Mapping, Control, and Memory Management
Shared title terminologycs.ARShengxuan Qiu, Haochen Huang, Tenghao Zhao et al.
L2C2: Enhancing Large-scale Chiplets for Agent Long-Context LLM Inference with Sparse and Distributed Attention
Shared title terminologycs.ARKangbo Bai, Zhonghua Mu, Hongze Zhou et al.
ANOR: Scaling Sparse Attention with a GPU-PNM Computing Hierarchy
Shared title terminologycs.ARHyunsu Ye, Hyunmin Choi, Jaehong Cho et al.