Abstract:Deep Learning compilers (DL compilers) have been widely used in model optimization and deployment. Like traditional compilers, DL compilers also contain bugs. Buggy DL compilers could lead to compilation failure, output incorrect compilation results, and even bring catastrophic consequences. To investigate the characteristics of DL compiler bugs, existing work has studied and analyzed 603 early DL compiler bugs. In recent years, DL compilers have been updated frequently, accompanied by the introduction of many new features and the deprecation of some old features. At the same time, several testing approaches for DL compilers have been proposed. It is unknown whether the previous research findings on DL compiler bugs are still applicable. In addition, there is a lack of in-depth exploration of the relationship among symptoms, root causes, and locations of bugs, and the characteristics of regression test cases that trigger bugs and patches that fix bugs have not been studied. To deeply understand the evolution of current DL compiler bug characteristics and distribution over time, this paper collects 613 recently fixed bugs in three popular DL compilers and labels the root causes, symptoms, and locations for each bug. Then, based on the labeled results, this paper deeply explores the distribution characteristics of bugs from multiple angles and compares them with those in existing research work. At the same time, we also study the characteristics of the patches involved in fixing the bugs and the regression test cases that trigger the bugs. In total, we summarized 12 major findings to fully understand DL compiler bugs and their evolution, and provide a series of feasible suggestions for detecting, localizing, and repairing DL compiler bugs. Finally, to evaluate the usefulness of our findings, we developed a proof-of-concept TVM testing tool, called CfgFuzz, based on optimization configuration. CfgFuzz performs combinatorial testing on compilation configuration and detects 8 TVM bugs, 7 of which have been confirmed or fixed by developers.