meta-pytorch/torchft
Fault tolerance for PyTorch (HSDP, LocalSGD, DiLoCo, Streaming DiLoCo)
What it solves
Training large-scale AI models often fails when a single GPU or node crashes, typically requiring the entire training job to be restarted from the last saved checkpoint. torchft provides per-step fault tolerance, allowing training to continue without interrupting the entire job when errors occur.
How it works
The library provides primitives for membership changes at the training step granularity. It uses a "lighthouse" server to coordinate across replica groups and determine worker health via per-step heartbeating. It also implements fault-tolerant versions of ProcessGroup and checkpoint transports that enable live recovery from healthy peers during scale-up operations.
Who it’s for
ML engineers and researchers training large models (such as Llama 3 70B) using PyTorch, specifically those utilizing replicated weight strategies like DDP or HSDP.
Highlights
- Fault Tolerant Algorithms: Out-of-the-box support for Fault Tolerant DDP, Fault Tolerant HSDP, LocalSGD, and DiLoCo.
- Lighthouse Coordination: A dedicated server that manages worker health and coordinates replica groups to avoid "stop-the-world" training pauses.
- Live Recovery: Ability to recover state from healthy peers during scale-up operations using specialized checkpoint transports.
- Integration: Designed to be integrated into existing PyTorch training scripts with minimal changes to the training loop.
Related
- Project
- Project
- Project
- Project
- Project