AI
XCheck: Finding Hidden Compiler-Hardware Mismatch Bugs in Deep Learning
Researchers reveal that testing a single layer of deep learning compiler stacks misses critical bugs that emerge from interactions between compilers and their target hardware.
When a deep learning model is compiled to run on a GPU, CPU, or other specialized hardware, it must satisfy a web of constraints spanning three layers: the model itself, the compiler, and the target platform. But conventional testing approaches only check fragments of these requirements—and that blindness lets dangerous bugs slip through.
A new research effort called XCheck directly addresses this gap by systematically uncovering and testing cross-layer constraints in deep learning compiler stacks. The work reveals that existing test generation methods and coverage metrics miss a large class of real bugs that only manifest when the compiler and hardware disagree.
The Hidden Bug Surface#
Deep learning compilers like TVM, ONNX-MLIR, and GeneSys translate neural networks into executable code for diverse processors. Each layer of this translation stack has its own rules: the model specifies layer dimensions and data types, the compiler defines how it optimizes and structures code, and the platform dictates memory alignment, instruction constraints, and other hardware realities.
Today's testing mostly focuses on constraints one layer at a time. Tests often get filtered out before they ever reach platform-specific code paths. Even when a bug occurs, conventional metrics for code coverage and test effectiveness don't distinguish between compilations that only differ in subtle, hardware-dependent states.
As a result, compiler-platform interaction bugs—failures that emerge only when compiler behavior collides with hardware requirements—remain largely invisible.
How XCheck Works#
The researchers built a system that extracts constraints deterministically from three sources: compiler documentation, compiler source code, and published hardware specifications. It then uses constraint synthesis to generate model variants that either satisfy all applicable rules or deliberately violate a chosen one.
The technique includes two key innovations:
-
Smart test prioritization: It ranks constraints by how often their tests survive filtering and actually reach the code-generation phase where hardware-specific logic lives. Early experiments showed this could boost the fraction of tests reaching code generation by up to 8.5 percentage points.
-
Instrumented compilers: Guards inserted into the compiler record how intermediate compilation states relate to both compiler and platform properties. This reveals behavior variations that standard coverage tools treat as identical.

