Stream-HLS: Towards Automatic Dataflow Acceleration

Suhail Basalama, Jason Cong

High-Level Synthesis (HLS) was originally envisioned as a transformative tool for hardware design, enabling software engineers to compile high-level languages like C++ into high-performance FPGA circuits. However, achieving state-of-the-art performance in practice still typically requires deep expertise in hardware constraints. Researchers from UCLA have introduced Stream-HLS, a framework designed to bridge this gap by treating hardware optimization as a global mathematical problem.

The Optimization Challenge

While modern HLS tools like Xilinx Vitis have lowered entry barriers, designing complex systems with multiple interacting tasks (kernels) remains difficult. The authors identify a "triple threat" of conflicting optimizations that must be balanced:

  1. Node-level Pipelining: Optimizing the execution speed of individual loops.
  2. Graph-level Pipelining: Enabling "streaming" where a consumer kernel begins processing data while the producer is still active, rather than waiting for a full buffer transfer.
  3. Node-level Parallelization: Strategically allocating hardware resources (e.g., DSPs) across different tasks.

Existing tools often address these factors in isolation or through simple heuristics. Stream-HLS, however, aims to solve all three simultaneously to avoid local optima that might otherwise degrade global system performance.

System Architecture

Stream-HLS is built upon the Multi-Level Intermediate Representation (MLIR) compiler infrastructure. It provides an end-to-end flow that accepts PyTorch (via Torch-MLIR) or C++ (via Polygeist) and generates optimized Vitis HLS or TAPA code.

The Stream-HLS end-to-end compilation flow.

The framework employs several novel components:

  • Dataflow Canonicalization: Automatically restructures code to ensure data buffers have a single producer and consumer, a prerequisite for high-performance streaming.
  • Analytical Performance Model: A closed-form mathematical model that predicts production and consumption cycles with millisecond latency, bypassing slow hardware simulations.
  • MINLP Optimization: The design space is formulated as a Mixed Integer Nonlinear Programming (MINLP) problem. By using a professional solver (Gurobi), the tool finds the mathematically optimal combination of loop permutations and tiling factors to minimize latency within a given resource budget.

The Power of Global Optimization

A central insight of the research is that loop order dictates communication. The sequence of nested loops determines the order of data production; if this does not match the consumer's required read order, the system must fall back to slow, sequential memory buffers instead of efficient FIFOs. Stream-HLS may intentionally select a slower local loop schedule if it enables superior graph-level overlap.

Impact of loop permutations and parallelization on execution cycles.

As shown in the figure above, moving from sequential execution (a) to adaptive parallelization with optimized loop permutations (f) can reduce the cycle count from ~3.5 million to ~1.1 million for the same workload.

Results and Impact

The framework was evaluated on an AMD Alveo U280 FPGA using benchmarks ranging from Polybench kernels to Deep Learning components like Transformer sub-layers. Key findings include:

  • Superior Performance: Stream-HLS outperformed automated state-of-the-art (SOTA) tools like POM and ScaleHLS by geometric means of 79.43x and 16.13x, respectively.
  • Expert-Level Design: It surpassed manually optimized designs from expert frameworks like HeteroCL by 10.62x, demonstrating that the design space is often too complex for manual navigation.
  • High Fidelity: The analytical model showed a 0.99x correlation with actual RTL simulation cycles.
  • Search Efficiency: The Design Space Exploration (DSE) process was 176x faster than HIDA, a recent SOTA competitor.

Conclusion

Stream-HLS represents a significant step toward truly automatic FPGA acceleration. While currently focused on on-chip memory and affine programs, it proves that global mathematical optimization can unlock performance levels previously reserved for manual hardware experts. Future work will look to incorporate off-chip memory bandwidth constraints and support for irregular applications like graph processing.

Summary updated

BibTeX
@inproceedings{basalama2025stream,
  author = {Suhail Basalama and Jason Cong},
  title = {{Stream-HLS: Towards Automatic Dataflow Acceleration}},
  booktitle = {FPGA},
  year = {2025},
  doi = {10.1145/3706628.3708878},
}
Figure