paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automatic Matching of Legacy Code to Heterogeneous APIs

遗留代码到异构 API 的自动匹配
ASPLOS Proceedings of the Twenty-Third International Conference on Architectural Support for Programming Languages and Operating Systems2018匹配度 2/10 · 论文属于静态程序分析与编译优化,利用约束/idiom 检测将遗留代码映射到异构加速器 API,与 PL 相关;但未涉及机器学习系统、Agentic/LLM 程序、LLM 辅助静态分析、浮点程序分析或贝叶斯程序分析,因此与当前研究画像核心方向仅有边缘交集。引用 28 inbox
Philip Ginsbach, Toomas Remmelg, Michel Steuwer, Bruno Bodin, Christophe Dubach, Michael F. P. O'Boyle
crossref: 2026-09-12

AI 速览

一句话:提出基于约束的 idiom 检测与映射方法,自动将遗留代码匹配到异构加速器 API 与 DSL,实现最高 20 倍加速。

异构加速器虽能提供高性能,但往往需使用厂商优化库或 DSL,要求大量修改遗留代码,阻碍其采用。本文提出自动检测加速机会的方法,聚焦稀疏/稠密线性代数、stencil、广义归约与直方图等有成熟 API 支持的 idiom,用自定义的基于约束的 Idiom Description Language (IDL) 在用户代码中发现它们,并将检测到的 idiom 映射到 BLAS、cuSPARSE、clSPARSE 以及 Halide、Lift 两个 DSL。该方法在 LLVM 中实现,在 NAS 和 Parboil 顺序 C/C++ 基准上评估,共检测到 60 个 idiom 实例;当 idiom 占顺序执行时间显著比例时,生成的代码在集成与外部 GPU 上取得 1.26 倍至 20 倍以上加速。

问题
遗留 C/C++ 代码难以利用异构加速器,因为使用厂商优化库或 DSL 需要大量手工改写,导致异构计算难以推广。
方法
提出用基于约束的 IDL 在 LLVM IR 上静态检测稀疏/稠密线性代数、stencil、广义归约与直方图等 idiom,并将检测结果自动映射到 BLAS、cuSPARSE、clSPARSE 及 Halide、Lift。
评估
在 NAS 和 Parboil 顺序 C/C++ 基准上检测到 60 个 idiom 实例,在 idiom 占比高的程序中生成的代码在集成与外部 GPU 上获得 1.26x 到 20x 以上加速。
原文摘要(Abstract)

Heterogeneous accelerators often disappoint. They provide the prospect of great performance, but only deliver it when using vendor specific optimized libraries or domain specific languages. This requires considerable legacy code modifications, hindering the adoption of heterogeneous computing. This paper develops a novel approach to automatically detect opportunities for accelerator exploitation. We focus on calculations that are well supported by established APIs: sparse and dense linear algebra, stencil codes and generalized reductions and histograms. We call them idioms and use a custom constraint-based Idiom Description Language (IDL) to discover them within user code. Detected idioms are then mapped to BLAS libraries, cuSPARSE and clSPARSE and two DSLs: Halide and Lift. We implemented the approach in LLVM and evaluated it on the NAS and Parboil sequential C/C++ benchmarks, where we detect 60 idiom instances. In those cases where idioms are a significant part of the sequential execution time, we generate code that achieves 1.26x to over 20x speedup on integrated and external GPUs.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot4290,
  title = {Automatic Matching of Legacy Code to Heterogeneous APIs},
  author = {Philip Ginsbach and Toomas Remmelg and Michel Steuwer and Bruno Bodin and Christophe Dubach and Michael F. P. O'Boyle},
  booktitle = {ASPLOS},
  year = {2018},
  doi = {10.1145/3173162.3173182}
}