Distributed training is the backbone of modern Large Language Models (LLMs). However, as models grow, traditional synchronous training methods face severe bottlenecks. Enter EDiT (Efficient Distributed Training), a novel framework that brings the communication-saving benefits of Local SGD to large-scale LLM training by seamlessly integrating it with model sharding.
The Bottlenecks of Synchronous Training
Training LLMs typically relies on synchronous distributed training, where every GPU must finish its computation and share its gradients before the cluster can proceed to the next step. This creates three major hurdles:
- Communication Overhead: Moving massive amounts of data between nodes slows down the overall training process.
- The Straggler Problem: If one GPU is slightly slower due to hardware jitter or network congestion, the entire cluster sits idle waiting for it.
- Rigid Scalability: Dynamically adding or removing GPUs (elastic training) is difficult because changing the number of workers often requires re-tuning sensitive hyperparameters like the learning rate.
While Local SGD—where workers perform several local updates before averaging their parameters—was proposed to solve these issues, it has historically struggled to scale to LLMs. Previous Local SGD methods were incompatible with memory-saving model sharding techniques (like ZeRO-3 or FSDP) and often suffered from "loss spikes" when training on vast, noisy datasets.
How EDiT Solves the Problem
The authors introduce EDiT and its fully asynchronous variant, A-EDiT, built on three core innovations:
1. Sharded Local SGD with Layer-wise Forward Synchronization
Unlike previous methods that required each GPU to hold a full copy of the model, EDiT integrates directly with model sharding. It uses a 2D device mesh to manage "model sync groups" and "model shard groups," allowing it to train models with billions of parameters.
Furthermore, instead of syncing the whole model at the end of a step, EDiT synchronizes parameters layer-by-layer during the forward pass. By using a prefetch strategy, the communication for the next layer happens while the current layer is still calculating, effectively hiding network latency.
2. Pseudo-Gradient Penalty for Stability
Local SGD often fails on LLMs because individual workers can drift into "bad" regions of the loss landscape, causing training instability. To prevent loss spikes, EDiT employs a three-step stability check called the Pseudo-Gradient Penalty:
- Anomaly Elimination: Uses an EMA-based z-test to identify and discard updates from workers that have diverged too far.
- Weighted Averaging: Assigns lower weights to workers with unusually large update norms.
- Gradient Clipping: Constrains the final synchronized update to a reasonable size.
3. A-EDiT for Asynchronous Training
In A-EDiT, workers do not wait for a specific step count to synchronize. Instead, they sync based on a fixed time interval. This allows faster GPUs to complete more local updates without being held back by consistent stragglers, maximizing cluster utilization.
Key Results and Insights
The researchers validated EDiT on massive datasets, including the 1.3-trillion-token FineWeb-Edu and an in-house production dataset, evaluating across standard benchmarks like MMLU, ARC, and HellaSwag.
- High Throughput: On a Llama-7B model, EDiT achieved 211 TFLOPS, significantly outperforming standard synchronous baselines (200 TFLOPS) and matching or beating other state-of-the-art communication-efficient methods.
- Superior Performance: EDiT achieved the lowest training loss and validation perplexity on FineWeb-Edu. On the MMLU benchmark, an EDiT-trained Llama-1B scored 32.29, edging out the baseline's 32.28.
- Robustness to Stragglers: In simulations with artificially delayed nodes, A-EDiT maintained high throughput, whereas the standard baseline's performance plummeted by nearly 50%.
- Elastic-Friendly: Surprisingly, in EDiT, the optimal learning rate remains consistent even as the cluster scales from 1 to 16 workers. This eliminates the need for hyperparameter re-tuning, making EDiT highly suitable for elastic cloud environments.
Limitations and Future Work
While A-EDiT handles stragglers exceptionally well, extremely slow workers can still slightly degrade overall model quality because their "stale" updates become less relevant to the global model. Additionally, while the method supports elastic training, the current implementation still requires a brief "halt and restart" to add nodes. Future work aims to develop a truly seamless framework where nodes can join and leave mid-computation without any interruption.
Code is available at the Atorch Github Repository.
Summary updated