FastWave: Accelerating Autoregressive Convolutional Neural Networks on FPGA

Shehzeen Hussain, Mojan Javaheripi, Paarth Neekhara, Ryan Kastner, Farinaz Koushanfar · DOI

Abstract

Autoregressive convolutional neural networks (CNNs), such as WaveNet, are state-of-the-art for sequence generation tasks like high-fidelity audio synthesis. However, their sequential inference process is notoriously slow on traditional hardware. This paper introduces FastWave, the first specialized FPGA accelerator for autoregressive CNNs. By implementing hardware-specific optimizations—including cyclic buffers for convolutional queues, a two-level parallel matrix-multiplication engine, and an all-on-chip memory strategy—FastWave achieves significant performance gains. Our implementation on a Xilinx XCVU13P FPGA delivers an 11x speedup over high-end GPUs and a 66x speedup over CPUs, while maintaining high audio quality through optimized fixed-point arithmetic.

Introduction: The Inference Bottleneck

WaveNet and similar models generate sequences one element at a time, where each output depends on the entire history of previously generated samples. While this causal dependency ensures natural-sounding output, it prevents the massive parallelization typically exploited by GPUs. Even with algorithmic optimizations like "Fast-WaveNet," which uses queues to store intermediate states, a high-end GPU requires approximately 120 seconds to generate just one second of audio. This latency is a major barrier for real-time applications like voice assistants or live translation.

The FastWave Architecture

FastWave addresses these challenges by co-designing the hardware architecture with the autoregressive algorithm. The system offloads the inference task to an FPGA, utilizing a custom-designed pipeline that minimizes data movement and maximizes throughput.

System architecture of FastWave, showing the transition from GPU training to FPGA inference with on-chip memory and convolutional queues.

Key Technical Innovations

  1. Cyclic Queue Buffer Units: In software, managing the convolutional queues involves expensive data shifting. FastWave implements these as circular buffers in hardware. By overwriting single memory addresses instead of shifting entire arrays, the design drastically reduces the latency associated with "push" and "pop" operations.
  2. Two-Level Parallel Matrix-Multiplication Engine (MME): To handle the heavy computational load of the 28-layer network, we designed a fully parameterized MME. It exploits parallelism at two levels: across rows of the weight matrix and within individual dot-product operations (MAC units). This flexibility allows for per-layer fine-tuning to balance resource usage and speed.
The two-level parallel matrix-multiplication engine, illustrating parallelism across weight matrix rows and within dot-product operations.
  1. On-Chip Memory and Fixed-Point Optimization: To bypass the "memory wall" of off-chip RAM, the entire model is housed within the FPGA's BRAM and URAM. Furthermore, the transition from 32-bit floating-point to a customized 27-bit fixed-point representation (ap_fixed<27,8>) optimizes hardware resources without a perceptible loss in audio quality (MSE of 0.006).

Performance Evaluation

FastWave was evaluated against a "golden" reference model implemented in TensorFlow. The FPGA implementation achieved a generation throughput of 1475.2 Hz, reducing the time to generate one second of audio from 120 seconds on a GPU to just 11 seconds.

Platform Speedup vs. CPU Speedup vs. GPU Power Efficiency
CPU (NumPy) 1x - Low
GPU (Titan Xp) 6x 1x 70W
FastWave (FPGA) 66x 11x 23W

While FastWave is not yet real-time (which requires 16,000 Hz for standard audio), it represents a massive leap in efficiency and speed, narrowing the gap significantly compared to general-purpose processors.

Conclusion and Future Work

FastWave demonstrates that FPGAs are uniquely suited for the sequential, memory-intensive nature of autoregressive CNNs. By rethinking data structures as hardware primitives and maximizing on-chip data locality, we achieved order-of-magnitude improvements in both speed and power efficiency. Future research will focus on model pruning and multi-FPGA scaling to reach the 16kHz real-time synthesis threshold.

Summary updated

BibTeX
@inproceedings{hussain2019fastwave,
  author = {Shehzeen Hussain and Mojan Javaheripi and Paarth Neekhara and Ryan Kastner and Farinaz Koushanfar},
  title = {{FastWave: Accelerating Autoregressive Convolutional Neural Networks on FPGA}},
  booktitle = {ICCAD},
  year = {2019},
  doi = {10.1109/iccad45719.2019.8942122},
}
Figure