Automatically repairing tensor shape faults in deep learning programs

被引:4
作者
Wu, Dangwei [1 ]
Shen, Beijun [1 ]
Chen, Yuting [1 ]
Jiang, He [2 ]
Qiao, Lei [3 ]
机构
[1] Shanghai Jiao Tong Univ, Sch Elect Informat & Elect Engn, Shanghai, Peoples R China
[2] Dalian Univ Technol, Sch Software, Dalian, Peoples R China
[3] Beijing Inst Control Engn, Ctr Board Comp & Elect, Beijing, Peoples R China
基金
中国国家自然科学基金;
关键词
Tensor shape faults; Crashing faults; Automated program repair; Deep learning programs;
D O I
10.1016/j.infsof.2022.107027
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Context: Software developers frequently invoke deep learning (DL) APIs to incorporate artificial intelligence solutions into software systems. However, misuses of these APIs can cause various DL faults, such as tensor shape faults. Tensor shape faults occur when restriction conditions of operations are not met; they are prevalent in practice, leading to many system crashes. Meanwhile, researchers and engineers still face a strong challenge in detecting tensor shape faults - static techniques incur heavy overheads in defining detection rules, and the only dynamic technique requires human engineers to rewrite APIs for tracking shape changes. Objective: This paper introduces a novel technique that leverages machine learning to detect tensor shape faults, and as well uses patterns to repair faults detected. Methods: We first construct SFData, a set of 146 buggy programs with crashing tensor shape faults (i.e., those causing programs to crash). We also conduct an empirical study on crashing tensor shape faults, categorizing them into four types and revealing twelve repair patterns. Then we propose Tensfa2, an automated approach to detecting and repairing crashing tensor shape faults. Tensfa2 employs a machine learning method to learn from crash messages and decision trees to detect tensor shape faults. Next, Tensfa2 tracks shape properties by a customized Python debugger, analyzes their data dependences, and uses the twelve patterns to generate patches. Tensfa2 is an extended version of Tensfa-our previous approach presented at ISSRE'21. Its performance is enhanced by two techniques: a search-based method for repairing shape value faults, and a bundle of three ranking strategies for prioritizing the repair patterns. Results: Tensfa2 is evaluated on SFData and IslamData (another dataset of tensor shape faults). The results show the effectiveness of Tensfa2. In particular, Tensfa2 achieves an F1-score of 96.88% in detecting the faults and repairs 82 out of 146 buggy programs in SFData. Conclusion: We believe that repair patches generated by our approach will help engineers fix their deep learning programs much more efficiently, saving their time and efforts.
引用
收藏
页数:13
相关论文
共 44 条
[1]  
Abadi M, 2016, PROCEEDINGS OF OSDI'16: 12TH USENIX SYMPOSIUM ON OPERATING SYSTEMS DESIGN AND IMPLEMENTATION, P265
[2]  
[Anonymous], 2011, NIPS 2011
[3]  
[Anonymous], 2002, Technical Report.
[4]   Tensfa: Detecting and Repairing Tensor Shape Faults in Deep Learning Systems [J].
Wu, Dangwei ;
Shen, Beijun ;
Chen, Yuting ;
Jiang, He ;
Qiao, Lei .
2021 IEEE 32ND INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE 2021), 2021, :1-11
[5]   Ariadne: Analysis for Machine Learning Programs [J].
Dolby, Julian ;
Shinnar, Avraham ;
Allain, Allison ;
Reinen, Jenna .
MAPL'18: PROCEEDINGS OF THE 2ND ACM SIGPLAN INTERNATIONAL WORKSHOP ON MACHINE LEARNING AND PROGRAMMING LANGUAGES, 2018, :1-10
[6]   A survey on deep learning and its applications [J].
Dong, Shi ;
Wang, Ping ;
Abbas, Khushnood .
COMPUTER SCIENCE REVIEW, 2021, 40
[7]  
Durieux T, 2017, 2017 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), P349, DOI 10.1109/SANER.2017.7884635
[8]  
Durieux T, 2016, 2016 IEEE/ACM 11TH INTERNATIONAL WORKSHOP IN AUTOMATION OF SOFTWARE TEST (AST), P85, DOI [10.1109/AST.2016.021, 10.1145/2896921.2896931]
[9]  
Everitt BS., 2005, Encyclopedia of statistics in behavioral science, DOI DOI 10.1002/0470013192.BSA753
[10]  
Gupta K., 2020, Advances in Neural Information Processing Systems, V33, P17685