PowerFusion: A Tensor Compiler with Explicit Data Movement Description and Instruction-level Graph IR

Zixuan Ma, Haojie Wang, Jingze Xing, Liyan Zheng, Chen Zhang, Huanqi Cao, Kezhao Huang, Shizhi Tang, Penghan Wang, Jidong ZhaiarXiv 2023 · DOI

Introduction: The Widening Memory Wall

While AI accelerators like GPUs have seen explosive growth in raw computational power (TFLOPS), their memory bandwidth has failed to keep pace. Between 2016 and 2023, the ratio of computation to memory performance increased by over 11x, making memory access the primary bottleneck for many modern Deep Neural Network (DNN) models. This phenomenon, often called the "memory wall," limits the efficiency of state-of-the-art hardware.

The widening gap between computational performance and memory bandwidth (FLOPS/Byte) for NVIDIA and AMD GPUs from 2016 to 2023.

Existing tensor compilers, such as TVM or Ansor, typically rely on loop-based abstractions. These frameworks treat data movement implicitly, which creates significant hurdles: it is difficult to optimize invisible data paths, search orders are often rigid (fusing loops before deciding on memory schedules), and coarse-grained dependency analysis prevents effective data reuse in high-level memory like registers.

The PowerFusion Approach

PowerFusion introduces a novel abstraction called Graph IR (GIR) to address these limitations. Unlike traditional compilers that focus on nested loops, PowerFusion represents a DNN program as a dataflow graph of "gOperators"—fine-grained primitives for computation, data movement, and synchronization.

Key Innovations in GIR

  • Explicit Data Movement: Every transfer between memory hierarchies (e.g., DRAM to SRAM) is explicitly defined, allowing the compiler to optimize the exact path data takes.
  • Instruction-Level Analysis: By moving from loop-level to instruction-level analysis, PowerFusion enables "data multiplexing," reusing data in registers across different operations to drastically reduce slow DRAM access.
  • GIR-Graph Rewriting: The compiler applies automated rules to optimize the graph, including synchronization insertion to determine optimal storage levels, gOperator merging to eliminate redundant I/O, and gOperator swapping to unlock further fusion opportunities.
The PowerFusion workflow: from input graph through graph generation, merging, rewriting, and reordering to final code generation.

Evaluation and Results

PowerFusion was evaluated using seven diverse DNN models (including Transformers like GPT-2 and CNNs like EfficientNet) across three hardware platforms: NVIDIA Tesla A100, AMD Instinct MI100, and Cambricon MLU-370.

The results demonstrate significant performance gains over traditional frameworks and specialized compilers like TVM and TensorRT:

  • NVIDIA A100: Average speedup of 1.28x (up to 1.97x).
  • AMD MI100: Average speedup of 1.23x (up to 2.93x).
  • Cambricon MLU: Average speedup of 2.31x, reaching up to 16.91x in specific workloads.
  • Search Efficiency: PowerFusion's search time is two orders of magnitude shorter than TVM's, as it uses a performance model to prune candidates and leverages native libraries for heavy compute kernels.

Conclusion and Future Work

By making data movement a "first-class citizen" in its intermediate representation, PowerFusion overcomes the rigid constraints of loop-based compilers. While it currently relies on vendor libraries for heavy computation kernels (like large Matrix Multiplications), future work aims to extend GIR to describe these kernels directly. This will enable even deeper fusion, potentially eliminating more memory overhead in complex AI models.

Summary updated

BibTeX
@misc{ma2023powerfusion,
  author = {Zixuan Ma and Haojie Wang and Jingze Xing and Liyan Zheng and Chen Zhang and Huanqi Cao and Kezhao Huang and Shizhi Tang and Penghan Wang and Jidong Zhai},
  title = {{PowerFusion: A Tensor Compiler with Explicit Data Movement Description and Instruction-level Graph IR}},
  year = {2023},
  eprint = {2307.04995},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.04995},
}
Figure