High-Level Synthesis (HLS) was supposed to make hardware design as easy as writing C++. While it has certainly improved productivity, achieving peak performance on FPGAs still feels like a "black art." Developers often spend weeks manually tweaking pragmas, tiling factors, and memory layouts to balance complex dataflow pipelines.
A new paper from researchers at the University of Illinois Urbana-Champaign introduces HIDA, a hierarchical dataflow compiler that aims to take the "manual" out of manual labor. By systematically modeling and optimizing dataflow at multiple levels of abstraction, HIDA outperforms both state-of-the-art automated tools and even hand-tuned expert designs.
TL;DR
HIDA is a scalable HLS framework that automates the optimization of hierarchical dataflow architectures. By using a two-level Intermediate Representation (IR) and an "intensity-aware" optimizer, it achieves up to 8.54× higher throughput than current state-of-the-art HLS tools and 1.29× higher throughput than hand-tuned RTL-based neural network accelerators.
What Problem Does This Paper Address?
Modern hardware accelerators rely on dataflow architectures to bypass the "memory wall" of traditional Von Neumann systems. Instead of constantly fetching data from slow external RAM, dataflow tasks pass information directly to one another through on-chip buffers or streams.
However, designing these systems is incredibly difficult for two reasons:
- Tight Coupling: The performance of a dataflow pipeline is limited by its slowest task (the bottleneck). To optimize the system, you must balance the latency of every single task simultaneously.
- Complexity at Scale: As designs grow (e.g., deep neural networks), the design space—combinations of parallelization, tiling, and memory layouts—becomes astronomically large.
Existing HLS tools either require the user to make these hard decisions manually or use "flat" optimization strategies that fail to capture the hierarchical nature of complex hardware.
Methods
HIDA tackles these challenges through a specialized compiler stack built on MLIR (Multi-Level Intermediate Representation). Its core innovations are:
1. HIDA-IR: A Two-Level Representation
HIDA splits the hardware description into two layers:
- Functional Dataflow: A high-level view where tasks are "transparent." This allows the compiler to easily fuse or split tasks to balance workloads without worrying about low-level hardware details.
- Structural Dataflow: A low-level view that captures the "physical" reality of the hardware, including specific memory ports, AXI interfaces, and timing-sensitive scheduling.
2. HIDA-OPT: The Automated Optimizer
The optimizer performs several sophisticated transformations:
- Multi-producer Elimination: It detects when multiple tasks are trying to write to the same buffer (which forces sequential execution) and automatically duplicates buffers or fuses nodes to restore parallel pipelining.
- Data Path Balancing: If one data path is shorter than another (common in networks like ResNet), HIDA inserts "Soft FIFOs"—virtual buffers in external memory—to ensure the faster path doesn't have to idle.
- IA+CA Parallelization: This is HIDA’s "secret sauce." It uses Intensity-Aware (IA) analysis to give more compute resources to the heaviest tasks and Connection-Aware (CA) analysis to ensure that the parallelization of one task matches the memory layout of the next.
Datasets
The authors evaluated HIDA using two primary benchmarks:
- PolyBench: A standard suite of C++ kernels covering linear algebra, data mining, and stencils (e.g.,
2mm,atax,correlation). - Deep Learning Models: A set of PyTorch-modeled neural networks, including ResNet-18, MobileNet, ZFNet, VGG-16, YOLO, and MLP. These represent large-scale, hierarchical dataflow problems.
Key Insights and Ideas
- Hierarchy is Essential: By separating functional intent from structural implementation, HIDA can perform global optimizations (like task fusion) that "flat" compilers miss.
- Heuristics Aren't Enough: The authors showed that standard HLS heuristics often prune away the best design points. HIDA’s automated search found a configuration for LeNet that was faster than what an exhaustive search of "standard" parameters could find.
- Streaming vs. Buffering: Unlike previous tools (like ScaleHLS) that try to keep all intermediate data on-chip (consuming massive amounts of BRAM), HIDA supports sophisticated tiling and external memory streaming. This allowed them to reduce on-chip memory usage by over 75× in some cases.
Key Results
- Vs. State-of-the-Art HLS (ScaleHLS): HIDA achieved an average of 1.29× speedup on C++ kernels and a massive 8.54× average throughput improvement on DNN models.
- Vs. Hand-Tuned RTL (DNNBuilder): Even though DNNBuilder uses specialized, human-designed RTL IPs, HIDA’s automated compiler produced designs with 1.29× higher throughput and 1.07× better DSP efficiency.
- Productivity: For a LeNet accelerator, an expert took 40 hours to design a solution. HIDA generated a superior design in just 9.9 minutes.
Limitations and Future Work
While HIDA is a major step forward, the authors note some areas for growth:
- Back-end Dependency: HIDA still relies on downstream tools (like AMD Vitis HLS) to generate the final RTL. Any inefficiencies in those tools' handling of low-level logic can still impact the final result.
- Dynamic Dataflow: Currently, HIDA focuses on static dataflow (where execution patterns are known at compile time). Handling dynamic workloads with variable execution times remains an open challenge.
- Broader Patterns: The current task fusion patterns are pre-defined; expanding the library of "profitable" patterns would allow HIDA to handle even more diverse algorithmic structures.
Summary updated