TL;DR
This paper introduces tf.data service, an open-source system that disaggregates ML data preprocessing from model training. By horizontally scaling preprocessing resources and enabling features like ephemeral data sharing and coordinated reads, it significantly reduces training time and cost, especially for input-bound jobs, without compromising model accuracy.
What Problem Does This Paper Address?
Modern machine learning relies heavily on specialized hardware like GPUs and TPUs for accelerated computations. To maximize the efficiency and cost-effectiveness of these expensive accelerators, it's crucial to feed them data at a rate that matches their processing speed. This requires efficient input data preprocessing, which is typically handled by host CPUs and RAM. However, ML jobs have diverse and often unpredictable resource needs for preprocessing, making it challenging to provision a fixed ratio of CPU/RAM to accelerators. This can lead to either under-utilization of accelerators (data stalls) or inefficient use of host resources. Existing solutions often involve colocating preprocessing with training on the same machine, which is problematic due to the bursty nature of preprocessing, or using generic data processing frameworks that are too slow for real-time ML needs.
Methods
The core contribution is tf.data service, a disaggregated system built on TensorFlow's tf.data API. It separates data preprocessing into dedicated "workers" managed by a "dispatcher," while ML clients (running on accelerator hosts) request preprocessed data. Key innovations include:
- Horizontal Scale-Out: The service allows dynamically scaling the number of preprocessing workers (CPU/RAM) independently of the ML accelerators, enabling "right-sizing" resources for each job.
- Ephemeral Data Sharing: Workers cache intermediate preprocessed data, allowing multiple concurrent jobs with identical input pipelines to share these results, avoiding redundant computations.
- Coordinated Reads: For distributed training, this feature synchronizes data fetching from workers to ensure clients receive batches of similar sizes, minimizing padding and synchronization overheads, particularly beneficial for NLP tasks with variable sequence lengths.
- Relaxed Data Visitation Guarantees: The system prioritizes performance by relaxing "exactly-once" to "at-most-once" data visitation guarantees, which is shown to have negligible impact on model accuracy for large, continuously updated datasets.
Datasets
The paper evaluates tf.data service on eight production ML workloads at Google, categorized into computer vision (M1-M4) and natural language processing (M5-M8) domains. They also include a canonical open-source model, ResNet50, trained on the ImageNet dataset. For reproducibility, they use Google Cloud VMs and storage (GCS).
Key Insights and Ideas
- Disaggregation is Key for Efficiency: Separating data preprocessing from ML computation is not just about scaling; it unlocks new optimization opportunities like sharing and coordination that are difficult to achieve in colocated systems.
- Bursty Nature of Preprocessing is a Bottleneck for Colocation: The highly variable CPU usage during data preprocessing makes it difficult to share host resources effectively with other workloads without interference.
- Relaxing Data Guarantees is Practical: For large-scale, real-world ML training, the strict "exactly-once" data visitation guarantee is often unnecessary and can be relaxed to "at-most-once" without impacting model accuracy, significantly simplifying system design and enabling new features.
- Cost Savings Outweigh Resource Costs: The significant speedups achieved by eliminating data stalls lead to substantial cost reductions, even when accounting for the cost of the disaggregated preprocessing infrastructure.
Key Results
- Horizontal Scale-Out: Achieved average training time speedups of 31.7× and average cost savings of 26.2× for input-bound jobs. For model M2, a speedup of 110.3× was observed.
- Ephemeral Data Sharing: Enabled linear savings in preprocessing resources for up to 64 hyperparameter tuning jobs without impacting job time, significantly reducing storage and network bandwidth usage.
- Coordinated Reads: Provided average speedups of 2.2× for NLP jobs with variable sequence lengths, reducing synchronization overheads and improving training time and cost.
- Fleetwide Usage: The system is widely adopted, with jobs deploying anywhere from 2 to over 5,000 workers, demonstrating its scalability and flexibility.
Limitations and Future Work
- Network Latency Impact: While generally manageable, high network latency between workers and clients can increase costs, requiring careful consideration of worker count versus cost optimization.
- Model Quality Verification: While they verified that relaxed visitation guarantees did not affect model quality, this was done on large datasets. For smaller datasets, this might still be a concern.
- Future Work: The authors suggest exploring ML accelerator host designs with potentially "wimpier" resources due to disaggregation, investigating
tf.dataservice as a long-lived, multi-tenant service, and further leveraging global job information for policy development and optimization. They also plan to explore coordinated reads for other ML domains with variable input sizes.
Summary updated