Introduction
The rise of Generative AI, driven by Transformer architectures, has created a significant demand for efficient execution on edge devices. While traditional hardware accelerators focus on optimizing Matrix Multiplications (MatMuls), a new bottleneck has emerged: non-linear operations such as Softmax and GELU. As MatMul units scale, these operations can consume nearly half of the total execution time, as illustrated in Figure 1.
Existing solutions often force models into low-precision integer formats (like INT8) to save power, but this typically requires expensive retraining and can degrade accuracy. The researchers behind SoftEx sought a way to maintain the high-precision BFloat16 (BF16) format used during training while achieving edge-level efficiency.
The SoftEx Architecture
To address this "non-linearity bottleneck," researchers developed SoftEx, a specialized hardware accelerator integrated into a heterogeneous compute cluster. The cluster template combines eight general-purpose RISC-V cores with a systolic array for MatMuls (RedMulE) and the SoftEx engine.
SoftEx is a parametric Hardware Processing Engine (HWPE) featuring 16 parallel lanes. It utilizes a novel algorithm, expp, for approximate exponentiation. By adding a polynomial correction to the classic Schraudolph method, expp achieves a mean relative error of just 0.14%, a 13× improvement over baseline approximations. This high accuracy allows the system to maintain BF16 precision without the need for aggressive quantization or model retraining.
Key architectural innovations include:
- GELU Reformulation: Instead of complex hyperbolic tangents, GELU is computed as a sum of exponentials, leveraging the efficient
exppunit. - Online Normalization: Softmax is implemented using a single-pass scheme that calculates the maximum value and denominator simultaneously, significantly reducing memory bandwidth requirements.
- Hybrid Precision: Interestingly, the authors found they could perform internal accumulation for GELU using 14-bit fixed-point math without hurting final network accuracy, simplifying the hardware.
Results and Scalability
SoftEx is remarkably compact, occupying only 3.22% of the total cluster area (0.039 $mm^2$ in 12nm technology). Evaluations on benchmarks like SQuAD v2, ImageNet1k, and WikiText-2 demonstrate significant performance gains:
- Speedups: SoftEx accelerates Softmax by 10.8× and GELU by 5.11× compared to optimized software on eight RISC-V cores.
- Energy Efficiency: Energy consumption is reduced by up to 26.8× for Softmax and 5.29× for GELU.
- System Performance: On a full Vision Transformer (ViT) workload, the cluster achieved a 1.58× increase in throughput (310 GOPS) and a 1.42× improvement in energy efficiency (1.34 TOPS/W).
The system also shows strong scalability. When modeled in a large 8x8 mesh for massive models like GPT-2 XL, the architecture reached a total throughput of 18.2 TOPS, though network-on-chip conflicts can introduce overheads of up to 17.4% in such large configurations.
Conclusion
SoftEx demonstrates that targeted hardware acceleration for non-linear functions is a highly cost-effective strategy for edge AI. By maintaining high numerical accuracy in BF16, it enables the deployment of pre-trained Transformer models on low-power devices with minimal overhead, paving the way for more capable generative AI at the edge.
Summary updated