Overview of Distributed RPC Framework
mainThe torch.distributed.rpc package provides tools for building distributed training applications that go beyond the standard DistributedDataParallel (DDP) paradigm. While DDP is designed for replicating models across processes to handle split data, the RPC framework is suitable for more complex scenarios such as:
- Reinforcement Learning: Spawning multiple parallel observers that share a single agent, requiring data exchange between observers and the trainer.
- Large Model Training: Splitting models across multiple machines that cannot fit on a single GPU.
- Parameter Server Architectures: Implementing frameworks where model parameters and trainers reside on different machines.
Key components of the framework include:
RPCandRRef: For sending data between workers and referencing remote data objects.distributed autograd: For executing backward passes in a distributed setting.distributed optimizer: For performing optimizer steps across distributed components.