Hydro: Surrogate-Based Hyperparameter Tuning Service in Datacenters

Qinghao Hu, Zhisheng Ye, Meng Zhang, Qiaoling Chen, Peng Sun, Yonggang Wen, Tianwei ZhangOSDI 2023

TL;DR

This paper introduces Hydro, a novel hyperparameter tuning service for deep learning that significantly reduces tuning time and improves resource utilization in datacenters. It achieves this by using smaller "surrogate" models for initial tuning and intelligently managing cluster resources, making hyperparameter optimization more efficient and affordable, especially for large models.

What Problem Does This Paper Address?

Deep learning models have achieved remarkable performance, but their effectiveness heavily relies on carefully tuned hyperparameters. The process of finding these optimal hyperparameters, known as hyperparameter tuning (HPO), is notoriously resource-intensive and time-consuming. Existing HPO systems struggle with several key challenges:

  • Costly tuning of large models: Modern foundation models with billions of parameters require an astronomical amount of resources for even a single training trial, making comprehensive hyperparameter sweeps infeasible.
  • Inefficient hardware utilization: Datacenter GPUs are often underutilized due to massive training jobs, communication overheads, and pipeline bubbles, leading to wasted resources.
  • Lack of cluster-wide awareness: Current HPO systems operate in isolation, failing to leverage or coordinate with datacenter schedulers and dynamic resource availability.

These issues make HPO a bottleneck for developing high-performing deep learning models, especially in resource-constrained environments.

Methods

Hydro tackles these problems with a two-pronged approach: Hydro Tuner for job-level optimization and Hydro Coordinator for cluster-level optimization.

Hydro Tuner:

  • Surrogate-Based Tuning: Instead of tuning on the full-sized target model, Hydro uses a smaller "surrogate" model. This is enabled by a novel hyperparameter transfer theory (specifically, Maximal Update (MU) parametrization) that allows hyperparameters found on smaller models to be effectively transferred to larger ones.
  • Model Shrinker: Automatically traces, scales, and parametrizes the target model to create surrogate models.
  • Trial Binder: Improves resource utilization by fusing multiple trials (inter-trial fusion) into a single computation unit, reducing memory overhead and increasing throughput. It also supports intra-trial fusion for further optimization.
  • Trial Planner: Adaptively determines tuning strategies, including fusion counts and resource allocation, based on profiling and intermediate results.

Hydro Coordinator:

  • Bubble Squeezer: Leverages "bubbles" (idle periods) in large, pipeline-parallel model training jobs (like foundation model pretraining) to interleave HPO trials. This allows HPO jobs to utilize otherwise wasted resources without significantly impacting the primary training job.
  • Heterogeneity-Aware Allocator: Intelligently assigns HPO trials to GPUs of varying generations (e.g., A100, V100) to maximize cluster-wide efficiency, considering the diminishing resource needs of HPO jobs as they progress.
  • Elastic Executor: Dynamically splits fused trials or distributes unfused ones across available GPUs to optimize resource usage.

Datasets

The paper evaluates Hydro on several standard deep learning datasets:

  • ImageNet
  • CIFAR-10
  • CIFAR-100
  • Flowers102
  • WikiText-103
  • OpenWebText

Key Insights and Ideas

  • Hyperparameter Transfer is Key: The core insight is that hyperparameters optimized on smaller models can be effectively transferred to larger ones, drastically reducing the computational cost of HPO. This is a significant departure from traditional HPO that tunes on the target model directly.
  • Datacenter Resources are Dynamic: HPO jobs have unique resource consumption patterns (diminishing needs). Hydro leverages this by intelligently interacting with the datacenter scheduler to utilize ephemeral resources (like pipeline bubbles) and heterogeneous hardware.
  • Fusion is More Than Just GPU Sharing: While GPU sharing is common, Hydro's inter-trial fusion, combined with model scaling, offers a more profound way to pack more computation into available resources, leading to substantial throughput gains and memory savings.
  • "Free Lunch" for HPO: By interleaving HPO trials into the idle periods of large training jobs, Hydro effectively gets HPO computation "for free," significantly reducing the overall makespan without compromising the primary workload.

Key Results

Hydro demonstrates significant improvements over existing systems like Ray:

  • Massive Time Reduction: Hydro reduces tuning makespan by up to 78.5× compared to Ray Tune for single-fidelity tuning.
  • Improved Model Quality: In many cases, Hydro achieves better or comparable final model quality compared to baselines.
  • Enhanced GPU Utilization: Hydro achieves significantly higher GPU utilization, with over 10× training throughput improvement and over 20× GPU memory conservation compared to GPU sharing mechanisms like MPS when using inter-trial fusion.
  • Effective Bubble Utilization: Bubble Squeezer can reduce the HPO job makespan by 2.7× by interleaving trials into large model training bubbles.
  • Faster Completion with Deadlines: Hydro can achieve good models within tight deadlines, effectively hiding target model training time within the HPO process.

Limitations and Future Work

The authors acknowledge several limitations:

  • Limited Support for Regularization Hyperparameters: Hydro's parametrization does not currently support hyperparameters like weight decay and dropout, which depend on model size and data size.
  • No Custom Initialization: Hydro enforces its own automatic layer-wise re-initialization for parameterization, preventing users from specifying custom initialization techniques.
  • No Fine-Tuning Support: The current theory is built on i.i.d. samples, limiting its direct application to fine-tuning scenarios that might use pre-trained weights from different datasets.

Future work includes:

  • Supporting more DL frameworks (TensorFlow, JAX).
  • Considering more resource dimensions (CPU, network bandwidth) and enabling dataloader fusion.
  • Expanding to cloud environments and exploring dynamic selection of heterogeneous spot instances.
  • Enabling partial model fusion across jobs with minor architectural differences and integrating model matching techniques for cross-job fusion.

Summary updated

BibTeX
@inproceedings{hu2023hydro,
  author = {Qinghao Hu and Zhisheng Ye and Meng Zhang and Qiaoling Chen and Peng Sun and Yonggang Wen and Tianwei Zhang},
  title = {{Hydro: Surrogate-Based Hyperparameter Tuning Service in Datacenters}},
  booktitle = {OSDI},
  year = {2023},
  url = {https://openreview.net/forum?id=UkPjh4Ilde},
}
Figure