Automatic Nested Loop Acceleration on FPGAs Using Soft CGRA Overlay

Cheng Liu, Ho-Cheung Ng, Hayden Kwok-Hay SoarXiv 2015

Introduction

Offloading compute-intensive nested loops to FPGAs offers the potential for massive performance gains, yet a significant "productivity gap" persists. Traditional hardware development using low-level description languages like Verilog or VHDL is notoriously slow and error-prone. To bridge this gap, researchers often employ overlays—virtual architectures, such as a grid of small processors, implemented on top of the FPGA fabric to simplify programming.

However, generic overlays typically incur a "performance tax," as a one-size-fits-all architecture is rarely as efficient as dedicated custom hardware. Achieving peak performance requires tuning a complex array of parameters, including processor count, memory allocation, and loop unrolling factors. Manually navigating this vast design space is exhaustive, and automated brute-force searches can take days. This paper introduces QuickDough, a framework designed to automate and accelerate the customization of these overlays.

The QuickDough Framework

QuickDough automates the customization of a Soft Coarse-Grained Reconfigurable Array (SCGRA) overlay for specific applications. The framework streamlines the transition from high-level code to an optimized FPGA bitstream through a multi-path compilation and generation process.

Overview of the QuickDough framework, illustrating the parallel paths for software compilation, accelerator generation, and customization.

As shown in the framework overview, QuickDough manages three primary workflows: software compilation for the host CPU, accelerator generation for the FPGA, and a specialized customization path that uses design constraints and templates to optimize the hardware configuration. By decoupling these processes, the framework can rapidly iterate on hardware designs without requiring full FPGA re-compilation for every change.

Architectural Design and Optimization

The core of the system is the SCGRA, which consists of a grid of Processing Elements (PEs) connected in a 2D torus topology. Each PE contains its own Arithmetic Logic Unit (ALU) and local memory, allowing for highly parallel execution of loop kernels.

The FPGA Accelerator architecture, featuring the SCGRA grid and detailed internal structure of a Processing Element (PE).

To optimize this architecture, QuickDough employs a Two-Step Design Space Exploration (DSE) strategy:

  1. Sub-DSE: The framework first identifies a feasible design space by focusing on parameters with the highest impact on execution time, such as array dimensions and loop unrolling factors.
  2. Analytical Modeling: Instead of relying on slow hardware simulations, QuickDough uses mathematical formulas to estimate performance and resource usage. This is possible due to the highly regular and predictable structure of the SCGRA.

Beyond the computational core, the framework also performs Communication Tuning. It optimizes on-chip data buffers (IBuf and OBuf) and batches data transfers between the host CPU and FPGA to minimize the overhead of Direct Memory Access (DMA) transfers, which often act as a system bottleneck.

Performance Evaluation

The framework was evaluated on a Xilinx Zedboard (featuring an ARM Cortex-A9 and a 7-series FPGA) using four standard benchmarks: Matrix Multiplication (MM), FIR Filter, K-means (KM), and Sobel Edge Detector (SE).

Key results include:

  • Efficiency: The customization process completes in just 10 to 20 minutes, which is approximately 100x faster than exhaustive search methods.
  • Speedup: Customized overlays achieved up to a 5x speedup over generic, non-customized versions. When compared to software execution on the ARM processor, the FPGA accelerators delivered up to a 10x total speedup.
  • Predictive Accuracy: The analytical models successfully identified configurations that performed nearly as well as those found through exhaustive search, validating the use of mathematical estimation over simulation.

Conclusion and Future Work

QuickDough demonstrates that the inherent regularity of CGRA overlays can be leveraged to bypass the traditional hurdles of FPGA design. By using analytical models and a structured DSE, it provides high-performance hardware customization in a fraction of the usual time.

Future work will address current limitations, such as memory bandwidth bottlenecks in data-heavy applications like Matrix Multiplication. Potential improvements include more sophisticated on-chip buffer partitioning and exploring the impact of varying implementation frequencies on architectural performance.

Summary updated

BibTeX
@misc{liu2015automatic,
  author = {Cheng Liu and Ho-Cheung Ng and Hayden Kwok-Hay So},
  title = {{Automatic Nested Loop Acceleration on FPGAs Using Soft CGRA Overlay}},
  year = {2015},
  eprint = {1509.00042},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1509.00042},
}
Figure