arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.10838cs.LGcs.PL
收藏

ProgSG:面向电子设计自动化中程序的跨模态表示学习

ProgSG: Cross-Modality Representation Learning for Programs in Electronic Design Automation

Yunsheng Bai, Atefeh Sohrabizadeh, Zongyue Qin, Ziniu Hu, Yizhou Sun, Jason Cong

AI总结:

针对 HLS 程序需融合代码与 CDFG 的问题,本文提出 ProgSG,利用编译器提供的细粒度对齐实现序列与图模态深度交互,并通过数据流分析任务预训练,在两个基准上优于基线。

摘要:

近年来,领域专用加速器(DSA),例如 Google 的 TPU,在加速深度学习、搜索、自动驾驶等各类应用方面日益普及。为了促进 DSA 设计,人们使用高层次综合(HLS),它允许开发者将以 C 和 C++ 软件代码形式给出的高层次描述编译为低层次硬件描述语言(例如 VHDL 或 Verilog)中的设计,并最终综合到 ASIC(专用集成电路)或 FPGA(现场可编程门阵列)上的 DSA 中。然而,现有的 HLS 工具仍然需要作出微体系结构决策,这些决策以 pragma(例如并行化和流水线化指令)的形式表达。为了让更多人能够设计 DSA,希望借助深度学习预测 HLS 设计质量,从而使此类决策自动化。这要求我们更深入地理解由原始代码和 pragma 组合而成的程序。自然地,这些程序可以被视为序列数据,大语言模型(LLM)能够对此提供帮助。此外,这些程序可以被编译并转换为控制数据流图(CDFG),并且编译器还提供代码 token 与 CDFG 节点之间的细粒度对齐。然而,现有工作要么未能同时利用两种模态,要么以浅层或粗糙的方式将二者结合。我们提出 ProgSG,使源代码序列模态和图模态能够以深入且细粒度的方式相互交互。为缓解标注设计的稀缺性,本文基于一组编译器数据流分析任务提出了一种预训练方法。在两个基准数据集上的实验结果表明,相较于那些只考虑单一模态,或者结合两种模态却未利用对齐信息的基线方法,ProgSG 具有优越性。

英文摘要:

Recent years have witnessed the growing popularity of domain-specific accelerators (DSAs), such as Google's TPUs, for accelerating various applications such as deep learning, search, autonomous driving, etc. To facilitate DSA designs, high-level synthesis (HLS) is used, which allows a developer to compile a high-level description in the form of software code in C and C++ into a design in low-level hardware description languages (such as VHDL or Verilog) and eventually synthesized into a DSA on an ASIC (application-specific integrated circuit) or FPGA (field-programmable gate arrays). However, existing HLS tools still require microarchitecture decisions, expressed in terms of pragmas (such as directives for parallelization and pipelining). To enable more people to design DSAs, it is desirable to automate such decisions with the help of deep learning for predicting the quality of HLS designs. This requires us a deeper understanding of the program, which is a combination of original code and pragmas. Naturally, these programs can be considered as sequence data, for which large language models (LLM) can help. In addition, these programs can be compiled and converted into a control data flow graph (CDFG), and the compiler also provides fine-grained alignment between the code tokens and the CDFG nodes. However, existing works either fail to leverage both modalities or combine the two in shallow or coarse ways. We propose ProgSG allowing the source code sequence modality and the graph modalities to interact with each other in a deep and fine-grained way. To alleviate the scarcity of labeled designs, a pre-training method is proposed based on a suite of compiler's data flow analysis tasks. Experimental results on two benchmark datasets show the superiority of ProgSG over baseline methods that either only consider one modality or combine the two without utilizing the alignment information.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑