Efficient Task Transfer for HLS DSE

Zijian Ding, Atefeh Sohrabizadeh, Weikai Li, Zongyue Qin, Yizhou Sun, Jason Cong

Introduction

High-Level Synthesis (HLS) has transformed hardware design by allowing developers to use high-level languages like C/C++ instead of Register-Transfer Level (RTL) languages. Central to this process is Design Space Exploration (DSE), where designers use compiler directives, or "pragmas," to optimize hardware performance through techniques like loop unrolling and pipelining. However, the rapid evolution of HLS toolchains—such as Xilinx Vitis—presents a significant challenge: a pragma configuration optimized for one version may perform poorly or fail in a newer version. This phenomenon, known as "label shift," often forces designers to restart the time-consuming DSE process from scratch.

This paper introduces Active-CEM, a framework designed to efficiently transfer knowledge across toolchain versions. By combining toolchain-invariant neural modeling with an active learning-based explorer, Active-CEM significantly reduces the computational overhead of finding optimal designs in new environments.

The Challenge: Label Shift and Synthesis Bottlenecks

The primary bottleneck in HLS DSE is the time required for synthesis, which can range from minutes to several hours per design point. When a toolchain is updated, the performance landscape changes. A configuration that was optimal in Vitis 2020.2 might be suboptimal in Vitis 2021.1 due to changes in the underlying optimization passes or resource mapping strategies. Traditional DSE methods fail to account for these shifts, leading to wasted compute cycles and delayed time-to-market. We need a way to "transfer" knowledge from old toolchains to new ones without restarting the search from zero.

Methodology: The Active-CEM Framework

The authors propose a two-pronged strategy to address the transfer learning problem: Toolchain-Invariant Modeling and the Active-CEM explorer.

1. Toolchain-Invariant Modeling (Inv-Hybrid)

The core of the predictive model is a neural network architecture that decouples the representation of a hardware design into two distinct components:

  • Shared Embeddings: These capture the fundamental logic of the C++ program, which remains constant regardless of the tool version.
  • Private Embeddings: These capture the version-specific implementation details and quirks of a particular toolchain.

By training on data from multiple versions simultaneously, the "Inv-Hybrid" model learns to identify invariant features, allowing it to adapt to a new toolchain version with very few new samples.

2. Active Learning and the Cross-Entropy Method (CEM)

To navigate the design space, the framework employs the Cross-Entropy Method (CEM). Unlike genetic algorithms, CEM maintains a probability distribution over the design space and iteratively shifts this distribution toward high-performance regions.

To maintain sample efficiency, the framework incorporates an Active Learning Loop. Instead of verifying every design suggested by the model, the explorer uses K-Means clustering to select a diverse subset of designs for actual HLS synthesis. This ensures that the model is fine-tuned on the most informative data points, preventing it from becoming trapped in regions where its predictions are over-optimistic but inaccurate.

3. Design Space Pruning

The authors also implemented a conservative heuristic to prune the search space. By identifying pragmas (such as "TILE") that consistently underperform across previous toolchain versions, the explorer can focus its resources on more promising optimization directives.

Experimental Evaluation

The researchers evaluated Active-CEM using the HLSyn benchmark, comprising 40 kernels across domains like linear algebra and data analytics. Transfers were tested between three versions of AMD Xilinx Vitis HLS (2020.2, 2021.1, and 2023.2) targeting the Xilinx U200 FPGA at 250MHz.

Key Results

  • Performance Boost: Active-CEM identified designs that were 1.58× faster on average than those found by AutoDSE and 1.2× faster than HARP.
  • Efficiency: The framework achieved a 5.26× improvement in sample efficiency, requiring significantly fewer HLS synthesis runs to reach optimal results.
  • Search Time: Total exploration time was reduced by 2.7× compared to AutoDSE, bringing the search down to roughly 9 hours.
  • Accuracy: The Inv-Hybrid model reduced prediction error (RMSE) by 11% compared to standard transfer learning approaches.

Discussion and Future Work

The success of Active-CEM highlights that while toolchain performance fluctuates, the underlying hardware structure of a program is largely invariant. Decoupling these elements is essential for robust transfer learning.

However, limitations remain. The model occasionally struggled with resource estimation for complex kernels (e.g., mvt-med and adi), leading to suggested designs that exceeded FPGA capacity or caused tool timeouts. Future research may focus on integrating local search strategies to refine global CEM results and extending the framework to handle transfers between different hardware devices rather than just toolchain versions.

Conclusion

Active-CEM provides a robust solution to the "label shift" problem in HLS DSE. By leveraging toolchain-invariant features and active learning, it allows designers to navigate the evolving landscape of hardware compilers with unprecedented speed and efficiency.

Summary updated

BibTeX
@inproceedings{ding2024efficient,
  author = {Zijian Ding and Atefeh Sohrabizadeh and Weikai Li and Zongyue Qin and Yizhou Sun and Jason Cong},
  title = {{Efficient Task Transfer for HLS DSE}},
  booktitle = {ICCAD},
  year = {2024},
}
Figure