Pathways: Asynchronous Distributed Dataflow for ML

Paul Barham, Aakanksha Chowdhery, Jeff Dean, Sanjay Ghemawat, Steven Hand, Dan Hurt, Michael Isard, Hyeontaek Lim, Ruoming Pang, Sudip Roy, Brennan Saeta, Parker Schuh, Ryan Sepassi, Laurent El Shafey, Chandramohan A. Thekkath, Yonghui Wu · DOI

Abstract

Modern machine learning requires scaling models across thousands of accelerators, yet existing systems often force a trade-off between programming flexibility and execution performance. Pathways is a new large-scale orchestration layer that bridges this gap using an asynchronous distributed dataflow model. By representing computations as sharded dataflow graphs and employing aggressive latency-hiding techniques, Pathways enables researchers to express complex parallelism patterns—such as pipelining and sparse Mixture of Experts (MoE) models—while matching the raw throughput of specialized "Single Program Multiple Data" (SPMD) systems. This paper describes the architecture of Pathways and demonstrates its ability to scale to 136B parameter models across multiple hardware islands with high efficiency.

1. Introduction

The current landscape of deep learning systems is characterized by a "co-evolution" trap: model architectures are frequently constrained by the underlying software and hardware abstractions. Most contemporary systems utilize a multi-controller model (e.g., JAX, PyTorch), where every host machine runs a redundant copy of the user code. While this approach is highly efficient for standard data-parallel tasks, it complicates the implementation of sophisticated coordination patterns, such as model pipelining or dynamic sparse computation.

Conversely, older single-controller systems (e.g., TensorFlow v1) provided a flexible central coordinator but were plagued by high latency. In these systems, the overhead of the central coordinator communicating with remote accelerators often exceeded the duration of the actual computation. Pathways aims to provide the "best of both worlds": the flexibility of a centralized coordinator with the performance of a decentralized multi-controller system.

2. System Architecture

The core innovation of Pathways is the use of a sharded dataflow graph. Rather than managing individual accelerators as isolated entities, Pathways groups them into "islands" and represents computations as high-level nodes within a distributed graph.

2.1 Asynchronous Distributed Dataflow

To overcome the latency issues inherent in centralized control, Pathways utilizes an asynchronous execution model. The control plane (the "brain") can schedule and execute future segments of the computation graph while the data plane (the accelerators) is still processing current tasks. This "running ahead" mechanism effectively hides the communication latency between the coordinator and the hardware.

2.2 Gang-Scheduling and Dispatch

Because many accelerators (specifically TPUs) are single-threaded and prone to deadlocks if tasks are received out of order, Pathways implements a centralized scheduler per island. This ensures that all shards of a parallel computation are enqueued and initiated in a consistent sequence. Furthermore, Pathways supports Parallel Asynchronous Dispatch, allowing multiple stages of a computation pipeline to be dispatched simultaneously rather than sequentially.

2.3 Resource Virtualization

Pathways abstracts physical hardware through a Resource Manager. Users write code for "virtual devices," which the system then maps to physical hardware. This virtualization facilitates multi-tenancy and allows models to scale across multiple islands of accelerators connected via a standard datacenter network (DCN), rather than being limited to a single physical pod.

3. Evaluation and Results

The system was evaluated using Google TPUv3 clusters, scaling up to 2048 cores, across several large-scale benchmarks including T5 (Text-to-Text Transfer Transformer) models and massive decoder-only Transformers ranging from 3B to 136B parameters.

3.1 Performance Parity and Scaling

On standard SPMD tasks, Pathways achieves performance parity with JAX multi-controller systems on up to 2048 TPUs. A key highlight is the system's ability to train a 136B parameter model across two separate islands of 1024 TPU cores each. Despite the communication occurring over a standard DCN rather than a specialized interconnect, the system maintained approximately 97% efficiency.

3.2 Pipelining and Multi-tenancy

Pathways demonstrates minimal coordination overhead when executing Transformer models pipelined across 16 stages. Additionally, the system supports efficient multi-tenancy, allowing accelerators to be time-multiplexed between different users with near 100% utilization and zero context-switch overhead, provided the model weights remain resident in memory.

4. Discussion and Limitations

Pathways proves that a centralized controller is not inherently a bottleneck for large-scale ML, provided that the system uses asynchronous "futures" and amortized bookkeeping. By managing memory and reference counting at the level of model shards rather than individual devices, the system significantly reduces the burden on the coordinator.

However, several limitations remain. The current implementation is heavily optimized for the Google TPU/XLA ecosystem; adapting it to GPUs would require significant changes to kernel fusion and host-device interaction logic. Additionally, the current resource manager relies on simple heuristics for allocation. Future work will focus on dynamic resource allocation for heterogeneous workloads and deeper support for data-dependent control flows in sparse models.

5. Conclusion

Pathways represents a significant step toward a more flexible and scalable infrastructure for artificial intelligence. By combining the ease of a single-controller programming model with the performance of distributed dataflow, it enables the next generation of massive, sparse, and heterogeneously parallel machine learning models.

Summary updated

BibTeX
@inproceedings{barham2022pathways,
  author = {Paul Barham and Aakanksha Chowdhery and Jeff Dean and Sanjay Ghemawat and Steven Hand and Dan Hurt and Michael Isard and Hyeontaek Lim and Ruoming Pang and Sudip Roy and Brennan Saeta and Parker Schuh and Ryan Sepassi and Laurent El Shafey and Chandramohan A. Thekkath and Yonghui Wu},
  title = {{Pathways: Asynchronous Distributed Dataflow for ML}},
  booktitle = {MLSys},
  year = {2022},
}
Figure