Daydream: Accurately Estimating the Efficacy of Optimizations for DNN Training

Hongyu Zhu, Amar Phanishayee, Gennady Pekhimenko

Abstract

Deep Learning (DL) practitioners often struggle to predict which optimizations will yield significant performance gains for their specific hardware and software configurations. Daydream is a predictive profiling tool that addresses this "Optimization Paradox" by allowing developers to accurately estimate the efficacy of DNN optimizations without implementing them. By modeling execution as a fine-grained dependency graph and providing simple graph-transformation primitives, Daydream can estimate the performance of complex optimizations across various stacks with less than 15% error.

Introduction

While researchers propose numerous techniques to accelerate DNN training—such as mixed precision, kernel fusion, or gradient compression—their actual effectiveness is highly sensitive to model architecture, GPU type, and software versions. Currently, the only way to verify an optimization's impact is through time-consuming implementation and debugging. Existing tools like NVProf or TensorBoard are retrospective; they describe what happened but cannot answer predictive "what-if" questions. Daydream fills this gap by providing a system for predictive profiling.

Methodology

Daydream introduces a system for predictive profiling based on three core pillars:

1. Kernel-Granularity Dependency Graph

Instead of high-level layers, Daydream utilizes low-level traces via NVIDIA’s CUPTI to map every individual GPU kernel, CPU task, and communication event. This captures the intricate dependencies between tasks, including the "gaps" caused by CPU overhead and synchronization.

2. Synchronization-Free Mapping

A major challenge in profiling is mapping thousands of low-level kernels back to their high-level DNN layers. Daydream uses a novel, non-intrusive timestamping method to correlate framework-level operations with hardware-level execution without slowing down the training process.

Mapping high-level layers to low-level GPU kernels

3. Graph-Transformation Primitives

To model an optimization, users apply high-level primitives to the dependency graph:

  • Selection: Identify specific tasks (e.g., all convolution kernels).
  • Transformation: Scale task durations (to model faster hardware) or Insert/Remove tasks (to model kernel fusion or added overhead).
  • Scheduling: Change the execution order to model different communication strategies.
Graph transformation primitives for modeling optimizations

Finally, Daydream runs a discrete-event simulation on the modified graph to predict the total execution time.

Evaluation and Key Results

The authors evaluated Daydream across a diverse set of models (ResNet-50, VGG19, BERT, GNMT) and frameworks (PyTorch, MXNet, Caffe) on clusters using NVIDIA 2080Ti and P4000 GPUs.

  • High Accuracy: For single-GPU optimizations like Automatic Mixed Precision (AMP), Daydream’s predictions were within 8% to 13% of the measured ground truth. For multi-GPU distributed training, the error rate was typically under 10%.
  • Optimization Exploration: The tool successfully modeled 10 different mainstream optimizations, proving its versatility in handling everything from simple precision changes to complex communication-computation overlapping strategies.

Discussion and Key Insights

Daydream reveals that despite the massive parallelism of GPUs, the control flow of DNN training is surprisingly sequential, making dependency graph simulation computationally feasible. A critical insight provided by the tool is that CPU overhead is often the "silent killer" of performance; many optimizations fail because they speed up the GPU while leaving CPU bottlenecks (like kernel launch times) untouched.

While Daydream is excellent at scaling existing tasks, it currently requires users to provide runtime estimates for brand-new, custom-written kernels. Additionally, the tool focuses purely on throughput and does not predict how optimizations might affect mathematical convergence or accuracy. Future work may involve porting Daydream to other accelerators beyond NVIDIA GPUs.

Summary updated

BibTeX
@inproceedings{zhu2020daydream,
  author = {Hongyu Zhu and Amar Phanishayee and Gennady Pekhimenko},
  title = {{Daydream: Accurately Estimating the Efficacy of Optimizations for DNN Training}},
  booktitle = {USENIX Annual Technical Conference},
  year = {2020},
  url = {https://openreview.net/forum?id=uCRQqcHsYgu},
}
Figure