TL;DR
The STAR Accelerator is a novel hardware-software co-design that tackles the quadratic complexity of LLM self-attention by coordinating sparsity prediction and formal computation. By introducing "cross-stage tiling," STAR achieves up to a 9.2× speedup and 71.2× energy efficiency gain over an NVIDIA A100 GPU, while significantly outperforming existing state-of-the-art (SOTA) sparse accelerators in area and power efficiency.
What Problem Does This Paper Address?
As Large Language Models (LLMs) move toward "infinite context" (processing hundreds of thousands of tokens), the self-attention mechanism becomes a massive bottleneck. Its computational complexity grows quadratically ($O(S^2)$) with sequence length. While researchers have proposed Dynamic Sparsity (DS)—predicting and calculating only the most important "top-k" attention scores—existing accelerators struggle with Large-scale Token Parallelism (LTPP).
The authors identify three "stage-isolated" gaps in current designs:
- Prohibitive Prediction Overhead: Predicting which tokens are important often costs more energy than the actual computation.
- Rigid Operator Dependencies: Sorting and Softmax operations require "row-wise" knowledge, forcing data to be constantly swapped between on-chip memory and slow off-chip DRAM.
- Uncoordinated Workflows: Current designs treat the "prediction" and "formal computation" stages as separate silos, missing opportunities to reuse data (like maximum values) across stages.
Methods
The authors propose STAR, a cross-stage tiling workflow supported by a dedicated spatial architecture. Its core innovations include:
- Differential Leading Zero Scheme (DLZS): A multiplier-free sparsity predictor. Instead of standard 4-bit multiplication, it operates in the log-domain, using simple bit-shifts to estimate importance. It is "differential" because it only converts one operand, reducing the error and power consumption typical of symmetric log-domain designs.
- Sphere-search Aided Distributed Sorting (SADS): Rather than sorting an entire long sequence (which is slow), SADS breaks sequences into sub-segments. It uses a "spherical radius" pruning criterion to quickly evict unimportant tokens, reducing sorting complexity by ~90%.
- Sorted Updating FlashAttention (SU-FA): This bridges the gap between prediction and execution. It uses the top-k information from the prediction stage to streamline the "max-value" updates in FlashAttention, eliminating redundant exponentiations and comparisons.
- DRAttention & MRCA: For multi-core scaling, the authors developed a "Ring-flow" dataflow (DRAttention) and a "Mesh-friendly Ring Communication Algorithm" (MRCA). These ensure that data moves efficiently across a 2D mesh of cores without needing expensive physical wrap-around links.
Datasets
The authors evaluated STAR across a wide range of models and tasks to ensure generality:
- Models: BERT-base/large, GPT-2, Bloom-1B7/3B, LLaMA-7B/13B, and PVT (Pyramid Vision Transformer).
- Tasks: NLP benchmarks from GLUE (MRPC, SST-2, etc.), SQuAD v1.1, and language modeling on Wikitext-2/WikiRaw. For vision, they used ImageNet-1k.
- Baselines: Comparisons were made against the NVIDIA A100 GPU (using TensorRT-LLM) and SOTA accelerators like FACT, Energon, and ELSA.
Key Insights and Ideas
- The "Aha" Moment of Cross-Stage Coordination: In standard FlashAttention, the hardware must constantly re-calculate the "max" value of a row to keep Softmax numerically stable. The authors realized that the prediction stage already identifies these high-value tokens. By passing this "hint" forward, they can skip the expensive search for maximums in the formal stage.
- Communication over Computation: In spatial (multi-core) architectures, moving the large Key/Value matrices is a death sentence for performance. STAR’s DRAttention focuses on moving the much smaller Query tensor across the mesh, overlapping this communication with computation to hide latency.
- Sparsity is Task-Dependent: The paper finds that textual sentiment tasks (like SST-2) are extremely sparse (over 90% prunable), while vision tasks are denser. STAR allows designers to adaptively tune the "top-k" ratio to balance accuracy and speed.
Key Results
- Hardware Performance: STAR achieves 24.4 TOPS throughput. Compared to an A100, it provides 9.2× speedup and 71.2× energy efficiency.
- Efficiency vs. SOTA: It surpasses previous specialized accelerators (like ELSA and Energon) by up to 16.1× in energy efficiency and 27.1× in area efficiency.
- Spatial Scaling: When deployed in a 5x5 multi-core grid, the Spatial-STAR architecture achieved a 20.1× throughput improvement over a baseline design by effectively mitigating the memory-access bottleneck.
- Accuracy: Under "Standard" settings, STAR maintains 0% accuracy loss compared to INT16 baselines. Even under "Aggressive" pruning (up to 2% loss), the speedups are massive.
Limitations and Future Work
While STAR excels at handling the attention mechanism, the authors note that as attention becomes more efficient, the Feed-Forward Network (FFN) and QKV Generation stages may become the new bottlenecks for shorter sequences.
Future work could involve:
- Integrating STAR with weight-sparsity techniques to further reduce the FFN overhead.
- Exploring how these spatial tiling strategies apply to newer "Linear Attention" or "State Space Models" (SSMs) that aim to replace standard Transformers.
- Testing the MRCA communication algorithm on even larger-scale wafer-scale engines.
Summary updated