Specialized Accelerators and Compiler Flows: Replacing Accelerator APIs with a Formal Software/Hardware Interface

Bo-Yuan Huang, Steven Lyubomirsky, Yi Li, Mike He, Thierry Tambe, Gus Henry Smith, Akash Gaonkar, Vishal Canumalla, Gu-Yeon Wei, Aarti Gupta, Zachary Tatlock, Sharad MalikarXiv 2022

Introduction

The development of specialized hardware accelerators is currently a "siloed" process. While hardware design tools have matured, testing a new design on a real-world application—such as a full ResNet model—remains prohibitively difficult. This difficulty stems from a persistent gap: every time a hardware design changes, the software stack, including the compiler and the simulator, must be manually updated.

Current state of accelerator evaluation: a majority of research relies on synthetic workloads rather than end-to-end application testing.

As a result, many researchers evaluate their designs only on synthetic workloads or isolated kernels. This approach often hides critical system-level issues, such as numerical precision errors that cascade across layers or bottlenecks in data movement, until it is too late and too expensive to fix the hardware.

The 3LA Methodology

To bridge this gap, the 3LA (Application-Level Validation of Accelerator Designs) methodology introduces a formal software/hardware interface for accelerators, analogous to how an Instruction Set Architecture (ISA) works for CPUs.

The 3LA flow: leveraging ILA specifications and flexible matching to automate the path from application source to accelerated execution.

3LA relies on three primary pillars:

  1. Instruction-Level Abstraction (ILA): Rather than treating an accelerator as a black box, 3LA defines it as a set of instructions with formal semantics. This serves as a "single source of truth" used to automatically generate a functional simulator.
  2. Flexible Matching: Traditional compilers rely on "exact matching," failing if code structure (like tensor reshapes) differs even slightly from expected patterns. 3LA uses equality saturation (via the egg library) to explore a massive space of mathematically equivalent program versions, allowing the compiler to "discover" offload opportunities that are not syntactically obvious.
  3. Automated Co-Simulation: By combining the auto-generated ILA simulator with a standard host CPU simulator, 3LA enables "software-like" debugging. Designers can run full applications to observe how custom numerics or memory layouts affect final outputs early in the design cycle.

Key Insights and Results

The authors evaluated 3LA using six diverse Deep Learning (DL) applications (including EfficientNet, Transformer, and ResNet) across three accelerators: FlexASR (NLP), HLSCNN (CNN), and VTA (tensor operations).

Semantic vs. Syntactic Matching

The paper demonstrates that flexible matching is essential for modern models. For instance, in a Transformer model, 3LA identified 66 offload opportunities for FlexASR, whereas a standard compiler found zero because the code structure did not perfectly match the expected API pattern.

Catching "Silent" Numerical Bugs

A significant finding involved a flaw in the HLSCNN accelerator. While unit tests passed, running a full MobileNet-V2 model revealed that accuracy plummeted to 10% due to 8-bit quantization lacking sufficient dynamic range. Using 3LA, the team quickly identified the issue and implemented a fix in the ILA spec—expanding the internal representation to 16-bit fixed-point—which recovered accuracy to ~91%.

Efficiency Gains

3LA's ILA-based simulators provided a 30x speedup over traditional Register Transfer Level (RTL) simulation (e.g., Verilator). This performance boost makes end-to-end testing of large image batches feasible during the design phase rather than after fabrication.

Limitations and Future Work

While 3LA automates stack updates, the initial creation of the ILA specification and mapping rules still requires manual effort. Additionally, the current prototype focuses on selection (what to offload) rather than scheduling (optimal tiling and loop ordering). Future research aims to expand these techniques beyond Deep Learning into domains like graph processing and signal processing.

Summary updated

BibTeX
@misc{huang2022specialized,
  author = {Bo-Yuan Huang and Steven Lyubomirsky and Yi Li and Mike He and Thierry Tambe and Gus Henry Smith and Akash Gaonkar and Vishal Canumalla and Gu-Yeon Wei and Aarti Gupta and Zachary Tatlock and Sharad Malik},
  title = {{Specialized Accelerators and Compiler Flows: Replacing Accelerator APIs with a Formal Software/Hardware Interface}},
  year = {2022},
  url = {https://openreview.net/forum?id=uc16C68LeK},
}

Loading related content...

Figure