Kratos: An FPGA Benchmark for Unrolled DNNs with Fine-Grained Sparsity and Mixed Precision

Xilai Dai, Yuzong Chen, Mohamed S. Abdelfattah

TL;DR

This paper introduces Kratos, a new FPGA benchmark suite designed to evaluate "unrolled" deep neural network (DNN) architectures that exploit fine-grained sparsity and mixed precision. Kratos demonstrates that these unrolled DNNs can achieve high frequencies and significant area reductions on FPGAs, paving the way for more efficient, specialized hardware accelerators.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are increasingly crucial for various applications, but their computational demands are substantial. While GPUs and ASICs dominate DNN inference, they are often optimized for dense computations. However, real-world DNNs exhibit significant fine-grained sparsity (many weights are zero or near-zero) and can tolerate lower numerical precision without a major drop in accuracy. These properties are challenging for traditional accelerators but are a natural fit for FPGAs due to their reconfigurability.

An emerging approach to leverage these properties on FPGAs is "unrolling" DNN computations. This means creating dedicated hardware for each operation within a layer, allowing for the skipping of ineffectual operations. However, naive unrolling can consume excessive FPGA resources, limiting the size of DNNs that can be implemented. This paper addresses the need for a benchmark and architectural exploration to make unrolled DNNs more efficient on FPGAs, specifically by considering sparsity and mixed precision.

Methods

The core contribution is the Kratos benchmark suite. It's a collection of SystemVerilog hardware modules implementing key DNN operations (GEMM and convolution) in an unrolled fashion. Kratos is designed to be:

  • Parameterized and Extensible: Users can easily configure dimensions, sparsity levels (0-1), and numerical precision (bit-width).
  • Human-Readable: The SystemVerilog code is intended to be understandable.
  • Compatible with Multiple CAD Flows: It supports both commercial (Intel Quartus Prime) and academic (VTR) toolchains, facilitating broader research.

The paper also describes a hardware implementation strategy where weights are embedded directly into the logic (LUTs) rather than stored in memory. This, combined with specialization (weights as constants), pruning (skipping zero weights), and quantization (using low bit-widths), drastically reduces area.

Finally, a case study on FPGA architectural exploration is presented, focusing on the impact of Logic Block (LB) LUT size. By using smaller LUTs (e.g., 3-LUTs instead of 6-LUTs), the researchers investigate potential area savings.

Datasets

Not discussed in the paper. The Kratos benchmark is a synthetic benchmark suite designed to evaluate hardware architectures, not trained on specific datasets.

Key Insights and Ideas

  • Unrolled DNNs can hit FPGA frequency limits: The paper shows that heavily pipelined, unrolled DNN implementations can achieve very high clock frequencies, sometimes reaching the maximum reported by the FPGA vendor.
  • Sparsity and low precision offer substantial area savings: The benchmark demonstrates a near-linear reduction in area with increasing sparsity and a super-linear reduction with decreasing bit-width. This confirms that FPGAs can effectively exploit these DNN characteristics.
  • Fine-grained sparsity is key for FPGAs: Unlike structured sparsity which offers limited gains on GPUs, fine-grained, unstructured sparsity on FPGAs allows for significant resource reduction by skipping individual operations.
  • Smaller LUTs are beneficial for unrolled DNNs: The architectural exploration suggests that tailoring FPGA logic blocks to use smaller LUT sizes can lead to significant area reductions (up to 2x) for unrolled DNN workloads. This is because smaller LUTs can better map the specialized computations of unrolled DNNs.
  • The "unrolling" paradigm is promising for FPGAs: By dedicating hardware and exploiting redundancy, unrolled DNNs offer a path to high throughput and efficiency on FPGAs, especially for applications demanding low latency.

Key Results

  • High Frequencies: Unrolled DNNs on Arria 10 GX achieved frequencies in the 300-600 MHz range, with some reaching over 1 GHz (vendor timing report).
  • Area Reduction:
    • Fine-grained sparsity and low bit-width led to significant area savings. For example, reducing precision from 8-bit to 4-bit for an 8-bit conv2d-FU-L plot resulted in a 2.9x area decrease.
  • The architectural case study showed up to a ~2x area reduction by using smaller LUT sizes (K=3) compared to the default (K=6).
  • Benchmark Compatibility: Kratos was successfully synthesized and evaluated using both Intel Quartus Prime and the VTR toolchain, with resource utilization reporting within a ±10% variation.

Limitations and Future Work

  • Scalability of Unrolled Implementations: While Kratos demonstrates efficiency, fully unrolling large DNNs still faces capacity limits on current FPGAs.
  • Architectural Specialization: The paper advocates for further exploration of new programmable architectures specifically designed for unrolled DNNs, potentially leading to even greater efficiency gains (10-100x).
  • Algorithmic Optimizations: Future work could explore techniques like weight sharing and time-domain multiplexing to increase the effective size of DNNs that can be mapped to these specialized architectures.
  • Accuracy-Efficiency Tradeoffs: While the benchmark shows hardware efficiency, further studies are needed to explore the interplay between pruning, quantization, and DNN accuracy.

Summary updated

Abstract

FPGAs offer a flexible platform for accelerating deep neural network (DNN) inference, particularly for non-uniform workloads featuring fine-grained unstructured sparsity and mixed arithmetic precision. To leverage these redundancies, an emerging approach involves partially or fully unrolling computations for each DNN layer. That way, parameter-level and bit-level ineffectual operations can be completely skipped, thus saving the associated area and power. Regardless, unrolled implementations scale poorly and limit the size of a DNN that can be unrolled on an FPGA. This motivates the investigation of new reconfigurable architectures to improve the efficiency of unrolled DNNs, while taking advantage of sparsity and mixed precision. To enable this, we present Kratos: a focused FPGA benchmark of unrolled DNN primitives with varying levels of sparsity and different arithmetic precisions. Our analysis reveals that unrolled DNNs can operate at very high frequencies, reaching the maximum frequency limit of an Arria 10 device. Additionally, we found that substantial area reductions can be achieved through fine-grained sparsity and low bit-width. We build on those results to tailor the FPGA fabric for unrolled DNNs through an architectural case study demonstrating $\sim$2$\times$ area reduction when using smaller LUT sizes within current FPGAs. This paves the way for further exploration of new programmable architectures that are purpose-built for sparse and low-precision unrolled DNNs. Our source code and benchmark are available on github.com/abdelfattah-lab/Kratos-benchmark.
BibTeX
@inproceedings{dai2024kratos,
  author = {Xilai Dai and Yuzong Chen and Mohamed S. Abdelfattah},
  title = {{Kratos: An FPGA Benchmark for Unrolled DNNs with Fine-Grained Sparsity and Mixed Precision}},
  booktitle = {FPL},
  year = {2024},
  doi = {10.1109/fpl64840.2024.00030},
}

Loading related content...

Figure