两个深度学习领域的故事:当库测试遇上编译器
A Tale of Two DL Cities: When Library Tests Meet Compiler
AI总结:
针对DL编译器模型加载阶段测试不足的问题,提出OPERA方法,迁移DL库测试知识并结合多样性测试优先级策略,在三款编译器上检测到170个未知缺陷,效率提升显著。
摘要:
深度学习(DL)编译器通常会加载深度学习模型,并通过中间表示对其进行优化。现有DL编译器测试技术主要聚焦于模型优化阶段,却极少探索模型加载阶段的缺陷检测。要有效测试模型加载阶段,需要覆盖来自各类DL库的每个DL算子的多样化用法,这与DL库测试有着共同目标,说明DL库测试中蕴含的知识对测试DL编译器的模型加载阶段是有益的。\n在本研究中,我们提出OPERA方法,用于从DL库的测试输入中提取这类领域知识。OPERA基于各类DL库测试输入(包括DL库中记录的测试输入,以及近期模糊测试工具生成的测试输入)构建多样化的测试用例。此外,它还结合了一种基于多样性的测试优先级策略,将更有可能检测出多样化缺陷的测试输入提前迁移并执行。\n我们选取了DL库中三类测试来源进行迁移,并使用来自三款DL编译器(即TVM、TensorRT和OpenVINO)的八个前端进行评估。OPERA总共检测到170个此前未知的缺陷,其中90个已得到开发者确认/修复,证明了这种基于迁移的思路的有效性。与通用测试优先级策略相比,OPERA中的测试优先级策略将迁移测试的测试效率平均提升了11.9%~47.4%。
英文摘要:
Deep Learning (DL) compilers typically load a DL model and optimize it with intermediate representation.Existing DL compiler testing techniques mainly focus on model optimization stages, but rarely explore bug detection at the model loading stage. Effectively testing the model loading stage requires covering diverse usages of each DL operator from various DL libraries, which shares a common objective with DL library testing, indicating that the embedded knowledge in DL library tests is beneficial for testing the model loading stage of DL compilers. In this work, we propose OPERA to extract such domain knowledge from the test inputs for DL libraries. OPERA constructs diverse tests from the various test inputs for DL libraries (including the test inputs documented in DL libraries and those generated by recent fuzzers). In addition, it incorporates a diversity-based test prioritization strategy to migrate and execute those test inputs that are more likely to detect diverse bugs earlier. We considered three sources of tests in DL libraries for migration and used eight frontends from three DL compilers (e.g., TVM, TensorRT, and OpenVINO) for evaluation. OPERA detected 170 previously unknown bugs in total, 90 of which have been confirmed/fixed by developers, demonstrating the effectiveness of such the migration-based idea. The test prioritization strategy in OPERA improves testing efficiency with migrated tests by 11.9%~47.4% on average compared to general test prioritization strategies.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。