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

ALT: Boosting Deep Learning Performance by Breaking the Wall between Graph and Operator Level Optimizations

Zhiying Xu, Jiafan Xu, Hongding Peng, Wei Wang, Xiaoliang Wang, Haoran Wan, Haipeng Dai, Yixu Xu, Hao Cheng, Kun Wang, Guihai ChenarXiv 2022 · DOI

TL;DR

This paper introduces ALT, a compiler that unifies graph-level data layout optimization and operator-level loop optimization for deep learning models. By breaking down the traditional separation between these optimization stages and employing a novel joint auto-tuning framework, ALT achieves significant performance improvements over existing state-of-the-art compilers.

What Problem Does This Paper Address?

Deep learning models require highly optimized code to run efficiently on diverse hardware. Current deep learning compilers typically optimize two key aspects separately: graph-level optimizations (like how data is arranged in memory, known as tensor layout) and operator-level optimizations (like how loops within an operation are structured). This separation is problematic because the optimal tensor layout can heavily influence how well loops can be optimized, and vice-versa. Existing compilers often fix the tensor layout first and then optimize loops, missing opportunities for synergistic improvements. This "one-off" approach can lead to suboptimal performance, especially as deep learning models and hardware evolve rapidly.

Methods

ALT tackles this challenge with a two-pronged approach:

  • Generic Transformation Module: This module provides a set of "primitive functions" that allow for easy manipulation of tensor layouts and loop structures. Crucially, these primitives abstract away the need for manual re-implementation of operators when layouts change, significantly reducing the cost of layout transformations. This includes advanced primitives like unfold for handling overlapping tiles in operations like convolutions.
  • Joint Auto-Tuning Module: This module orchestrates the optimization process. It builds a unified search space that considers both data layout and loop configurations. To manage the immense complexity of this combined search space, ALT employs:
  • Space Pruning: Layout tuning is focused only on "complex" operators (like convolutions and matrix multiplications) where layout has a significant impact, and results are propagated to simpler operators. Custom "tuning templates" are used to expose only relevant parameters for tuning.
  • Cross-Exploration Architecture: Instead of a direct search, ALT uses a staged approach. A joint stage searches for optimal layouts while considering loop optimization feedback, followed by a loop-only stage. This prevents inefficient re-exploration of loop spaces when layouts change.
  • Reinforcement Learning (RL): The PPO algorithm is used to efficiently explore the search space, guided by a cost model that predicts performance to minimize expensive on-device measurements.
  • Layout Propagation: To avoid runtime overhead from layout conversions between operators, ALT propagates layout choices from one operator to its neighbors. This mechanism ensures that upstream operators produce data in the desired layout, eliminating the need for explicit conversion operators and preserving opportunities for operator fusion.

Datasets

Not explicitly discussed in the paper as training datasets. The paper focuses on evaluating ALT on various deep learning models and operators.

Key Insights and Ideas

  • The "Wall" is Artificial: The strict separation between graph-level (layout) and operator-level (loop) optimizations is a major bottleneck. Jointly optimizing them unlocks significant performance gains.
  • Layout Matters for Loops (and Vice-Versa): The paper demonstrates that the best loop optimizations are highly dependent on the chosen tensor layout, and vice-versa. For example, optimizing loops for different layouts of a 2D convolution operator can yield substantial speedups.
  • Reducing Transformation Cost is Key: The high cost of re-implementing operators when changing layouts is a primary reason for the existing separation. ALT's primitive functions and layout propagation mechanism drastically reduce this cost.
  • Layout Propagation is Crucial for Efficiency: By propagating layout choices and avoiding explicit conversion operators, ALT minimizes runtime overhead and preserves opportunities for operator fusion, a critical loop optimization technique.
  • Auto-tuning Needs to be Smart: The combined search space for layout and loops is astronomically large. ALT's space pruning and RL-based exploration are essential for making this search tractable and efficient.

Key Results

ALT demonstrates significant performance improvements across various hardware platforms (Intel CPU, NVIDIA GPU, ARM CPU):

  • Single Operator Performance: Achieved an average speedup of 1.5x over state-of-the-art compilers like Ansor. For specific operators like Dilated and Depth-wise convolutions, ALT showed even larger speedups due to its effective layout tuning.
  • End-to-End Inference Performance: Achieved an average speedup of 1.4x over state-of-the-art compilers like Ansor on various neural networks (ResNet, MobileNet, BERT, ResNet3D).
  • Novel Layouts: ALT can discover data layouts that are not typically explored by existing methods.
  • Production Deployment: ALT has been deployed in production for four months, boosting a range of real-world workloads.

Limitations and Future Work

  • Search Space Complexity: While ALT employs pruning and efficient exploration, the search space for complex models can still be very large, requiring significant tuning time (though ALT aims to make this a one-time cost).
  • Constraint on Layout Propagation: The layout propagation mechanism has certain constraints, such as not propagating through non-trivial advanced primitives or across certain types of operators, which might necessitate conversion operators in some cases.
  • Future Work: The paper suggests that recent loop optimization techniques (cost models, operator fusion, micro-kernel construction) are complementary to ALT and could be further integrated. The authors also mention the scalability of their tuning space and the potential for further exploration with larger budgets or more complex templates.

Summary updated

BibTeX
@misc{xu2022alt,
  author = {Zhiying Xu and Jiafan Xu and Hongding Peng and Wei Wang and Xiaoliang Wang and Haoran Wan and Haipeng Dai and Yixu Xu and Hao Cheng and Kun Wang and Guihai Chen},
  title = {{ALT: Boosting Deep Learning Performance by Breaking the Wall between Graph and Operator Level Optimizations}},
  year = {2022},
  eprint = {2210.12415},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.12415},
}
Figure