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

HirGen:深度学习编译器模糊测试

Fuzzing Deep Learning Compilers with HirGen

Haoyang Ma, Qingchao Shen, Yongqiang Tian, Junjie Chen, Shing-Chi Cheung

AI总结:

针对深度学习编译器高级IR优化阶段缺陷率高的问题,提出HirGen自动化测试技术,通过三种覆盖率准则、高级IR语言特性利用及三个测试预言,在TVM中检测出21个缺陷,并优于现有基线。

摘要:

深度学习(DL)编译器被广泛采用,以优化先进的深度学习模型,使其能够在各种硬件上高效部署。它们的质量对编译后的深度学习模型的质量有着深远的影响。最近的一项缺陷研究表明,高级中间表示(IR)的优化是最容易出错的编译阶段。该阶段的缺陷占收集到的全部缺陷的44.92%。然而,现有的测试技术并未考虑高级优化相关的特性(例如高级IR),因此在该阶段暴露缺陷的能力较弱。为弥补这一差距,我们提出了HirGen,一种自动化测试技术,旨在有效暴露高级IR优化中的编码错误。HirGen的设计包括:1)三种覆盖率准则,用于生成多样且有效的计算图;2)充分利用高级IR的语言特性来生成多样的IR;3)三个受差分测试和蜕变测试启发的测试预言。HirGen已成功检测到TVM中出现的21个缺陷,其中17个已确认,12个已修复。此外,我们使用最先进的深度学习编译器模糊测试工具构建了四个基线,这些工具能够覆盖高级优化阶段。我们的实验结果表明,HirGen在48小时内检测到了基线无法检测到的10个崩溃和不一致问题。我们进一步在评估中验证了我们提出的覆盖率准则和测试预言的有效性。

英文摘要:

Deep Learning (DL) compilers are widely adopted to optimize advanced DL models for efficient deployment on diverse hardware. Their quality has profound effect on the quality of compiled DL models. A recent bug study shows that the optimization of high-level intermediate representation (IR) is the most error-prone compilation stage. Bugs in this stage are accountable for 44.92% of the whole collected ones. However, existing testing techniques do not consider high-level optimization related features (e.g. high-level IR), and are therefore weak in exposing bugs at this stage. To bridge this gap, we propose HirGen, an automated testing technique that aims to effectively expose coding mistakes in the optimization of high-level IR. The design of HirGen includes 1) three coverage criteria to generate diverse and valid computational graphs; 2) full use of high-level IRs language features to generate diverse IRs; 3) three test oracles inspired from both differential testing and metamorphic testing. HirGen has successfully detected 21 bugs that occur at TVM, with 17 bugs confirmed and 12 fixed. Further, we construct four baselines using the state-of-the-art DL compiler fuzzers that can cover the high-level optimization stage. Our experiment results show that HirGen can detect 10 crashes and inconsistencies that cannot be detected by the baselines in 48 hours. We further validate the usefulness of our proposed coverage criteria and test oracles in evaluation.

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

↑