一句话:提出 NeuRI,利用归纳程序合成从 API 轨迹推断约束,生成多样化 DNN 模型以模糊测试深度学习系统。
深度学习系统的正确性至关重要,但现有 DNN 模型生成器仅覆盖有限算子,难以全面建模算子约束,无法生成有效且多样的测试用例。为此,本文提出 NeuRI,一个全自动的 DNN 模型生成方法。它分三步:(i) 从多种来源收集有效和无效的 API 调用轨迹;(ii) 在轨迹上应用归纳程序合成,推断构建有效模型所需的约束;(iii) 采用结合符号与具体算子的混合模型生成策略。评估显示,NeuRI 在 TensorFlow 和 PyTorch 上的分支覆盖率分别比最先进的模型级模糊测试器提升 24% 和 15%;四个月内发现 100 个新 bug,其中 81 个已修复或确认,9 个被标记为高优先级或安全漏洞,占同期全部高优先级 bug 的 10%。
Deep Learning (DL) is prevalently used in various industries to improve decision-making and automate processes, driven by the ever-evolving DL libraries and compilers. The correctness of DL systems is crucial for trust in DL applications. As such, the recent wave of research has been studying the automated synthesis of test-cases (i.e., DNN models and their inputs) for fuzzing DL systems. However, existing model generators only subsume a limited number of operators, lacking the ability to pervasively model operator constraints. To address this challenge, we propose NeuRI, a fully automated approach for generating valid and diverse DL models composed of hundreds of types of operators. NeuRI adopts a three-step process: (i) collecting valid and invalid API traces from various sources; (ii) applying inductive program synthesis over the traces to infer the constraints for constructing valid models; and (iii) using hybrid model generation which incorporates both symbolic and concrete operators. Our evaluation shows that NeuRI improves branch coverage of TensorFlow and PyTorch by 24% and 15% over the state-of-the-art model-level fuzzers. NeuRI finds 100 new bugs for PyTorch and TensorFlow in four months, with 81 already fixed or confirmed. Of these, 9 bugs are labelled as high priority or security vulnerability, constituting 10% of all high-priority bugs of the period. Open-source developers regard error-inducing tests reported by us as "high-quality" and "common in practice".