paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Fixing Broken Graphs: LLM-Powered Automatic Code Optimization for DNN Programs

修复断裂的计算图:面向 DNN 程序的 LLM 驱动自动代码优化
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 6/10 · 论文将 LLM 多智能体用于修复 DNN 程序导致深度学习编译器计算图断裂的代码,属于 AI for 编译/代码优化,与用户关注的静态分析/形式化验证交叉有限;但它涉及 ML 系统、Agent 驱动程序修复与工业级落地,属于 PL+AI 的外围相关方向。引用 0 inbox
Haotian Wang, Yicheng Sui, Yudong Xie, Yicong Liu, Yufei Sun, Changqing Shi, Yuzhi Zhang
crossref: 2026-09-12

AI 速览

一句话:提出多智能体系统 GraphGlue,用 LLM 修复导致深度学习编译器计算图断裂的代码,从而提升推理性能与显存效率。

深度学习编译器通过将 DNN 程序捕获为算子级计算图来做优化,但开发者程序中复杂的 Python 语言特性常使编译器无法把整个程序识别为完整计算图,导致性能次优。作者分析发现,实际的图捕获失败往往只涉及少数几行代码,因此认为可通过代码修复而非大规模改造编译器来解决该问题。为此提出 GraphGlue:一个利用 LLM 修复并优化 DNN 程序以满足编译器要求的多智能体系统,包含图断裂原因挖掘(GCM)以定位隐藏的断裂成因并指导 LLM 修复,以及拒绝采样自纠正(SRS)在代码调试与重新生成之间交替,避免错误初始优化策略带来的无效反馈。实验表明,相比直接使用 TorchDynamo 最高获得 2.19 倍加速(平均 1.23 倍),相比最先进的 AI 编译器前端最高节省 15.77 倍显存(平均 8.74 倍),并在 1411 个真实用户程序上成功优化 92.63%。

问题
DNN 程序中复杂的 Python 语言特性会阻止深度学习编译器将整个程序捕获为完整计算图,从而只能得到次优的执行性能。
方法
提出多智能体系统 GraphGlue,通过图断裂原因挖掘(GCM)定位隐藏的图断裂成因并指导 LLM 修复,并用拒绝采样自纠正(SRS)在调试与重新生成间交替以避免无效反馈。
评估
在真实用户程序与主流编译器基线上评估:相对 TorchDynamo 最高 2.19 倍加速(平均 1.23 倍),相对 SOTA AI 编译器前端最高 15.77 倍显存节省(平均 8.74 倍),在 1411 个真实用户程序上成功优化 92.63%。
原文摘要(Abstract)

Deep learning compilers optimize DNN program execution by capturing them as operator-based computation graphs. However, developers’ deep learning programs often contain complex Python language features that prevent compilers from recognizing the entire program as a complete computation graph, resulting in sub-optimal performance. Our analysis reveals that actual capture failures involve only a few lines of code, we believe this problem can be addressed through code repair rather than extensive compiler improvements. To address this challenge, we introduce GraphGlue, a multi-agent system that leverages LLMs to repair and optimize DNN programs for compiler requirements, thereby maximizing the performance benefits of deep learning compilers in inference scenarios. GraphGlue employs (1) graph-break cause mining (GCM) to identify hidden causes of computation graph breaks and facilitate LLM-based repair, and (2) self-correction with reject sampling (SRS) to alternate between code debugging and regeneration, effectively avoiding ineffective feedback attempts caused by incorrect initial optimization strategies. Experimental results demonstrate that programs optimized by GraphGlue achieve up to 2.19x (1.23x on average) speedup compared to using TorchDynamo directly, and deliver up to 15.77x (8.74x on average) memory savings compared to state-of-the-art AI compiler frontends. GraphGlue exhibits strong generalization capabilities across 1,411 real-world user programs, successfully optimizing 92.63% of them. Code is available at https://github.com/Jamesswang/GraphGlue.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9503,
  title = {Fixing Broken Graphs: LLM-Powered Automatic Code Optimization for DNN Programs},
  author = {Haotian Wang and Yicheng Sui and Yudong Xie and Yicong Liu and Yufei Sun and Changqing Shi and Yuzhi Zhang},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00144}
}