Computational Performance Predictions for Deep Neural Network Training: A Runtime-Based Approach

Geoffrey X. Yu, Yubo Gao, Pavel Golikov, Gennady Pekhimenko

Introduction

Deep learning researchers frequently face a "paradox of choice" regarding hardware. Selecting between a local workstation GPU and a high-end cloud instance (like a V100 or A100) is often a gamble. Traditional metrics, such as "peak FLOPS" provided by manufacturers, are notoriously poor predictors of real-world training performance because DNN workloads rarely saturate a GPU's theoretical limits.

Existing methods for hardware selection are often impractical. Direct measurement requires pre-existing access to the target hardware, while standard benchmarks rarely cover custom research models. Simple heuristics, such as ratios based on CUDA core counts, frequently result in significant inaccuracies, sometimes exceeding 60% error.

Simple heuristics like peak FLOPS ratios often lead to high prediction errors, necessitating a more robust approach like Habitat.

To address this, researchers from the University of Toronto and the Vector Institute developed Habitat, a runtime-based performance predictor. Habitat allows practitioners to accurately estimate DNN training times on target GPUs using only measurements from their existing hardware.

Methodology: The Habitat Framework

Habitat employs a hybrid prediction strategy. It begins by profiling a single training iteration on an "origin" GPU to gather execution metadata. This data is then scaled to a "destination" GPU using two distinct techniques:

1. Wave Scaling and the Roofline Model

For "kernel-alike" operations—those using the same underlying code across different GPU architectures—Habitat scales execution time based on hardware ratios such as memory bandwidth and clock frequency. It also accounts for the number of "waves" (groups of thread blocks) that can run concurrently.

Central to this process is the roofline model. This model helps Habitat determine whether a specific operation is bottlenecked by memory bandwidth or computational throughput by analyzing its arithmetic intensity (FLOP/byte).

The roofline model is used to estimate whether a kernel's performance is limited by memory bandwidth (D·x) or peak compute (P).

2. MLP Predictors

For "kernel-varying" operations like convolutions, where different architectures may employ entirely different proprietary algorithms (e.g., via cuDNN), Habitat utilizes pre-trained Multi-Layer Perceptrons (MLPs). These models map operation parameters and target GPU specifications directly to predicted execution times.

Experimental Setup and Results

The researchers trained Habitat's MLP predictors using a massive dataset of execution times for four key operations (2D Convolution, LSTM, Batched Matrix Multiply, and Linear Layer) across six GPU architectures, including the P100, V100, and 2080Ti. Habitat was evaluated on five diverse models: ResNet-50, Inception v3, GNMT, Transformer, and DCGAN.

Key Findings

  • High Accuracy: Habitat achieved an average prediction error of just 11.8% across all tested models and GPU pairs, significantly outperforming heuristic-based methods.
  • Cross-Generational Success: The tool successfully predicted performance across three GPU generations (Pascal, Volta, Turing) and across different hardware tiers (desktop vs. server-class).
  • Informed Cost-Efficiency: Habitat provides actionable insights for resource allocation. For instance, it correctly identified that while a V100 is the fastest for training GNMT, a T4 instance is significantly more cost-efficient. Conversely, for "computationally light" models like DCGAN, it predicted that a high-end V100 offers negligible benefits over a mid-range 2080Ti.

Conclusion and Future Work

Habitat demonstrates that understanding the interaction between a kernel's arithmetic intensity and specific hardware limits is crucial for accurate performance modeling. While currently optimized for single-GPU CUDA environments, future work aims to extend Habitat to distributed training, mixed precision, and non-CUDA accelerators like TPUs. Additionally, addressing the "memory constraint" problem—where the origin GPU must fit the desired batch size—remains a key challenge for future iterations.

Summary updated

BibTeX
@inproceedings{yu2021computational,
  author = {Geoffrey X. Yu and Yubo Gao and Pavel Golikov and Gennady Pekhimenko},
  title = {{Computational Performance Predictions for Deep Neural Network Training: A Runtime-Based Approach}},
  booktitle = {USENIX ATC},
  year = {2021},
  url = {https://openreview.net/forum?id=tMPEN2AO9q},
}
Figure