arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2604.08720cs.SEcs.AI
收藏

解析PyTorch编译器中正确性错误的沉默

Demystifying the Silence of Correctness Bugs in PyTorch Compiler

The Hong Kong University of Science and Technology(香港科技大学);Guangzhou HKUST Fok Ying Tung Research Institute(广州香港科技大学霍英东研究院);Carnegie Mellon University(卡内基梅隆大学)

Meiziniu Li, Dongze Li, Jianmeng Liu, Shing-Chi Cheung

AI总结:

本文研究PyTorch编译器中正确性错误的特征,提出AlignGuard技术检测此类错误,已发现23个新错误,其中14个被标记为高优先级。

摘要:

人工智能基础设施的性能优化对大语言模型的快速采用至关重要。PyTorch编译器(torch.compile)作为深度学习模型的核心优化工具,其正确性错误会导致编译模型输出错误,而不触发异常、崩溃或警告。这些错误严重威胁下游LLM应用的可靠性。PyTorch社区数据显示,19.2%的高优先级问题由torch.compile的正确性错误引起,是第二大常见错误类别。本文首次系统研究torch.compile的正确性错误,分析其特征,并评估现有模糊测试器的有效性。基于研究结果,我们提出AlignGuard测试技术,利用LLM基于的测试变异检测正确性错误。截至撰写,AlignGuard已成功检测23个新错误,其中14个被PyTorch开发团队确认或修复,且超过一半被标记为高优先级,证明了该技术的实用性。

英文摘要:

Performance optimization of AI infrastructure is key to the fast adoption of large language models (LLMs). The PyTorch compiler (torch.compile), a core optimization tool for deep learning (DL) models (including LLMs), has received due attention. However, torch.compile is prone to correctness bugs, which cause incorrect outputs of compiled DL models without triggering exceptions, crashes, or warnings. These bugs pose a serious threat to the reliability of downstream LLM applications. Data from the PyTorch community shows that 19.2% of high-priority issues are incorrect outputs of compiled DL models induced by torch.compile bugs, the second-most-common bug category (only behind program crashes at 19.57%). However, no systematic study has been conducted to specifically characterize and thereby detect these bugs. In this paper, we present the first empirical study of the correctness bugs in torch.compile, examine their characteristics, and assess the effectiveness of existing fuzzers in detecting them. Based on our findings, we propose a proof-of-concept testing technique named AlignGuard, tailored specifically for detecting correctness bugs in torch.compile. AlignGuard incorporates bug characteristics distilled from our empirical study, applying LLM-based test mutation to existing test cases for correctness bug detection. At the time of writing, AlignGuard has successfully detected 23 new correctness bugs in recent torch.compile. All these bugs have been confirmed or fixed by the PyTorch development team, and over half (14/23) of them are even marked as high-priority bugs, underscoring the usefulness of our technique.

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

↑