arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.06747cs.SE
收藏

张量代数性质骨架:增强AI编译器的基于性质的测试

Tensor-Algebraic Property Skeletons: Guiding Agents to Construct Semantic Oracles for DL Compilers

UC Riverside(加州大学河滨分校);UCLA(加州大学洛杉矶分校);Tulane University(杜兰大学)

Yuxin Qiu, Geyang Xu, Ben Limpanukorn, Seongmin Lee, Jiyuan Wang, Miryung Kim, Qian Zhang

AI总结:

提出Propilot框架,利用LLM将张量代数知识表示为可复用的性质骨架,自动生成可执行的基于性质的测试,以检测AI编译器中的语义漂移。

摘要:

深度学习编译器(如TVM和ONNX-MLIR)将张量计算图降级为目标后端的优化可执行文件。测试这些AI编译器在模糊测试中生成良好格式的输入方面取得了实质性进展;然而,仅靠这种生成无法捕捉到图变换和优化应保持的代数不变量的语义漂移。尽管张量代数已被研究数十年,但它尚未转化为深度学习编译器的可执行基于性质的测试,因为这样做需要联合构建算子、输入和测试预言。核心挑战不再是生成用于模糊测试深度学习编译器的良好格式输入,而是基于张量代数用这些输入和预言引导可执行的基于性质的测试。我们在Propilot中实现了这一愿景,这是一个基于GPT 5.5的LLM驱动的智能体基于性质测试框架。首先,Propilot将张量代数知识表示为可复用的性质骨架,每个骨架都包含算子约束、形状和值规则以及预言模板。其次,给定目标编译器,Propilot通过生成配对的张量计算图、具体的张量输入和预期的语义关系作为预言,将这些骨架实例化为可执行的基于性质的测试。接下来,为防止生成的测试退化为无效或无信息的基于性质的测试,Propilot在执行前验证每个基于性质的测试候选的适用性和安全性。验证反馈、执行结果和覆盖率信号指导后续生成。我们在TVM上使用212个算子和20个性质骨架评估Propilot,生成了4,579个基于性质的测试。与直接的基于LLM的基于性质的测试生成相比,Propilot通过显式的性质骨架将冗余减少了49%,并消除了无效测试。这种有效性转化为发现语义错误和数值差异。

英文摘要:

Deep learning (DL) compilers optimize tensor computation graphs through transformations that can silently change what a model computes. Existing work generates well-formed computation graphs and tensor inputs but typically judges results through crashes or differential comparison. Tensor algebra offers stronger oracles, such as commutativity and reduction decomposition, but turning an identity into an executable check requires selecting applicable operators, valid inputs, and precision-aware comparisons. We present Propilot, an agentic testing framework that guides LLM agents to construct semantic oracles from tensor algebra. Its core abstraction, the property skeleton, couples a relation with applicability conditions and an oracle template whose compiler-specific slots the agent fills. Propilot comes with sixteen skeletons and twenty data generators. It validates each test before execution and uses rejection reasons, execution results, and usage records to steer generation toward untested combinations. We evaluate Propilot with six agents on three DL compilers against Agent-Only, which uses the same agents without Propilot. Propilot detects 96 distinct compiler root causes, including 25 with silent wrong outputs that Agent-Only misses. It also generates 85.34% fewer invalid tests and covers at least 2.73 times as many operator-property pairs on each compiler. On 161 faulty TVM versions, Propilot detects 100, against 53 for Agent-Only.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑