Skip to main content
QUICK REVIEW

[Paper Review] AccelTran: A Sparsity-Aware Accelerator for Dynamic Inference with Transformers

Shikhar Tuli, Niraj K. Jha|arXiv (Cornell University)|Feb 28, 2023
Advanced Neural Network ApplicationsComputer Science5 citations
TL;DR

AccelTran proposes a sparsity-aware, dynamic inference accelerator for transformers that leverages runtime activation pruning via DynaTran to reduce ineffective operations, enabling higher throughput and energy efficiency. The architecture uses tiled matrix operations and optimized dataflows, achieving up to 1.33× higher sparsity and 330K× higher throughput with 93K× lower energy than a Raspberry Pi, outperforming Energon by 5.73× in throughput and 3.69× in energy efficiency.

ABSTRACT

Self-attention-based transformer models have achieved tremendous success in the domain of natural language processing. Despite their efficacy, accelerating the transformer is challenging due to its quadratic computational complexity and large activation sizes. Existing transformer accelerators attempt to prune its tokens to reduce memory access, albeit with high compute overheads. Moreover, previous works directly operate on large matrices involved in the attention operation, which limits hardware utilization. In order to address these challenges, this work proposes a novel dynamic inference scheme, DynaTran, which prunes activations at runtime with low overhead, substantially reducing the number of ineffectual operations. This improves the throughput of transformer inference. We further propose tiling the matrices in transformer operations along with diverse dataflows to improve data reuse, thus enabling higher energy efficiency. To effectively implement these methods, we propose AccelTran, a novel accelerator architecture for transformers. Extensive experiments with different models and benchmarks demonstrate that DynaTran achieves higher accuracy than the state-of-the-art top-k hardware-aware pruning strategy while attaining up to 1.2$ imes$ higher sparsity. One of our proposed accelerators, AccelTran-Edge, achieves 330K$ imes$ higher throughput with 93K$ imes$ lower energy requirement when compared to a Raspberry Pi device. On the other hand, AccelTran-Server achieves 5.73$ imes$ higher throughput and 3.69$ imes$ lower energy consumption compared to the state-of-the-art transformer co-processor, Energon. The simulation source code is available at https://github.com/jha-lab/acceltran.

Motivation & Objective

  • To address the high computational and memory overhead of transformer inference due to quadratic complexity and large activation sizes.
  • To reduce ineffective operations in attention mechanisms through low-overhead, runtime activation pruning.
  • To improve hardware utilization and energy efficiency via matrix tiling and diverse dataflows in accelerator design.
  • To enable high-throughput, low-energy inference on both edge and server platforms through specialized accelerator variants (AccelTran-Edge and AccelTran-Server).
  • To overcome limitations of prior accelerators that focus only on weight sparsity or use monolithic matrix processing, leading to poor data reuse and low parallelization.

Proposed method

  • Proposes DynaTran, a dynamic inference scheme that prunes activations at runtime with minimal compute overhead, increasing sparsity in intermediate activations.
  • Employs matrix tiling and multiple dataflow strategies to enhance data reuse and improve hardware utilization across processing elements.
  • Designs a cycle-accurate accelerator architecture, AccelTran, with specialized RTL modules for softmax, layer normalization, and DynaTran operations, enabling single-cycle execution of key operations.
  • Introduces a novel control block that maps the transformer computational graph to tiled, hardware-optimized operations and selects optimal dataflows dynamically.
  • Supports both weight and activation sparsity by integrating movement-pruned models and exploiting sparsity across all multiplication operations in the transformer pipeline.
  • Optimizes for both edge and server deployment with two variants: AccelTran-Edge for mobile platforms and AccelTran-Server for cloud-scale inference.
Figure 1 : Memory requirements for (a) BERT-Tiny and (b) BERT-Base.
Figure 1 : Memory requirements for (a) BERT-Tiny and (b) BERT-Base.

Experimental results

Research questions

  • RQ1Can dynamic, runtime pruning of activations improve transformer inference throughput and energy efficiency while maintaining high accuracy?
  • RQ2How can matrix tiling and diverse dataflows be leveraged to improve data reuse and hardware utilization in transformer accelerators?
  • RQ3To what extent can sparsity in both weights and activations be exploited simultaneously in a hardware-aware transformer accelerator?
  • RQ4How does a hardware-aware dynamic inference scheme compare to static pruning or top-k strategies in terms of accuracy and performance?
  • RQ5Can a single accelerator architecture efficiently support both edge and server deployment with distinct performance and power constraints?

Key findings

  • DynaTran achieves up to 1.33× higher sparsity than the state-of-the-art top-k hardware-aware pruning strategy, with better accuracy.
  • AccelTran-Edge achieves 330,000× higher throughput and 93,000× lower energy consumption compared to a Raspberry Pi device.
  • AccelTran-Server delivers 5.73× higher throughput and 3.69× lower energy consumption than the state-of-the-art Energon co-processor.
  • The proposed accelerator design enables higher throughput and energy efficiency by exploiting sparsity across both weights and activations, not just weights.
  • Matrix tiling and optimized dataflows significantly improve hardware utilization, enabling better performance than monolithic matrix processing or matrix-vector decomposition approaches.
  • The control block enables dynamic scheduling and dataflow selection, supporting efficient execution of homogeneous transformer layers with high parallelization.
Figure 2 : AccelTran workflow for an input transformer model and its acceleration in hardware.
Figure 2 : AccelTran workflow for an input transformer model and its acceleration in hardware.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.