arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.22003cs.SEcs.LG
收藏

深度学习编译器的有状态测试

Stateful Testing for Deep Learning Compilers

State Key Laboratory for Novel Software Technology, Nanjing University(南京大学软件新技术国家重点实验室);UNIST(蔚山科学技术院)

Jiatao Ge, Ruixiang Qian, Yibo Hu, Yanzhou Mu, Yinglong Zou, Jiawei Liu, Zhenyu Chen, Chunrong Fang

AI总结:

针对深度学习编译器的有状态bug问题,提出Rondo有状态测试方法,检测到117个bug,其中35个有状态bug,获开发者确认35份报告并修复18个bug。

摘要:

现代深度学习编译器会惰性编译模型,并在多次调用间缓存产物。保留的编译器状态可能导致后续调用即使单独运行正确也会出错。对PyTorch、JAX和TensorFlow中26个公开报告问题的分析表明,检测此类bug需要先建立编译器状态再暴露故障的序列。我们提出Rondo,一种有状态测试方法,将每个测试用例表示为模型与调用序列的配对。Rondo会变异调用序列,并使用由编译行为引导的马尔可夫链蒙特卡罗采样器,以偏好罕见观察到的行为。它的三向差分预言机比较三种执行情况:无编译的执行、重置编译器状态的编译执行、保留状态的编译执行。它通过在保留输入和程序状态的情况下,用保留状态和重置状态的相同调用重放来确认有状态bug,然后在保留原始bug的同时缩短序列。我们在四个深度学习框架上使用24种常见模型架构评估Rondo。Rondo检测到117个bug,包括35个有状态bug。我们提交了39份bug报告,其中18份针对有状态bug;开发者确认了35份报告,其中16份针对有状态bug,并修复了18个bug,其中11个是有状态bug。在对比方法中,Rondo实现了最高的行为覆盖率和编译器Python源代码行覆盖率,警报精度达99.26%。它在117个调用序列中缩短了44个,使这44个序列的长度平均减少83.34%。

英文摘要:

Modern deep learning compilers compile models lazily and cache artifacts across invocations. Retained compiler state can make a later invocation incorrect even when it is correct in isolation. An analysis of 26 publicly reported issues in PyTorch, JAX, and TensorFlow shows that detecting such bugs requires sequences that first establish compiler state and then expose a failure. We present Rondo, a stateful testing method that represents each test case as a model paired with an invocation sequence. Rondo mutates invocation sequences and uses a Markov chain Monte Carlo sampler guided by compilation behavior to favor rarely observed behaviors. Its three-way differential oracle compares execution without compilation, compiled execution with compiler state reset, and compiled execution with state retained. It confirms stateful bugs by replaying the same invocation with state retained and reset while preserving inputs and program state, then shortens sequences while preserving the original bug. We evaluate Rondo on four deep learning frameworks using 24 common model architectures. Rondo detects 117 bugs, including 35 stateful bugs. We submit 39 bug reports, including 18 for stateful bugs; developers confirm 35 reports, including 16 for stateful bugs, and fix 18 bugs, including 11 stateful bugs. Rondo achieves the highest behavior coverage and compiler Python source-line coverage among the compared methods, with 99.26% alarm precision. It shortens 44 of 117 invocation sequences, reducing the lengths of these 44 sequences by 83.34% on average.

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

↑