[Paper Review] tf.data: A Machine Learning Data Processing Framework
tf.data is a machine learning data processing framework that enables efficient, scalable input pipeline construction through declarative, composable operators and automatic performance tuning. It achieves up to 10.4× faster training convergence in ResNet50 on ImageNet by applying parallelism, pipelining, caching, and static optimizations, matching expert-tuned pipelines without manual tuning.
Training machine learning models requires feeding input data for models to ingest. Input pipelines for machine learning jobs are often challenging to implement efficiently as they require reading large volumes of data, applying complex transformations, and transferring data to hardware accelerators while overlapping computation and communication to achieve optimal performance. We present tf.data, a framework for building and executing efficient input pipelines for machine learning jobs. The tf.data API provides operators which can be parameterized with user-defined computation, composed, and reused across different machine learning domains. These abstractions allow users to focus on the application logic of data processing, while tf.data's runtime ensures that pipelines run efficiently. We demonstrate that input pipeline performance is critical to the end-to-end training time of state-of-the-art machine learning models. tf.data delivers the high performance required, while avoiding the need for manual tuning of performance knobs. We show that tf.data features, such as parallelism, caching, static optimizations, and non-deterministic execution are essential for high performance. Finally, we characterize machine learning input pipelines for millions of jobs that ran in Google's fleet, showing that input data processing is highly diverse and consumes a significant fraction of job resources. Our analysis motivates future research directions, such as sharing computation across jobs and pushing data projection to the storage layer.
Motivation & Objective
- Address the performance bottleneck caused by inefficient data input pipelines in machine learning workloads.
- Reduce the manual tuning burden of performance-critical parameters like parallelism and prefetch buffer size.
- Enable high-performance data processing across diverse ML workloads, including vision, NLP, and reinforcement learning.
- Characterize real-world data pipeline behavior at scale to inform future optimization directions.
- Provide a reusable, composable API that integrates seamlessly with existing ML frameworks like TensorFlow and PyTorch.
Proposed method
- Exposes a declarative API with stateless datasets and stateful iterators for defining data processing pipelines.
- Represents pipelines as dataflow graphs and applies static optimizations via graph rewrites to improve efficiency.
- Automatically tunes internal parameters such as parallelism degree and prefetch buffer size using performance prediction.
- Supports key optimizations including software pipelining, caching, and operator fusion to overlap computation and data loading.
- Integrates with hardware accelerators (e.g., GPUs, TPUs) by offloading data preprocessing to CPUs and overlapping I/O with computation.
- Uses lightweight instrumentation to monitor processing time and memory usage, enabling dynamic scaling decisions.
Experimental results
Research questions
- RQ1How does input pipeline performance impact end-to-end training time in modern ML workloads?
- RQ2To what extent can automatic tuning of pipeline parameters (e.g., parallelism, prefetch size) match expert-optimized configurations?
- RQ3What are the dominant performance bottlenecks in real-world ML data pipelines across diverse workloads and data modalities?
- RQ4How can data processing workloads be optimized at scale while minimizing redundant computation and resource usage?
- RQ5What system-level abstractions and optimizations are most effective for achieving high throughput and low latency in ML data pipelines?
Key findings
- Input pipelines consume up to 65% of training time in public benchmarks, with 30% of total compute time across Google’s fleet spent on data ingestion.
- tf.data reduces ResNet50 training time to convergence by 10.4× through parallelism and software pipelining alone.
- Additional optimizations like caching and static graph rewrites yield a further 2× improvement in training speed.
- tf.data’s auto-tuning achieves performance comparable to expert-tuned pipelines without requiring manual configuration.
- Millions of real ML jobs exhibit high diversity in data processing patterns, with significant redundant computation across similar pipelines.
- The analysis motivates future research in cross-job computation sharing and pushing data projection to storage layers to reduce pre-processing overhead.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.