Skip to main content
QUICK REVIEW

[Paper Review] Effective Random Test Generation for Deep Learning Compilers

Luyao Ren, ZiHeng Wang|arXiv (Cornell University)|Feb 2, 2023
Adversarial Robustness in Machine LearningComputer Science3 citations
TL;DR

This paper proposes Isra, a novel constraint-solving approach for generating semantically valid deep learning models to effectively test deep learning compilers. By resolving semantic constraints in a domain-specific, backtracking-free manner, Isra generates diverse, complex models that uncover 24 previously unknown bugs in TVM, Glow, and a commercial compiler.

ABSTRACT

Deep learning compilers help address the 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, the testing method 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 to three popular real-world deep learning compilers including TVM, Glow, and a commercial compiler named SophGo. 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 Isra's effectiveness and practical value.

Motivation & Objective

  • To address the challenge of generating semantically valid deep learning models for testing deep learning compilers, which are critical for AI application reliability.
  • To overcome the inefficiency and low diversity of existing random testing approaches that rely on filtering invalid inputs via declarative checks.
  • To design a domain-specific constraint solver that can resolve complex, interdependent constraints across model structure and operations without backtracking.
  • To achieve both soundness and completeness in test input generation, ensuring no valid model is missed while maintaining high efficiency.
  • To evaluate Isra’s effectiveness in generating diverse, complex models and detecting real-world compiler bugs in production compilers.

Proposed method

  • Model deep learning compilers’ semantic specifications as logic constraints involving graph structure and operation-level requirements (e.g., tensor dimension compatibility).
  • Design a domain-specific constraint solver that processes constraints in a strategic instantiation order to simplify and resolve them incrementally.
  • Use consistency checks across constraints to avoid backtracking, ensuring soundness and completeness in solution generation.
  • Integrate the solver into a random test generation pipeline that constructs computation graphs satisfying all semantic constraints.
  • Apply the approach to three real-world deep learning compilers: TVM, Glow, and a commercial compiler, for empirical evaluation.
  • Leverage the solver to generate complex models with diverse operation types and tensor shapes, improving coverage and bug detection.

Experimental results

Research questions

  • RQ1Can a domain-specific constraint solver significantly improve the effectiveness of random test generation for deep learning compilers compared to filtering-based or grammar-based approaches?
  • RQ2To what extent can constraint resolution without backtracking enhance the diversity and complexity of generated test inputs?
  • RQ3How does Isra’s constraint-solving strategy compare to existing tools like Muffin and TVMFuzz in terms of coverage and bug detection?
  • RQ4Can Isra uncover previously unknown, critical bugs in production versions of deep learning compilers?
  • RQ5Does the approach maintain completeness while achieving high efficiency in generating semantically valid models?

Key findings

  • Isra outperforms four baselines—including Muffin and TVMFuzz—on all coverage metrics, including SAC (semantic-aware coverage), with significantly higher model diversity.
  • Isra detects 33 unique bugs across three deep learning compilers, compared to 23 detected by Muffin and only 5 by TVMFuzz on TVM, demonstrating superior detection capability.
  • Isra uncovers 24 previously unknown bugs in released versions of TVM, Glow, and a commercial compiler, validating its practical value in real-world testing.
  • The constraint solver in Isra achieves high efficiency by resolving constraints in a consistent, backtracking-free manner, enabling the generation of complex, valid models.
  • Isra’s approach achieves higher coverage on NSA (neural structure awareness) and SAC metrics than Muffin, which relies on hard-coded reshape insertions to patch constraints.
  • The evaluation confirms that Isra’s method is both sound and complete, ensuring no valid model is missed during test generation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.