Ladder: Enabling Efficient Low-Precision Deep Learning Computing through Hardware-aware Tensor Transformation

Lei Wang, Lingxiao Ma, Shijie Cao, Quanlu Zhang, Jilong Xue, Yining Shi, Ningxin Zheng, Ziming Miao, Fan Yang, Ting Cao, Yuqing Yang, Mao YangOSDI 2024

TL;DR

This paper introduces LADDER, a novel compiler that bridges the gap between custom low-precision data types and hardware limitations in deep learning. By introducing a flexible type system and hardware-aware scheduling, LADDER significantly accelerates deep learning inference on modern accelerators without requiring hardware modifications, enabling greater exploration of low-precision computing.

What Problem Does This Paper Address?

Deep learning models are becoming increasingly large and computationally demanding. To meet this demand, researchers are exploring the use of lower-precision numerical formats (e.g., 8-bit, 4-bit integers, or custom floating-point formats) to reduce memory footprint and computational cost. This is possible because deep learning models are often robust to small numerical errors. However, current hardware accelerators (like GPUs) have limited support for these custom low-precision data types. Existing software often struggles to efficiently handle these types, leading to performance bottlenecks. This mismatch between the evolving needs of deep learning models and the capabilities of hardware creates a significant challenge for achieving real-world performance gains from low-precision computing.

Methods

LADDER tackles this problem by introducing a two-pronged approach:

  • Hardware-aware Tensor Transformation: LADDER treats custom data types as a first-class citizen. It uses a novel type system called tType to represent these custom types and an extended tensor expression to define computations involving them. The core idea is to separate data storage and computation: tensors are stored in custom low-precision formats but converted to standard formats for computation on hardware.
  • tTile Abstraction and Scheduling: LADDER represents DNN computations as a tTile-graph, where each node is a tTile-operator. It also abstracts hardware accelerators as tTile-device hierarchies. The key innovation lies in tTile transformations (slice, map, pad, convert) that allow for flexible manipulation of tensor layouts and data types. A hardware-aware, latency-oriented scheduling policy then optimizes these transformations to align with hardware capabilities, minimizing latency and maximizing efficiency.

Datasets

The paper does not explicitly mention datasets used for training LADDER itself. However, for evaluation, they use a suite of state-of-the-art DNN models, including:

  • Large Language Models (LLMs): LLAMA-70B, BLOOM-176B
  • Computer Vision Models: ResNet-50, ShuffleNet-V2, ViT-Base
  • Audio Models: Conformer-L

These models are evaluated across various data type configurations (e.g., WFP16AFP16, WINT4AFP16, WNF4AFP16, WFP8AFP8, WMXFP8AMXFP8, WINT1AINT8) and batch sizes/sequence lengths to simulate diverse deployment scenarios.

Key Insights and Ideas

  • Separation of Storage and Computation: The fundamental insight is that custom low-precision data can be stored efficiently while being converted to hardware-supported formats only when needed for computation. This decouples memory efficiency from computational constraints.
  • Hardware-Awareness is Crucial: Simply supporting low-precision types isn't enough. LADDER's success hinges on its ability to understand hardware memory hierarchies and compute unit capabilities, and to schedule transformations that optimally align with them.
  • Tensor Transformations as a Unifying Mechanism: The tTile transformation primitives (slice, map, pad, convert) provide a powerful and flexible way to bridge the gap between custom data types and hardware requirements, enabling complex optimizations.
  • Latency-Oriented Scheduling: By prioritizing latency reduction, LADDER's scheduling policy effectively navigates the vast optimization space created by tensor transformations, leading to significant performance improvements.

Key Results

LADDER demonstrates significant performance improvements across various benchmarks and hardware platforms:

  • Speedups: LADDER achieves substantial speedups compared to existing compilers and frameworks. For example, on NVIDIA A100, it shows average speedups of up to 1.4x for WFP16AFP16 configurations and up to 10x for WINT1AINT8 configurations on LLMs. On AMD MI250, it achieves up to 14.1x speedup on ShuffleNet.
  • Custom Data Type Support: LADDER effectively supports custom data types that are not natively supported by hardware, achieving remarkable speedups (e.g., up to 14.6x on A6000 for WINT1AINT8 compared to Welder).
  • Memory Savings: For LLMs, LADDER's low-precision configurations lead to significant memory reductions (e.g., up to 74% for LLAMA and 85% for BLOOM with WINT1AINT8).
  • Compilation Time: LADDER generally exhibits competitive or faster compilation times compared to other advanced systems like AMOS and TensorIR.

Limitations and Future Work

  • Inference Focus: The current implementation of LADDER primarily focuses on model inference. The authors acknowledge that both training and inference of low-precision models require similar system and hardware support, and they leave low-precision training as future work.
  • Multi-GPU Serving: While LADDER can collaborate with multi-GPU frameworks for serving large models, direct integration is left for future research.
  • Scheduling Policy Optimality: The paper notes that their latency-oriented scheduling policy is heuristic-based and not guaranteed to be optimal, suggesting further exploration of more advanced scheduling policies.
  • Hardware Support: LADDER's design is adaptable to new hardware instructions (like FP8 tensor cores) and accelerators, but porting to new architectures requires aligning with the tTile-based hardware abstraction.

Summary updated

BibTeX
@inproceedings{wang2024ladder,
  author = {Lei Wang and Lingxiao Ma and Shijie Cao and Quanlu Zhang and Jilong Xue and Yining Shi and Ningxin Zheng and Ziming Miao and Fan Yang and Ting Cao and Yuqing Yang and Mao Yang},
  title = {{Ladder: Enabling Efficient Low-Precision Deep Learning Computing through Hardware-aware Tensor Transformation}},
  booktitle = {OSDI},
  year = {2024},
  url = {https://openreview.net/forum?id=xKO2z2Z6qZ},
}
Figure