Deep learning compilers help address difficulties of deploying deep learning models on diverse types of hardware. Testing deep learning compilers is highly crucial, because they are impacting countless AI applications that use them for model optimization and deployment. To test deep learning compilers, random testing, being popularly used for compiler testing practices, faces the challenge of generating semantically valid test inputs, i.e., deep learning models that satisfy the semantic model specifications (in short as semantic specifications). To tackle this challenge, in this paper, we propose a novel approach named Isra, including a domain-specific constraint solver that resolves the constraints from the semantic specifications without backtracking. We implement and apply our approach on three popular real-world deep learning compilers including TVM, Glow, and a commercial compiler. The evaluation results show that Isra is more effective than the state-of-the-art approaches and the baseline approaches on constructing valid test inputs for compiler-bug detection, and Isra successfully finds 24 previously unknown bugs in released versions of the three compilers. These results indicate effectiveness and practical value of Isra.
翻译:深度学习编译器有助于解决在多样化硬件上部署深度学习模型的难题。测试深度学习编译器至关重要,因为它们影响着众多利用其进行模型优化与部署的人工智能应用。为了测试深度学习编译器,随机测试作为编译器测试实践中广泛采用的方法,面临着生成语义有效测试输入的挑战,即需要生成满足语义模型规范(简称语义规范)的深度学习模型。为应对这一挑战,本文提出了一种名为Isra的新颖方法,该方法包含一个领域特定的约束求解器,能在无回溯的情况下解决语义规范中的约束。我们在三种流行的真实世界深度学习编译器(包括TVM、Glow及一款商业编译器)上实现并应用了该方法。评估结果表明,在构建用于编译器缺陷检测的有效测试输入方面,Isra比现有最新方法及基线方法更为有效,并在这三个编译器的已发布版本中成功发现了24个先前未知的缺陷。这些结果验证了Isra的有效性与实用价值。