一句话:提出基于 e-graph 重写的 HLS 超优化工具流 SEER,自动探索等价实现并将软件程序改写为高效 HLS 代码,性能最高提升 38×。
高层次综合(HLS)能将高层语言程序自动翻译为底层硬件描述,但其生成的设计与手工实现相比仍存在显著性能差距,原因在于输入程序往往仍需按硬件设计原则书写;现有技术要么不改动源码,要么执行固定序列的源码变换,可能错失最优设计。本文提出一种面向 HLS 的超优化方法,自动将任意软件程序重写为可生成优化硬件设计的高效 HLS 代码。作者实现了工具流 SEER,基于 e-graph 数据结构高效地在大规模上探索程序的等价实现,并提供可扩展框架来编排现有软件编译器 pass 与硬件优化器;这也是首次在 MLIR 等大型软件编译框架中利用 e-graph 重写。在一组开源基准上,SEER 在面积不超过原程序 1.4× 的前提下实现最高 38× 的性能提升;通过 Intel 提供的案例研究,还展示了超越硬件专家手工优化设计的潜力。
High-level synthesis (HLS) is a process that automatically translates a software program in a high-level language into a low-level hardware description. However, the hardware designs produced by HLS tools still suffer from a significant performance gap compared to manual implementations. This is because the input HLS programs must still be written using hardware design principles. Existing techniques either leave the program source unchanged or perform a fixed sequence of source transformation passes, potentially missing opportunities to find the optimal design. We propose a super-optimization approach for HLS that automatically rewrites an arbitrary software program into efficient HLS code that can be used to generate an optimized hardware design. We developed a toolflow named SEER, based on the e-graph data structure, to efficiently explore equivalent implementations of a program at scale. SEER provides an extensible framework, orchestrating existing software compiler passes and hardware optimizers. Our work is the first attempt to exploit e-graph rewriting for large software compiler frameworks, such as MLIR. Across a set of open-source benchmarks, we show that SEER achieves up to 38× the performance within 1.4× the area of the original program. Via an Intel-provided case study, SEER demonstrates the potential to outperform manually optimized designs produced by hardware experts.
@inproceedings{ChengCCBD24,
title = {SEER: Super-Optimization Explorer for High-Level Synthesis using E-graph Rewriting},
author = {Jianyi Cheng and Samuel Coward and Lorenzo Chelini and Rafael Barbalho and Theo Drane},
booktitle = {ASPLOS},
year = {2024},
doi = {10.1145/3620665.3640392}
}