NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilers

Jiawei Liu, Jinkun Lin, Fabian Ruffy, Cheng Tan, Jinyang Li +2 more
7/26/2022
cs.LGcs.SE

No official code found. Best implementation: ganler/nnsmith-asplos-artifact (11 stars, Apache-2.0, last commit 2023-03-29).

Abstract

Deep-learning (DL) compilers such as TVM and TensorRT are increasingly being used to optimize deep neural network (DNN) models to meet performance, resource utilization and other requirements. Bugs in these compilers can result in models whose semantics differ from the original ones, producing incorrect results that corrupt the correctness of downstream applications. However, finding bugs in these compilers is challenging due to their complexity. In this work, we propose a new fuzz testing approach for finding bugs in deep-learning compilers. Our core approach consists of (i) generating diverse yet valid DNN test models that can exercise a large part of the compiler's transformation logic using light-weight operator specifications; (ii) performing gradient-based search to find model inputs that avoid any floating-point exceptional values during model execution, reducing the chance of missed bugs or false alarms; and (iii) using differential testing to identify bugs. We implemented this approach in NNSmith which has found 72 new bugs for TVM, TensorRT, ONNXRuntime, and PyTorch to date. Of these 58 have been confirmed and 51 have been fixed by their respective project maintainers.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

https://nnsmith-asplos.rtfd.io Artifact of "NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilers" ASPLOS'23

110Shell, DockerfileSep 28, 20223 years agoApache-2.0

Similar Papers

Cite this paper

@article{liu2022nnsmith,
  title  = {NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilers},
  author = {Jiawei Liu and Jinkun Lin and Fabian Ruffy and Cheng Tan and Jinyang Li and Aurojit Panda and Lingming Zhang},
  year   = {2022},
  eprint = {2207.13066},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2207.13066v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2207.13066.svg)](https://codeofpaper.com/paper/2207.13066)

Discussion