Metamorphic Testing of Deep Learning Compilers

Author:

Xiao Dongwei1,LIU Zhibo1,Yuan Yuanyuan1,Pang Qi1,Wang Shuai1

Affiliation:

1. The Hong Kong University of Science and Technology, Hong Kong, China

Abstract

The prosperous trend of deploying deep neural network (DNN) models to diverse hardware platforms has boosted the development of deep learning (DL) compilers. DL compilers take the high-level DNN model specifications as input and generate optimized DNN executables for diverse hardware architectures like CPUs, GPUs, and various hardware accelerators. Compiling DNN models into high-efficiency executables is not easy: the compilation procedure often involves converting high-level model specifications into several different intermediate representations (IR), e.g., graph IR and operator IR, and performing rule-based or learning-based optimizations from both platform-independent and platform-dependent perspectives. Despite the prosperous adoption of DL compilers in real-world scenarios, principled and systematic understanding toward the correctness of DL compilers does not yet exist. To fill this critical gap, this paper introduces MT-DLComp, a metamorphic testing framework specifically designed for DL compilers to effectively uncover erroneous compilations. Our approach leverages deliberately-designed metamorphic relations (MRs) to launch semantics-preserving mutations toward DNN models to generate their variants. This way, DL compilers can be automatically examined for compilation correctness utilizing DNN models and their variants without requiring manual intervention. We also develop a set of practical techniques to realize an effective workflow and localize identified error-revealing inputs. Real-world DL compilers exhibit a high level of engineering quality. Nevertheless, we detected over 435 inputs that can result in erroneous compilations in four popular DL compilers, all of which are industry-strength products maintained by Amazon, Facebook, Microsoft, and Google. While the discovered error-triggering inputs do not cause the DL compilers to crash directly, they can lead to the generation of incorrect DNN executables. With substantial manual effort and help from the DL compiler developers, we uncovered four bugs in these DL compilers by debugging them using the error-triggering inputs. Our proposed testing frameworks and findings can be used to guide developers in their efforts to improve DL compilers.

Funder

RGC ECS grant

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Networks and Communications,Hardware and Architecture,Safety, Risk, Reliability and Quality,Computer Science (miscellaneous)

Reference102 articles.

1. Mart'in Abadi , Paul Barham , Jianmin Chen , Zhifeng Chen , Andy Davis , Jeffrey Dean , Matthieu Devin , Sanjay Ghemawat , Geoffrey Irving , Michael Isard , et almbox . 2016 . Tensorflow : A system for large-scale machine learning. In 12th $$USENIX$$ symposium on operating systems design and implementation ($$OSDI$$ 16) . 265--283. Mart'in Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et almbox. 2016. Tensorflow: A system for large-scale machine learning. In 12th $$USENIX$$ symposium on operating systems design and implementation ($$OSDI$$ 16) . 265--283.

2. Learning to optimize halide with tree search and random programs

3. Amazon. 2021. Amazon SageMaker Neo uses Apache TVM for performance improvement on hardware target . https://aws.amazon.com/sagemaker/neo/. Amazon. 2021. Amazon SageMaker Neo uses Apache TVM for performance improvement on hardware target . https://aws.amazon.com/sagemaker/neo/.

4. Jialun Cao Meiziniu Li Yeting Li Ming Wen and Shing-Chi Cheung. 2020. SemMT: A Semantic-based Testing Approach for Machine Translation Systems. arXiv preprint arXiv:2012.01815 (2020). Jialun Cao Meiziniu Li Yeting Li Ming Wen and Shing-Chi Cheung. 2020. SemMT: A Semantic-based Testing Approach for Machine Translation Systems. arXiv preprint arXiv:2012.01815 (2020).

Cited by 22 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. TR-Fuzz: A syntax valid tool for fuzzing C compilers;Science of Computer Programming;2024-12

2. Interoperability in Deep Learning: A User Survey and Failure Analysis of ONNX Model Converters;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11

3. Towards More Complete Constraints for Deep Learning Library Testing via Complementary Set Guided Refinement;Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis;2024-09-11

4. Metamorphic Testing of Secure Multi-party Computation (MPC) Compilers;Proceedings of the ACM on Software Engineering;2024-07-12

5. DTD: Comprehensive and Scalable Testing for Debuggers;Proceedings of the ACM on Software Engineering;2024-07-12

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3