Search for Optimal Systolic Arrays: A Comprehensive Automated Exploration Framework and Lessons Learned

Jie Wang, Jason CongarXiv 2021

Systolic arrays—specialized hardware structures where data flows through a network of processing elements—are the engine room of modern AI and High-Performance Computing (HPC). However, designing the optimal array for a specific task is a significant challenge. With a design space that can reach $O(2^{40})$ possible configurations, finding the one that delivers peak performance is akin to finding a needle in a massive haystack.

A new framework introduced by researchers at UCLA, Odyssey, addresses this by challenging long-standing assumptions in hardware design and identifying near-optimal configurations in seconds. By combining mathematical programming with evolutionary search, Odyssey identifies designs reaching 90% of optimal performance in just 5 seconds, outperforming state-of-the-art reinforcement learning and Bayesian methods.

The Odyssey Framework

Odyssey bridges the gap between high-level code and physical hardware through a multi-stage automated flow. It leverages AutoSA, an open-source polyhedral compiler, to automatically generate a comprehensive design space from a C program. It creates symbolic performance models directly from the hardware's Abstract Syntax Tree (AST), ensuring high accuracy.

The Odyssey automated design space exploration flow.

The optimization process occurs in two primary stages:

  1. Mathematical Programming: An off-the-shelf solver (such as Ipopt) uses a simplified objective function to find a high-quality starting point, or "seed."
  2. Evolutionary Search: An evolutionary algorithm refines these seeds. Crucially, it introduces a random mutation strategy that allows for "non-divisor" tiling factors (using zero-padding), which significantly expands the reachable performance space.

Challenging Conventional Wisdom

Historically, researchers used several shortcuts to make the design search manageable, such as only considering tile sizes that perfectly divide the total problem size (the "divisor constraint") or assuming that minimizing off-chip communication always leads to the fastest design. Odyssey reveals that these shortcuts are actually limitations that lead to significant performance loss—sometimes as much as 45%.

Comparison of throughput and DSP usage across different systolic array designs.

One of the most significant findings is the "Divisor Trap." Limiting tiling factors to divisors of the problem size is a major mistake. Odyssey demonstrated that allowing non-divisors (and using padding) can improve performance by up to 39% because it allows the hardware to utilize nearly 100% of its available DSP (Digital Signal Processing) resources. Furthermore, the framework highlights that an optimal design must balance communication with computation; the "lowest communication" design was actually 45% slower than the true optimal.

Performance and Results

The framework was evaluated on heavy-hitting workloads including Matrix Multiplication (MM) and Convolutional Neural Networks (CNNs) like VGG16 and ResNet50, targeting the Xilinx Alveo U250 FPGA.

  • Speed and Quality: Odyssey finds designs reaching 90% of optimal performance in 5 seconds on a single CPU thread. Across 18 different systolic array designs for Matrix Multiplication, it located configurations achieving >95% of the theoretical optimal performance.
  • Efficiency: In CNN tasks, Odyssey demonstrated that 2D systolic arrays significantly outperform 1D arrays by exploiting more degrees of parallelism, achieving 77% of peak layer-wise throughput on VGG16.
  • Accuracy: By including "prologue" and "epilogue" phases (loading and draining data) in their latency model, Odyssey achieved an estimation error of only 1.99% compared to real RTL simulation.

Conclusion

Odyssey consistently outperforms other search methods like Simulated Annealing, OpenTuner, and Reinforcement Learning in both sample efficiency and final design quality. While currently restricted to rectangular iteration domains, future work aims to extend Odyssey's performance models to support non-rectangular domains found in algorithms like LU decomposition, further broadening its utility for the scientific computing community.

Summary updated

BibTeX
@misc{wang2021search,
  author = {Jie Wang and Jason Cong},
  title = {{Search for Optimal Systolic Arrays: A Comprehensive Automated Exploration Framework and Lessons Learned}},
  year = {2021},
  eprint = {2111.14252},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.14252},
}
Figure