ALCOP: Automatic Load-Compute Pipelining in Deep Learning Compiler for AI-GPUs

Guyue Huang, Yang Bai, Liu Liu, Yuke Wang, Bei Yu, Yufei Ding, Yuan Xie

TL;DR

ALCOP is the first compiler-native framework that automatically implements multi-stage, multi-level pipelining for GPU tensor programs. By overlapping data movement across memory hierarchies with computation, it achieves an average 1.23× speedup over TVM and finds near-optimal configurations 40× faster than exhaustive search.

What Problem Does This Paper Address?

To get the most out of modern AI-GPUs (like the NVIDIA Ampere architecture), developers use "tiling"—breaking large matrices into smaller chunks to fit into fast on-chip memory. However, aggressive tiling creates a bottleneck: it reduces the number of active threads (parallelism), leaving the GPU's massive compute power underutilized while it waits for data to arrive from global memory.

Traditionally, "pipelining" (loading the next chunk of data while computing the current one) is the solution. But until now, this was mostly handled by hand-written vendor libraries like cuBLAS. These libraries are "black boxes"—they don't work for custom operators and can't be easily combined with other compiler optimizations like operator fusion. Existing deep learning compilers either lacked pipelining entirely or were limited to simple "double-buffering," which isn't enough to hide the high latency of modern hardware.

Methods

The authors introduce ALCOP (Automatic Load-COmpute Pipelining), which integrates pipelining directly into the compiler's lowering process through three decoupled modules:

  1. Pipeline Buffer Detection: During the scheduling phase, the compiler identifies "load-and-use" structures. It applies specific rules to ensure pipelining is safe, such as checking if the hardware supports asynchronous memory copies and ensuring the loop is sequential.
  2. Program Transformation: This is the "heavy lifting" module. It modifies the Intermediate Representation (IR) to handle complex index math for "circular" buffers, injects synchronization primitives (acquire/release), and creates "prologues" (initial data loads) to prime the pipeline. Crucially, it supports multi-level pipelining (e.g., Global Memory → Shared Memory → Registers).
  3. Analytical-Model Guided Tuning: Pipelining adds new parameters (like the number of pipeline stages) to an already massive search space. ALCOP uses a hardware-aware analytical model to pre-train a machine-learning cost model (XGBoost). This allows the auto-tuner to skip low-performance regions of the design space and find optimal settings much faster.

Datasets

The authors evaluated ALCOP using:

  • Individual Operators: A suite of MatMul (Matrix Multiplication), BMM (Batched MatMul), Conv2D, and Conv3D operators with shapes extracted from real-world DNN workloads.
  • End-to-End Models: Six popular models including BERT, BERT-Large, GPT-2, ResNet-18, ResNet-50, and VGG-16.
  • Hardware: All tests were performed on the NVIDIA A100-SMX4 GPU.

Key Insights and Ideas

  • The "Progressive Lowering" Advantage: Instead of treating pipelining as a single monolithic problem, ALCOP exploits the different stages of a compiler. It detects buffers when the dataflow is visible and transforms code when the loop structure is revealed.
  • Multi-Stage > Double Buffering: The paper demonstrates that simple two-stage double-buffering often fails to fully hide memory latency. Moving to 3 or 4 stages (multi-stage) is necessary for peak utilization on Ampere-class GPUs.
  • Synergy with Tiling: Pipelining isn't just an "extra" optimization; it's a corrective measure. It restores the intra-tile parallelism that is often lost when compilers choose large tile sizes to improve data reuse.
  • Model-Assisted Search: Pure ML-based tuning takes too long because it starts with zero knowledge. By "seeding" the ML model with an analytical understanding of hardware bottlenecks, they drastically reduce the number of physical trials needed on the GPU.

Key Results

  • Speedup: ALCOP generated programs that were 1.23× faster on average (and up to 1.73× faster) than vanilla TVM for single operators.
  • End-to-End Gains: On full models, ALCOP outperformed TVM by up to 1.18× and XLA by up to 1.64×.
  • Efficiency: The analytical performance model allowed the system to find schedules achieving 99% of peak performance while requiring 40× fewer trials than exhaustive search.
  • Library Comparison: ALCOP-generated kernels achieved roughly 93% of the performance of highly optimized vendor libraries (cuBLAS/cuDNN), and in some specific cases (like BMM with short reduction axes), it actually outperformed them.

Limitations and Future Work

  • Hardware Specificity: The current implementation relies heavily on the asynchronous copy features introduced in the NVIDIA Ampere architecture. Porting this to older GPUs or different vendors (like AMD or specialized AI accelerators) would require adapting the transformation module to different synchronization primitives.
  • Complexity of Fusion: While ALCOP supports inner-pipeline fusion, extremely complex fused operators might still challenge the buffer detection logic.
  • Future Directions: The authors suggest that future work could extend these techniques to even more complex memory hierarchies or explore how pipelining interacts with dynamic shape workloads.

Summary updated

BibTeX
@inproceedings{huang2023alcop,
  author = {Guyue Huang and Yang Bai and Liu Liu and Yuke Wang and Bei Yu and Yufei Ding and Yuan Xie},
  title = {{ALCOP: Automatic Load-Compute Pipelining in Deep Learning Compiler for AI-GPUs}},
  booktitle = {MLSys},
  year = {2023},
}
Figure