NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AdaTune: Adaptive Tensor Program Compilation Made Efficient

Menghao Li, Minjia Zhang, Chi Wang, Mingqin Li

Optimizing deep learning (DL) models for production is a notorious bottleneck. While high-level frameworks like PyTorch and TensorFlow make building models easy, making them run fast on specific hardware (like a mobile CPU or a high-end GPU) usually requires a "DL Compiler."

Deep Learning Compilation Pipeline

In a paper presented at NeurIPS 2020, researchers from Microsoft introduced AdaTune, a system designed to drastically reduce the time it takes to find the "perfect" way to run a tensor program without sacrificing performance.

TL;DR

AdaTune significantly accelerates the "Learning-to-Compile" process by using adaptive statistical techniques to search for optimal code transformations. It achieves up to a 3.9x speedup in optimization time and can boost model execution performance by up to 115% compared to the state-of-the-art AutoTVM under the same time budget.

What Problem Does This Paper Address?

To get maximum performance, DL compilers like TVM perform a "black-box" search. They take a piece of code (like a convolution) and try thousands of different "knobs"—different ways to tile loops, unroll iterations, or manage memory.

The problem? To know if a specific configuration is good, the compiler has to actually run it on the hardware and measure the time. This "Learning-to-Compile" approach is powerful but painfully slow. Optimizing a single model like ResNet-18 can take tens of hours because the system spends the vast majority of its time waiting for hardware measurements.

Time Cost Breakdown

As shown above, hardware measurement dominates the optimization time, often accounting for over 90% of the total cost. Furthermore, existing systems often use static settings for exploration that don't adapt to different hardware types or model complexities.

Methods

AdaTune introduces three core "adaptive" pillars to make this search more efficient:

  1. Adaptive Evaluator (AE): Standard tuners run a configuration a fixed number of times (e.g., 64 repeats) to get an average. AdaTune realizes this is wasteful. It uses "statistical early termination." It breaks measurements into micro-batches and calculates the Coefficient of Variation (CV). If the measurement stabilizes (low CV) after just a few runs, it stops early and moves on.
  2. Surrogate Modeling with Uncertainty: Instead of just predicting how fast a configuration will be, AdaTune uses a Random Forest regressor to estimate both the performance (mean) and the uncertainty (variance). This allows the system to use "Expected Improvement" (EI) to pick the next configurations to test, prioritizing areas where it might find a new "gold mine" of performance.
  3. Contextual Optimizer: Most tuners use a fixed "epsilon-greedy" strategy (e.g., explore randomly 5% of the time). AdaTune replaces this with a contextual factor ($\epsilon_t$) that changes dynamically. If the model is highly uncertain about the search space, it explores more; as it becomes more confident, it hones in on the best-known configurations.

Datasets

The authors evaluated AdaTune using several standard deep learning workloads and architectures:

  • Models: ResNet-18, VGG16, SqueezeNet V1, and Transformer-based GEMM (General Matrix Multiply) operators.
  • Hardware: Evaluation was performed on both Intel Xeon x86 CPUs and Nvidia Tesla P100 GPUs to demonstrate hardware-agnostic improvements.
  • Baseline: The primary point of comparison was AutoTVM, the industry-standard "Learning-to-Compile" framework.

Key Insights and Ideas

  • Measurement is the Bottleneck: The authors proved that over 80-90% of optimization time is spent simply waiting for hardware to report back. By cutting down the number of repeats needed for stable measurements, they attacked the biggest time-sink directly.
  • Variance is Heterogeneous: One of the most interesting "aha" moments was that measurement variance isn't the same everywhere. GPUs often show lower relative variance than CPUs for certain tasks. AdaTune’s ability to sense this variance allows it to spend less time measuring on "stable" hardware.
  • Exploration shouldn't be a Constant: Static exploration rates are almost always wrong. By tying exploration to the surrogate model's uncertainty, the search becomes "self-aware," avoiding local optima more effectively than traditional simulated annealing.

Key Results

  • Massive Time Savings: To reach the same level of optimization as the baseline, AdaTune was 1.3x to 3.9x faster. For example, optimizing ResNet-18 on a GPU was slashed from 22.6 hours down to just 9.6 hours.
  • Better Peak Performance: When given the same amount of time as the baseline, AdaTune found much better configurations, yielding up to 115% higher GFLOPS (throughput).
  • Efficiency: The "Adaptive Evaluator" alone reduced hardware measurement time by roughly 2.5x without losing accuracy in the search.

Limitations and Future Work

While AdaTune is a major step forward, the authors noted some challenges:

  • Sparse Search Spaces: In workloads with many "invalid" configurations (knobs that result in zero performance or errors), the model is highly dependent on finding a few "good" points early on to start learning effectively.
  • Integration: While tested on TVM, the authors suggest these principles could be integrated into other search-based optimization frameworks beyond just DL compilers.
  • Future Directions: The paper suggests further research into combining these techniques with more advanced clustering or non-uniform sampling methods to further prune the search space.

Reference: Li, M., Zhang, M., Wang, C., & Li, M. (2020). AdaTune: Adaptive Tensor Program Compilation Made Efficient. 34th Conference on Neural Information Processing Systems (NeurIPS 2020).

Summary updated

BibTeX
@inproceedings{li2020adatune,
  author = {Menghao Li and Minjia Zhang and Chi Wang and Mingqin Li},
  title = {{AdaTune: Adaptive Tensor Program Compilation Made Efficient}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure