TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems

Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Gregory S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian J. Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Józefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Gordon Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul A. Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda B. Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, Xiaoqiang ZhengarXiv 2016

Introduction

TensorFlow is a second-generation machine learning system developed by Google to represent computations as stateful dataflow graphs. Its primary innovation is a unified programming model that enables the same code to execute across a wide range of heterogeneous hardware—from mobile devices to large-scale distributed clusters of GPUs. This flexibility effectively bridges the gap between experimental research and high-performance production deployment.

Problem Statement

Prior to TensorFlow, Google utilized DistBelief, a first-generation system that demonstrated the feasibility of large-scale deep learning. However, DistBelief suffered from several limitations: it was difficult to configure, lacked the flexibility required for non-neural network algorithms, and created a "leaky abstraction" between research and production environments. Researchers often had to maintain two separate versions of a model: one for rapid experimentation and another highly optimized version for production. TensorFlow was designed to solve these issues by providing a flexible, robust system capable of handling diverse hardware (CPUs, GPUs, and mobile chips) within a single framework.

System Architecture

TensorFlow represents computations as directed graphs where nodes represent operations (ops) and edges represent Tensors (multi-dimensional data arrays).

Stateful Dataflow and Heterogeneous Execution

Unlike traditional dataflow systems, TensorFlow incorporates Variables—stateful nodes that persist across multiple graph executions, which is critical for maintaining model weights. A central Master process maps graph nodes onto available Devices using a greedy placement algorithm. When a graph spans multiple devices, the system automatically inserts Send and Receive nodes to manage cross-device communication via protocols like TCP or RDMA.

Distributed execution across devices using Send and Receive nodes.

Automatic Differentiation

A core feature of TensorFlow is its built-in support for automatic differentiation. Users define the "forward" pass of their model, and the system automatically constructs the corresponding "backward" pass graph required for training via backpropagation.

Automatic generation of the backward gradient graph from the forward pass.

Key Insights

  • Unified Model: A single system covers the entire model lifecycle, allowing models trained on GPU clusters to be deployed directly to mobile platforms.
  • Control Flow as Operations: By embedding loops (While) and conditionals (If) as nodes within the graph, TensorFlow minimizes communication overhead between the client and the execution engine.
  • Deferred Execution: Separating graph definition from execution (via a Session) allows for global optimizations such as common subexpression elimination and efficient memory management.
  • Visualization: The introduction of TensorBoard acknowledges that debugging complex, high-dimensional models requires specialized visualization tools for graph structures and training metrics.

Evaluation and Results

TensorFlow has demonstrated significant performance gains and wide-scale adoption:

  • Performance: The Inception image recognition model saw a 6-fold speed improvement in training time compared to DistBelief.
  • Scalability: The system successfully handles models with hundreds of billions of parameters across distributed clusters.
  • Adoption: Over 50 teams at Google, including those for Search, Photos, and YouTube, transitioned to TensorFlow for production workloads.

Conclusion and Future Work

While TensorFlow represents a major leap forward, several areas for improvement remain. GPU memory management continues to be a challenge, with ongoing research into better heuristics for tensor recomputation versus storage. Future iterations may also employ machine learning techniques, such as reinforcement learning, for automated graph placement. Additionally, the integration of Just-In-Time (JIT) compilation offers the potential to further reduce overhead by fusing multiple operations into optimized kernels.

Summary updated

BibTeX
@misc{abadi2016tensorflow,
  author = {Martín Abadi and Ashish Agarwal and Paul Barham and Eugene Brevdo and Zhifeng Chen and Craig Citro and Gregory S. Corrado and Andy Davis and Jeffrey Dean and Matthieu Devin and Sanjay Ghemawat and Ian J. Goodfellow and Andrew Harp and Geoffrey Irving and Michael Isard and Yangqing Jia and Rafal Józefowicz and Lukasz Kaiser and Manjunath Kudlur and Josh Levenberg and Dan Mané and Rajat Monga and Sherry Moore and Derek Gordon Murray and Chris Olah and Mike Schuster and Jonathon Shlens and Benoit Steiner and Ilya Sutskever and Kunal Talwar and Paul A. Tucker and Vincent Vanhoucke and Vijay Vasudevan and Fernanda B. Viégas and Oriol Vinyals and Pete Warden and Martin Wattenberg and Martin Wicke and Yuan Yu and Xiaoqiang Zheng},
  title = {{TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems}},
  year = {2016},
  eprint = {1603.04467},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1603.04467},
}
Figure