Accuracy vs. Efficiency: Achieving Both through FPGA-Implementation Aware Neural Architecture Search

Weiwen Jiang, Xinyi Zhang, Edwin Hsing-Mean Sha, Lei Yang, Qingfeng Zhuge, Yiyu Shi, Jingtong Hu

Abstract

Neural Architecture Search (NAS) has revolutionized model design but often ignores hardware constraints, leading to accurate models that are too slow for real-time FPGA deployment. This paper presents FNAS, a hardware-aware NAS framework that integrates latency estimation directly into the search loop. By utilizing a performance abstraction model to prune inefficient architectures before training, FNAS achieves an 11x speedup in search time and produces models up to 10x faster on hardware with minimal accuracy loss.

Introduction: The Gap Between NAS and Hardware

While NAS can discover high-performing neural network architectures, it faces two significant hurdles: extreme computational cost and "hardware blindness." Standard NAS frameworks typically optimize for accuracy, often resulting in models that fail to meet the strict latency requirements of edge devices like FPGAs. Traditionally, hardware optimization happens after the search, which is inefficient. FNAS addresses this by making hardware constraints a primary objective during the search process.

The FNAS Framework

The core innovation of FNAS is the integration of a hardware evaluation tool directly into the reinforcement learning search loop. Instead of training every candidate, FNAS uses a multi-stage performance abstraction model to evaluate hardware feasibility first.

The FNAS framework integrates hardware evaluation (FNAS Tool) directly into the search loop, allowing for early pruning of inefficient architectures.

The framework employs a Hardware-Aware Reward Function. If a candidate architecture's estimated latency exceeds a predefined threshold, it is assigned a negative reward and discarded immediately. This "pruning before training" strategy is the primary driver behind the framework's efficiency, as it avoids wasting GPU resources on architectures that are fundamentally incompatible with the target hardware.

Optimizing for FPGA Constraints

FPGAs have limited on-chip memory, necessitating sophisticated data management. FNAS handles this through three key technical components:

  1. FNAS-Design (Tiling): It determines optimal tiling parameters to balance memory bandwidth and computation.
  2. FNAS-GG (Graph Generator): It constructs a "tile-based task graph" to model complex data dependencies, which is crucial for the irregular architectures often produced by NAS.
  3. FNAS-Sched (Flexible Scheduler): Unlike static schedulers, this component optimizes task sequences to maximize data reuse and minimize pipeline stalls.
FNAS uses a tile-based task graph and a flexible scheduler to optimize data reuse (IFM/OFM) and minimize stalls across processing elements.

By alternating between Output Feature Map (OFM) reuse and Input Feature Map (IFM) reuse across layers, the scheduler significantly reduces expensive off-chip memory accesses.

Key Results

Evaluated on MNIST, CIFAR-10, and ImageNet subsets using a PYNQ (Z7020) FPGA, FNAS demonstrated remarkable improvements over standard NAS:

  • Search Efficiency: The search process was 11.13x faster than standard NAS (e.g., 17 minutes vs. 190 minutes for MNIST).
  • Hardware Performance: Resulting models were 10.94x faster on the actual FPGA hardware.
  • Accuracy Preservation: These gains were achieved with less than 1% accuracy loss compared to unconstrained models.

Conclusion

FNAS demonstrates that hardware awareness is not just a post-processing step but a vital component of the architecture search itself. By pruning the search space based on analytical latency models, FNAS bridges the gap between high-level AI design and low-level hardware implementation, enabling the rapid discovery of models that are both accurate and efficient.

Summary updated

BibTeX
@inproceedings{jiang2019accuracy,
  author = {Weiwen Jiang and Xinyi Zhang and Edwin Hsing-Mean Sha and Lei Yang and Qingfeng Zhuge and Yiyu Shi and Jingtong Hu},
  title = {{Accuracy vs. Efficiency: Achieving Both through FPGA-Implementation Aware Neural Architecture Search}},
  booktitle = {DAC},
  year = {2019},
  doi = {10.1145/3316781.3317757},
}
Figure