Abstract
Researchers at Oak Ridge National Laboratory (ORNL) have demonstrated the feasibility of scaling Large Language Model (LLM) training to 1 trillion parameters on the Frontier supercomputer. By adapting the Megatron-DeepSpeed framework for the AMD/ROCm ecosystem and utilizing Bayesian optimization to tune 3D parallelism strategies, the team achieved near-perfect weak scaling and significant hardware utilization across thousands of GPUs.
Introduction
As Large Language Models (LLMs) approach the trillion-parameter threshold, they encounter a significant "memory wall." A 1-trillion (1T) parameter model requires approximately 20 Terabytes of memory to store weights, gradients, and optimizer states—far exceeding the 64GB HBM capacity of individual AMD MI250X GPUs. While distributed training frameworks like Megatron-DeepSpeed address these needs, they are traditionally optimized for NVIDIA’s CUDA ecosystem. This work details the porting and optimization of these massive workloads for the Frontier supercomputer, the world's first exascale system, which utilizes AMD hardware and the ROCm software stack.
Methodology
The study employs a 3D Parallelism strategy to manage the massive memory and computational requirements:
- Tensor Parallelism (TP): Splitting individual layers (tensors) across multiple GPUs within a node.
- Pipeline Parallelism (PP): Distributing different layers of the model across different GPUs in a pipeline.
- Sharded Data Parallelism (ZeRO-1): Partitioning optimizer states across GPUs to reduce memory redundancy.
Technical implementation involved using hipify to convert CUDA code to HIP and integrating ROCm-optimized libraries such as FlashAttention-2 and the Composable Kernel library. To find the optimal configuration, the researchers used DeepHyper, an asynchronous Bayesian optimization tool, to search the hyperparameter space for TP size, PP size, micro-batch size (MBS), and gradient accumulation steps.
The hardware architecture of Frontier, shown in Figure 5, features high-bandwidth Infinity Fabric connections within nodes (connecting up to 8 GPUs), which is critical for the efficiency of communication-intensive strategies like Tensor Parallelism.
Key Insights and Results
The experiments, conducted using GPT-style models ranging from 22B to 1T parameters, yielded several critical insights regarding performance on AMD hardware.
The TP Bottleneck
Tensor Parallelism is highly efficient within a single node (up to 8 GPUs) due to the high-bandwidth Infinity Fabric. However, performance degrades significantly when TP spans across nodes because of the high-frequency communication required after every layer.
As illustrated in Figure 6, throughput (measured in TFLOPS) decreases as the TP size increases, with a notable drop when moving from intra-node (TP=8) to inter-node (TP=16) configurations.
Scaling and Efficiency
The team achieved impressive hardware utilization on Frontier:
- Throughput: 31.96% of peak theoretical TFLOPS for the 1T model (61.2 TFLOPS per GPU).
- Weak Scaling: 100% efficiency when scaling the 1T model up to 3072 GPUs.
- Strong Scaling: 87% efficiency for the 1T model, demonstrating the system's ability to handle increased communication overhead.
Sensitivity analysis via SHAP values identified Micro-Batch Size (MBS) as the most influential factor for throughput. Larger micro-batches maximize GPU compute unit utilization but are limited by memory constraints.
Conclusion
This research confirms that AMD-based supercomputers like Frontier are fully capable of world-class LLM training, rivaling traditional CUDA-based clusters. Future efforts will focus on the relationship between throughput-optimized parallelization "recipes" and model convergence, specifically investigating loss divergence issues associated with the very large global batch sizes required at this scale.
Summary updated