arXiv:2409.13138cs.LGcs.AI2024-09被引 10

用对比学习提升硬件设计优化,让自动综合更高效准确。

Learning to Compare Hardware Designs for High-Level Synthesis

  • 通过成对偏好与性能预测结合的混合损失,学习设计优劣关系。
  • 在多个基准上排名指标超越现有最佳方法,生成高质量硬件设计。
  • 适合需要快速优化硬件加速器的工程师和研究者使用。

高层次综合(HLS)将高级代码自动转换为硬件设计,加速硬件加速器开发。其依赖插入源码中的指令(pragmas)来引导综合过程,而这些指令的设置显著影响最终硬件性能。现有基于机器学习的HLS方法如HARP,通常先训练图神经网络模型,再进行设计空间探索(DSE),通过模型对候选设计排序并返回最优结果。然而,传统DSE面临参数设置与性能间高度非线性、多指令间复杂交互等挑战。为此,本文提出compareXplore,一种学习比较硬件设计的新方法。该方法采用混合损失函数,融合成对偏好学习与点式性能预测,使模型同时捕捉相对偏好与绝对性能。引入节点差异注意力模块,聚焦于设计间关键差异,识别影响性能的核心指令。采用两阶段DSE:先用点式预测模型粗筛设计,再通过成对比较精确验证性能。大量实验表明,compareXplore在排名指标上显著优于现有最先进方法,并生成高质量的HLS结果。

原文摘要 · Abstract (English)

High-level synthesis (HLS) is an automated design process that transforms high-level code into hardware designs, enabling the rapid development of hardware accelerators. HLS relies on pragmas, which are directives inserted into the source code to guide the synthesis process, and pragmas have various settings and values that significantly impact the resulting hardware design. State-of-the-art ML-based HLS methods, such as HARP, first train a deep learning model, typically based on graph neural networks (GNNs) applied to graph-based representations of the source code and pragmas. They then perform design space exploration (DSE) to explore the pragma design space, rank candidate designs using the model, and return the top designs. However, traditional DSE methods face challenges due to the highly nonlinear relationship between pragma settings and performance metrics, along with complex interactions between pragmas that affect performance in non-obvious ways. To address these challenges, we propose compareXplore, a novel approach that learns to compare hardware designs for effective HLS optimization. CompareXplore introduces a hybrid loss function that combines pairwise preference learning with pointwise performance prediction, enabling the model to capture both relative preferences and absolute performance. Moreover, we introduce a novel node difference attention module that focuses on the most informative differences between designs, enabling the model to identify critical pragmas impacting performance. CompareXplore adopts a two-stage DSE, where a pointwise prediction model is used for the initial design pruning, followed by a pairwise comparison stage for precise performance verification. In extensive experiments, compareXplore achieves significant improvements in ranking metrics and generates high-quality HLS results for the selected designs, outperforming the existing SOTA method.

硬件优化机器学习综合算法

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。