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".
翻译:深度学习(DL)广泛应用于各行业以优化决策流程并推动自动化,其发展得益于不断演进的DL库与编译器。DL系统的正确性对于保障DL应用的可靠性至关重要。为此,近年研究聚焦于自动化合成测试用例(即DNN模型及其输入)以对DL系统进行模糊测试。然而,现有模型生成器仅涵盖有限的算子类型,缺乏系统建模算子约束的能力。针对这一挑战,我们提出NeuRI——一种全自动方法,可生成由数百种算子类型构成的合法且多样化的DL模型。NeuRI采用三步流程:(i)从多源收集有效与无效API踪迹;(ii)通过归纳程序合成技术推断约束条件以构建合法模型;(iii)采用混合模型生成策略,融合符号算子与具体算子。评估表明,与现有最优模型级模糊测试工具相比,NeuRI将TensorFlow与PyTorch的分支覆盖率分别提升24%和15%。在四个月内,NeuRI为PyTorch和TensorFlow发现了100个新缺陷,其中81个已被修复或确认。这些缺陷中,9个被标记为高优先级或安全漏洞,占同期所有高优先级缺陷的10%。开源开发者将我们报告的错误诱导测试评价为"高质量"且"实践中常见"。