DCP: Learning Accelerator Dataflow for Neural Network via Propagation

Peng Xu, Wenqi Shao, Mingyu Ding, Ping LuoarXiv 2024 · DOI

Optimizing Deep Neural Network (DNN) accelerators requires finding efficient "dataflows"—the strategies for partitioning data across memory, managing parallel computation, and ordering operations. Traditional search methods are often slow, manual, or rely on computationally expensive black-box algorithms. This paper introduces Dataflow Code Propagation (DCP), a novel framework that treats hardware mapping as a differentiable optimization problem, enabling the discovery of optimal configurations in seconds.

The Challenge of Dataflow Optimization

Modern DNN accelerators like TPUs or NPUs derive their speed from specialized dataflows. However, the search space for a single layer can reach $O(10^{36})$, making exhaustive search impossible. Current approaches typically fall into two categories: hand-crafted designs that lack flexibility, or search-based methods (like Genetic Algorithms) that require thousands of slow hardware simulations. DCP addresses this by transforming the discrete search problem into a continuous, differentiable one.

The DCP Framework

The authors propose a three-step pipeline to automate and accelerate the search process:

  1. Unified Encoding: Complex hardware configurations—including parallelism, computation order, and tile sizes—are translated into a fixed-length vector called a "dataflow code." This turns a structural engineering problem into a numerical representation problem.
  2. Neural Predictor: A lightweight attention-based network is trained to predict hardware metrics (latency, energy, and power) given a DNN layer description and a dataflow code.
  3. Optimization via Propagation: Once the predictor is trained, its weights are frozen. To find the best dataflow, the system starts with a random code and uses backpropagation to calculate the gradient of the predicted cost with respect to the input code. The code is then iteratively updated to minimize the cost.
The DCP optimization pipeline: using backpropagation through a frozen neural predictor to refine dataflow codes.

Experimental Results

The method was evaluated using a new benchmark of 2,000 DNN layers sampled from torchvision (including ResNet and ViT) and validated against the MAESTRO hardware simulator.

Superior Efficiency and Speed

DCP-optimized dataflows significantly outperformed industry-standard designs like NVDLA, Eyeriss, and ShiDianNao. Across MobileNet-V2, ResNet101, and Vision Transformers (ViT), DCP achieved a much lower Energy-Delay Product (EDP). Furthermore, while traditional genetic algorithms might take hours to converge, DCP finds optimal solutions in just seconds.

Performance comparison (EDP) of DCP against industry-standard accelerators and a visualization of the learned dataflow patterns versus Eyeriss.

Key Insights

  • Differentiable Design: By learning a continuous proxy for hardware performance, DCP leverages gradient-based optimization—the same engine behind AI training—to design the hardware mapping itself.
  • Data Efficiency: DCP is remarkably "data-thrifty," finding better solutions with only 2,000 samples than competing methods can find with much larger search budgets.
  • Reduced I/O: In a case study on ResNet101, the DCP-learned dataflow reduced memory read/writes to just 18.9% of those required by the Eyeriss dataflow.

Conclusion and Future Work

DCP represents a shift toward automated, differentiable hardware-software co-design. While currently reliant on the accuracy of simulators like MAESTRO, future iterations could incorporate more complex physical constraints such as heat dissipation and routing congestion. By bridging the gap between discrete hardware parameters and continuous optimization, DCP paves the way for highly specialized, efficient AI deployment at scale.

Summary updated

BibTeX
@misc{xu2024dcp,
  author = {Peng Xu and Wenqi Shao and Mingyu Ding and Ping Luo},
  title = {{DCP: Learning Accelerator Dataflow for Neural Network via Propagation}},
  year = {2024},
  eprint = {2410.06553},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.06553},
}
Figure