Data-driven Test Generation for Fuzzing AI Compiler
This paper presents OPERA, a unified data-driven testing framework that systematically addresses stage-specific challenges in AI compilers through three specialized techniques (OPERA, OATest, and HARMONY), successfully detecting 266 previously unknown bugs across four widely used compilers.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine an AI Compiler as a master chef in a high-tech kitchen. Its job is to take a complex recipe (an AI model written by data scientists) and transform it into a dish that can be cooked perfectly on any specific stove, oven, or grill (different hardware like GPUs or TPUs).
However, just like any complex kitchen, this chef can make mistakes. Sometimes the recipe gets translated wrong, sometimes the cooking steps are optimized poorly, and sometimes the final dish burns because the stove settings were misunderstood. These mistakes are "bugs," and if they happen, the AI model might crash or give wrong answers.
This paper introduces a new, three-part "tasting team" called OPERA, OATest, and HARMONY. Instead of just hoping the chef gets it right, this team systematically tries to break the chef's process at every single stage of cooking to find and fix mistakes before they reach the customer.
Here is how each part of the team works, using simple analogies:
1. The Translator Check: OPERA (Model Loading Stage)
The Problem: The first step is translating the recipe from a specific language (like PyTorch or Keras) into a universal language the kitchen understands. If the translator messes up a specific ingredient (like "ReLU" or "Conv2D"), the whole dish fails.
The Solution (OPERA): Imagine you have a library of thousands of "practice recipes" that professional cooks have already tested to make sure the ingredients work correctly. OPERA takes these existing, trusted practice recipes and forces the compiler to translate them.
- How it works: It doesn't invent new recipes; it "migrates" (moves) these known-good tests into the compiler's translation phase.
- The Result: By checking every possible way an ingredient can be used, OPERA found 170 bugs where the compiler failed to translate the recipe correctly. It's like checking if the chef knows how to chop an onion in 50 different ways, not just one.
2. The Strategy Check: OATest (High-Level Optimization)
The Problem: Once the recipe is translated, the chef tries to make it faster. This is the "High-Level Optimization" stage. The chef might decide to combine two steps into one or rearrange the order of operations. The tricky part is that the context matters. Combining steps works great in one situation but causes a disaster in another.
The Solution (OATest): Think of this as a "What-If" game. The team looks at the chef's notes on how they intend to optimize things. Then, they take those optimization ideas and paste them into random, complex parts of the recipe to see if the chef gets confused.
- How it works: It extracts the "rules" the chef uses to optimize and then mixes them with random, messy scenarios to see if the logic breaks. It's like asking, "If you combine these two steps, what happens if the pot is empty?"
- The Result: This method found 56 bugs where the chef's strategy for speeding things up actually broke the logic of the dish.
3. The Hardware Check: HARMONY (Low-Level Optimization)
The Problem: The final stage is tailoring the recipe for a specific stove (like a high-end GPU). This is "Low-Level Optimization." It's very technical and involves things like memory speed and parallel cooking. It's hard to test because the rules are strict and hidden deep in the manual.
The Solution (HARMONY): This team uses a "Mutation" approach. Imagine you have a perfect, working recipe. HARMONY makes tiny, careful changes to it (mutations) to see if the specific stove can handle the new version.
- How it works: It uses a smart AI assistant (a Large Language Model) to read the stove's manual and generate a diverse set of "seed" recipes. Then, it makes small tweaks to these seeds to specifically trigger the stove's special features (like hiding memory delays).
- The Result: This found 40 bugs where the compiler tried to optimize for the specific hardware but ended up generating code that the hardware couldn't execute correctly.
The Big Picture
By combining these three approaches, the team created a unified testing framework that covers the entire cooking process from start to finish.
- OPERA checks the translation.
- OATest checks the strategy.
- HARMONY checks the hardware execution.
The Scorecard:
Together, this team found 266 previously unknown bugs in four major AI compilers (TVM, TensorRT, ONNXRuntime, and OpenVINO). Many of these were confirmed by the developers, proving that this "tasting team" is essential for keeping AI software reliable and safe.
The paper concludes by saying they plan to expand this team to test even newer, emerging AI kitchens in the future, ensuring that as AI technology evolves, the tools to build it remain bug-free.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.