paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Dynamic Generation of Python Bindings for HPC Kernels

为 HPC 内核动态生成 Python 绑定
ASE 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)2021匹配度 2/10 · 该论文研究通过静态头文件分析与运行时类型信息自动生成 C/C++ HPC 内核的 Python 绑定,属于编译/代码生成与 HPC 互操作方向;虽涉及静态分析,但并非用于机器学习系统或 Agentic 程序,也不涉及 LLM/Agent 改进静态分析、浮点程序分析或贝叶斯程序分析。引用 3 inbox
Steven Zhu, Nader AlAwar, Mattan Erez, Milos Gligoric
crossref: 2026-09-12

AI 速览

一句话:WayOut 通过静态头文件分析与运行时类型信息,自动为 C/C++ HPC 内核生成 Python 绑定层。

高性能内核(HPK)通常用 C/C++、Fortran 等静态类型语言编写,而科学家近年倾向用 Python 进行应用原型开发,这导致 Python 应用与现有 HPK 之间出现鸿沟:要么重新实现内核,要么手工编写连接层,均需大量开发努力。本文提出 WayOut,自动为从 Python 调用、用 C/C++ 编写的 HPK 生成完整连接层。WayOut 采用混合分析:静态分析头文件以生成 Python 包装类与函数,并动态生成这些内核的绑定;借助运行时可得类型信息,它只生成必要的绑定。作者将数十个现有 C/C++ 示例改写为 Python 并利用 WayOut 启用的 HPK 进行评估,实验表明该技术可行,且 HPK 性能开销可忽略。

问题
Python 动态语言应用与 C/C++/Fortran 等静态类型高性能内核之间存在互操作鸿沟,重实现或手写连接层成本高、拖慢科研进度。
方法
WayOut 执行混合分析:静态解析 C/C++ 头文件生成 Python 包装类与函数,并在运行时根据类型信息动态生成所需绑定。
评估
将数十个现有 C/C++ 示例改写为 Python 并调用由 WayOut 启用的高性能内核,验证可行性并测量性能开销。
原文摘要(Abstract)

Traditionally, high performance kernels (HPKs) have been written in statically typed languages, such as C/C++ and Fortran. A recent trend among scientists—prototyping applications in dynamic languages such as Python—created a gap between the applications and existing HPKs. Thus, scientists have to either reimplement necessary kernels or manually create a connection layer to leverage existing kernels. Either option requires substantial development effort and slows down progress in science. We present a technique, dubbed WayOut, which automatically generates the entire connection layer for HPKs invoked from Python and written in C/C++. WayOut performs a hybrid analysis: it statically analyzes header files to generate Python wrapper classes and functions, and dynamically generates bindings for those kernels. By leveraging the type information available at run-time, it generates only the necessary bindings. We evaluate WayOut by rewriting dozens of existing examples from C/C++ to Python and leveraging HPKs enabled by WayOut. Our experiments show the feasibility of our technique, as well as negligible performance overhead on HPKs performance.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot6620,
  title = {Dynamic Generation of Python Bindings for HPC Kernels},
  author = {Steven Zhu and Nader AlAwar and Mattan Erez and Milos Gligoric},
  booktitle = {ASE},
  year = {2021},
  doi = {10.1109/ase51524.2021.9678726}
}