arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2310.20078cs.SE
收藏

TorchProbe:模糊测试动态深度学习编译器

TorchProbe: Fuzzing Dynamic Deep Learning Compilers

Qidong Su, Chuqin Geng, Gennady Pekhimenko, Xujie Si

AI总结:

本文提出TorchProbe方法,通过保持语义的代码变换生成动态特性测试用例,对PyTorch 2.0编译器及Triton进行模糊测试,发现20个未知缺陷。

摘要:

静态与动态计算图代表了构建深度学习框架的两种不同途径。前者优先考虑基于编译器的优化,而后者则侧重于可编程性和用户友好性。近期发布的 PyTorch 2.0 支持在 Python 中编译任意深度学习程序,标志着深度学习基础设施演进的一个新方向:以更动态的方式引入编译器技术,并支持更多动态语言特性,如动态控制流和闭包。鉴于 PyTorch 与 Python 的无缝集成,其编译器旨在支持用 Python 编写的任意深度学习代码。然而,Python 固有的动态性给编译器的完备性和鲁棒性带来了挑战。尽管近期研究已将模糊测试引入深度学习编译器测试,但对于如何测试动态特性仍缺乏全面分析。为解决这一问题,我们提出了若干代码变换方法,以生成涉及动态特性的测试用例。这些变换保持程序语义不变,确保变换后程序与原始程序之间的任何差异都表明存在缺陷。通过我们的方法,我们成功在 PyTorch 编译器及其底层张量编译器 Triton 中发现了二十个此前未知的缺陷。

英文摘要:

Static and dynamic computational graphs represent two distinct approaches to constructing deep learning frameworks. The former prioritizes compiler-based optimizations, while the latter focuses on programmability and user-friendliness. The recent release of PyTorch 2.0, which supports compiling arbitrary deep learning programs in Python, signifies a new direction in the evolution of deep learning infrastructure to incorporate compiler techniques in a more dynamic manner and support more dynamic language features like dynamic control flows and closures. Given PyTorch's seamless integration with Python, its compiler aims to support arbitrary deep learning code written in Python. However, the inherent dynamism of Python poses challenges to the completeness and robustness of the compiler. While recent research has introduced fuzzing to test deep learning compilers, there is still a lack of comprehensive analysis on how to test dynamic features. To address this issue, we propose several code transformations to generate test cases involving dynamic features. These transformations preserve the program's semantics, ensuring that any discrepancy between the transformed and original programs indicates the presence of a bug. Through our approach, we have successfully identified twenty previously unknown bugs in the PyTorch compiler and its underlying tensor compiler Triton.

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

↑