Torch.distributed
torch.distributed is PyTorch’s package for initializing processes and coordinating communication in distributed computation across devices or machines.
Deep Learning with PyTorch, Second Edition
PyTorch’s distributed-training submodule for coordinating computation and communication across processes, devices, or machines.
- How it is used
- Uses distributed processes to train larger models or datasets across multiple GPUs and machines.
- How deep it goes
- Explains terminology and process-group initialization, then demonstrates collective communication and several parallelism strategies in an end-to-end example.
- Examples
- Uses four-process initialization with TCPStore and torchrun, alongside an end-to-end TorchTitan example.
- What you can do after
- Apply it via PyTorch to initialize distributed processes and train models using multiple hardware resources.
Read how Deep Learning with PyTorch, Second Edition explains torch.distributed →
Graph Neural Networks in Action
torch.distributed is the PyTorch package for initializing processes and coordinating communication in distributed computation.
- How it is used
- Coordinates multi-process PyTorch training across GPUs or machines through process initialization, collective communication, and synchronization.
- How deep it goes
- Explains the workflow, synchronization points, launch pattern, and NCCL or Gloo backends without detailing lower-level communication APIs.
- Examples
- Demonstrates MNIST training and points to a GCN using Amazon Products, NeighborLoader, and a dual-GPU environment.
- What you can do after
- Operate/configure distributed training with DDP, NCCL or Gloo, process spawning, device assignment, and synchronization barriers.
Read how Graph Neural Networks in Action explains torch.distributed →
What to know first
- linear layerA linear layer is a neural-network layer that applies a learned affine transformation to its input, typically using weights and a bias.
Related concepts
- DeviceMeshuses · A PyTorch distributed abstraction for arranging devices into a mesh and defining communication along its dimensions.
- distributed trainingused by · Distributed training is the coordinated execution of machine-learning model training across multiple computing devices, processes, or machines.
- model parallelismhas part · Model parallelism is a distributed-computing technique that partitions a machine-learning model’s parameters, layers, or computations across multiple devices.
- MPIalternative to · MPI (Message Passing Interface) is a standard specification for communication among processes in parallel and distributed-memory computing.
Questions about torch.distributed
What is torch.distributed?
torch.distributed is PyTorch’s package for initializing processes and coordinating communication in distributed computation across devices or machines.
Which Manning books explain torch.distributed?
Deep Learning with PyTorch, Second Edition and Graph Neural Networks in Action.
What should I know before learning torch.distributed?
Manning books that teach torch.distributed usually introduce linear layer first.
What is the difference between torch.distributed and MPI?
torch.distributed is PyTorch’s package for initializing processes and coordinating communication in distributed computation across devices or machines. MPI (Message Passing Interface) is a standard specification for communication among processes in parallel and distributed-memory computing.
What are the parts of torch.distributed?
Torch.distributed includes model parallelism.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

