将深度学习算子的底层代码自动提炼为可验证的数学公式
Verified Lifting of Deep learning Operators
- 结合符号执行与形式化验证,从底层实现生成高阶数学表达式
- 在真实Triton算子数据集上验证,合成准确率优于现有方法
- 适合需要提升算子可读性与可靠性的框架开发者
深度学习算子是现代深度学习框架的核心组件。随着对自定义算子需求的增长,开发者频繁自行设计实现,但其过程复杂且易出错,涉及硬件优化和数值稳定性问题。现有工具难以有效总结算子功能。本文提出一种可验证的算子提升框架,能够从低层实现中自动合成高层数学公式。方法融合符号执行、语法引导的合成与基于SMT的验证,采用自顶向下与自底向上相结合的策略高效探索搜索空间;在验证阶段,设计不变式合成模式并利用SMT求解器确保推导公式的正确性;在简化阶段,使用egraph技术结合自定义规则,将复杂公式还原为自然直观的形式。在来自真实世界Triton实现的算子数据集上评估,本方法在合成与验证效果上均优于现有技术。该框架弥合了底层实现与高层抽象之间的鸿沟,提升了深度学习算子开发的理解性与可靠性。
原文摘要 · Abstract (English)
Deep learning operators are fundamental components of modern deep learning frameworks. With the growing demand for customized operators, it has become increasingly common for developers to create their own. However, designing and implementing operators is complex and error-prone, due to hardware-specific optimizations and the need for numerical stability. There is a pressing need for tools that can summarize the functionality of both existing and user-defined operators. To address this gap, this work introduces a novel framework for the verified lifting of deep learning operators, which synthesizes high-level mathematical formulas from low-level implementations. Our approach combines symbolic execution, syntax-guided synthesis, and SMT-based verification to produce readable and formally verified mathematical formulas. In synthesis, we employ a combination of top-down and bottom-up strategies to explore the vast search space efficiently; In verification, we design invariant synthesis patterns and leverage SMT solvers to validate the correctness of the derived summaries; In simplification, we use egraph-based techniques with custom rules to restore complex formulas to their natural, intuitive forms. Evaluated on a dataset of deep learning operators implemented in Triton from the real world, our method demonstrates the effectiveness of synthesis and verification compared to existing techniques. This framework bridges the gap between low-level implementations and high-level abstractions, improving understanding and reliability in deep learning operator development.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。