Abstract
Training Large Language Models (LLMs) is constrained by the massive memory footprint of model states and activations. ProTrain is an automated training system that optimizes memory management through intelligent orchestration of model state offloading, activation recomputation, and computation-IO overlapping. By employing a fine-grained chunk-based management system and an interleaved activation strategy, ProTrain achieves up to a 2.71× throughput improvement over state-of-the-art frameworks like DeepSpeed and Colossal-AI. Our evaluation shows that ProTrain significantly increases the maximum trainable model size on both consumer and enterprise hardware without requiring manual configuration.
Introduction
The "memory-hungry" nature of LLMs presents a significant barrier to research and development. A single model parameter can require up to 16× its size in memory during training to accommodate gradients and optimizer states. While techniques such as offloading to CPU RAM and gradient checkpointing (recomputation) exist, current implementations in frameworks like DeepSpeed (ZeRO-Offload) and FSDP are often limited by coarse granularity. These systems typically offer "all-or-nothing" choices—offloading entire model components or checkpointing every block—which fails to fully utilize available hardware resources. Furthermore, these frameworks require extensive manual tuning by experts to achieve peak performance.
Methodology
ProTrain introduces an adaptive memory management system that treats memory, computation, and IO as a coordinated process.
Chunk-Based Model State Management
Instead of treating the model as a monolithic entity, ProTrain organizes parameters into uniformly sized "chunks." It utilizes a dual-chunk system: persistent chunks remain on the GPU for maximum performance, while non-persistent chunks are offloaded to the CPU and fetched only when required. Crucially, these chunks are organized based on their runtime execution order rather than initialization order, minimizing unnecessary data movement.
Interleaved Activation Management
ProTrain manages activations at the transformer block level using an interleaved strategy. It alternates between swapping activations to the CPU and using gradient checkpointing. This allows the system to perform recomputation while simultaneously handling the IO latency of data swapping.
Memory-Aware Runtime Profiler
The "brain" of ProTrain is its runtime profiler. It uses hooks to monitor memory fluctuations and execution times during a trial run. For models that exceed GPU memory even during profiling, ProTrain employs a "drop-and-regenerate" method. The profiler's data is then used to automatically calculate the optimal mix of persistent chunks and swapping/checkpointing blocks to minimize total training time.
Evaluation
We evaluated ProTrain across several popular LLM architectures, including GPT-2 (10B to 40B), OPT (13B and 30B), Mistral (7B), and LLaMA (13B and 34B). Performance was measured on two distinct hardware configurations:
- A node with four NVIDIA RTX 3090 GPUs (24GB VRAM).
- A node with four NVIDIA A100 GPUs (80GB VRAM).
Results
ProTrain consistently outperformed baseline frameworks in both throughput and the ability to scale to larger models.
Throughput Gains
As illustrated in the performance metrics, ProTrain achieved throughput improvements ranging from 1.43× to 2.71× compared to DeepSpeed, Colossal-AI, and FSDP.
Model Scaling
On consumer-grade RTX 3090 hardware, ProTrain successfully trained models 2× larger than DeepSpeed and 1.2× larger than Colossal-AI, enabling a 30B parameter model on a single 24GB card. On enterprise A100 GPUs, it supported models up to 70B parameters on a single GPU, representing a 7× increase over FSDP's capacity.
Discussion and Conclusion
The success of ProTrain lies in its ability to leverage the CPU as a concurrent resource. By performing parameter updates on the CPU while the GPU handles backward pass computations, ProTrain effectively hides update overhead. The interleaving of IO-bound swapping and compute-bound recomputation ensures that neither the PCIe bus nor the GPU cores remain idle.
While ProTrain currently excels in small cluster environments, future work will address GPU-to-GPU communication bottlenecks in massive data centers. Additionally, integrating ProTrain with Tensor Parallelism (TP) and Pipeline Parallelism (PP) will be essential for supporting trillion-scale models. In conclusion, ProTrain demonstrates that automated, system-level profiling and fine-grained resource management can push hardware closer to its theoretical limits than manual tuning.
Summary updated