一句话:提出首个面向深度学习库自动微分组件的通用 API 级差分模糊测试方法 ∇Fuzz。
自动微分(AD)是深度学习系统的基础组件,但已有测试工作大多忽视它。本文提出 ∇Fuzz,首个面向深度学习库 AD 组件的通用实用模糊测试方法。其核心洞察是把 DL 库 API 抽象为处理张量/向量的函数,并在不同执行场景下进行差分测试,以同时检验一阶和高阶梯度,还通过自动过滤策略排除数值不稳定导致的误报。作者在 PyTorch、TensorFlow、JAX 与 OneFlow 上开展实验,表明 ∇Fuzz 在代码覆盖率和缺陷检测上显著优于现有模糊器;共发现 173 个 bug,144 个获确认,其中 117 个此前未知、107 个与 AD 相关,并贡献了两个月内 PyTorch 和 JAX 全部高优先级 AD bug 的 58.3%。
Deep learning (DL) has attracted wide attention and has been widely deployed in recent years. As a result, more and more research efforts have been dedicated to testing DL libraries and frameworks. However, existing work largely overlooked one crucial component of any DL system, automatic differentiation (AD), which is the basis for the recent development of DL. To this end, we propose ∇Fuzz, the first general and practical approach specifically targeting the critical AD component in DL libraries. Our key insight is that each DL library API can be abstracted into a function processing tensors/vectors, which can be differentially tested under various execution scenarios (for computing outputs/gradients with different implementations). We have implemented $\nabla \text{Fuzz}$ as a fully automated API-level fuzzer targeting AD in DL libraries, which utilizes differential testing on different execution scenarios to test both first-order and high-order gradients, and also includes automated filtering strategies to remove false positives caused by numerical instability. We have performed an extensive study on four of the most popular and actively-maintained DL libraries, PyTorch, TensorFlow, JAX, and OneFlow. The result shows that $\nabla \text{Fuzz}$ substantially outperforms state-of-the-art fuzzers in terms of both code coverage and bug detection. To date, $\nabla \text{Fuzz}$ has detected 173 bugs for the studied DL libraries, with 144 already confirmed by developers (117 of which are previously unknown bugs and 107 are related to AD). Remarkably, $\nabla \text{Fuzz}$ contributed 58.3% (7/12) of all high-priority AD bugs for PyTorch and JAX during a two-month period. None of the confirmed AD bugs were detected by existing fuzzers.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2302-04351,
title = {Fuzzing Automatic Differentiation in Deep-Learning Libraries},
author = {Chenyuan Yang and Yinlin Deng and Jiayi Yao and Yuxing Tu and Hanchi Li and Lingming Zhang},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse48619.2023.00105}
}