TL;DR
When training massive AI models, maximizing raw hardware speed (throughput) and maximizing learning per token (convergence) pull in opposite directions—and tuning either one in isolation leaves massive amounts of time on the table. LIBRA is a lightweight runtime system that dynamically co-tunes both batch size and GPU parallelism during training, treating speed and learning efficiency as dual objectives. By smartly pruning millions of bad configurations and testing promising ones concurrently on the fly, LIBRA slashes total training time by over 31% while adding almost zero overhead.
What Problem Does This Paper Address?
Imagine driving cross-country. Going 100 mph down random side roads gets you great "miles per hour" (throughput), while walking in a straight line over mountains minimizes distance (token efficiency). Neither gets you to the finish line fastest.
Training Large Language Models (LLMs) across hundreds of GPUs suffers from this exact disconnect. Engineers must choose two things: parallelism (how to slice the model and data across GPUs) and global batch size (how much data the model sees before updating its weights).
Historically, systems tune these separately: systems engineers auto-tune parallelism to maximize tokens-per-second, while ML researchers hand-craft batch-size "ramp-up" schedules to optimize learning convergence. The catch? They are deeply coupled. A small batch size starves GPUs of work and creates pipeline bubbles; a massive batch size keeps GPUs humming at peak utilization, but hits a statistical wall—known as the Critical Batch Size (CBS)—where extra data stops improving the gradient update. Furthermore, the "sweet spot" shifts continuously as the model learns. Finding the optimal joint configuration online is brutal: the search space spans ~1.5 to 2.4 million combinations, and testing candidates live on GPU clusters is wildly expensive.
Methods
Instead of relying on static schedules or collapsing speed and learning into a single rigid formula, LIBRA treats token throughput and convergence progress per token as two separate, noisy objectives. Built as an external control plane on top of standard frameworks like Megatron-LM, LIBRA weaves together three techniques:
- Multi-Objective Bayesian Co-Tuning: LIBRA uses a standard Bayesian acquisition method called qNEHVI (parallel noisy expected hypervolume improvement) in a novel runtime context. It models uncertainty in both hardware speed and short-horizon validation loss drops, proposing candidate configurations expected to push the Pareto frontier forward. A conservative controller only switches the live training run to a new configuration when it is 95% confident it will reach the next loss milestone faster.
- Hierarchical Pruning: You can’t run Bayesian optimization over millions of choices. LIBRA narrows the field in two stages:
- Level 1 (Offline System Estimation): It profiles a tiny fraction (0.4%–0.6%) of intra-batch setups and analytically extrapolates memory and communication costs, tossing out out-of-memory and slow parallel layouts.
- Level 2 (Online CBS-Aware Monitoring): Starting from a shared checkpoint, it monitors how neighboring batch sizes reduce loss over short token windows, pruning batch sizes whose learning efficiency plateaus without offering meaningful speedups.
- Acquisition-Guided Parallel Evaluation (AGPE): Rather than testing candidates one by one, AGPE acts like a smart Tetris player for GPUs. It ranks candidates by their expected information gain per GPU-hour, packs them into disjoint GPU groups to minimize idle "bubbles," and feeds results back asynchronously—stopping weak branches early.
Datasets
All models (GPT-3 6.7B, LLaMA-2 7B/13B/70B, and Code LLaMA 34B) were trained and evaluated from scratch on OpenWebText, using sequence lengths of 1,024 (for GPT-3) and 4,096 (for the LLaMA variants). No new benchmarks were introduced; rather, fixed target validation losses on OpenWebText served as the finish lines to measure true wall-clock time-to-convergence.
Key Insights and Ideas
- Lower MFU can mean faster training: The industry obsesses over Model FLOPs Utilization (MFU) and tokens/sec. Yet on LLaMA-2 13B, LIBRA finished in 81.37 hours despite running at a lower average throughput (96.5K tok/s) than a parallel-tuned ramp-up baseline (100.5K tok/s, 94.02 hours)—because smart co-tuning required nearly 6 billion fewer tokens to reach the exact same validation loss.
- Premature scalarization blinds the optimizer: Existing cluster schedulers multiply speed and statistical efficiency into a single "goodput" score. In LIBRA's ablations, keeping the two objectives separate via qNEHVI beat goodput by 8%–10% in end-to-end time, because it accounts for measurement noise instead of locking in a fixed trade-off upfront.
- Early stages matter most: Breaking down training by stages revealed LIBRA’s biggest speedups (up to 35.2% faster) happen early and mid-training, before the model enters the final large-batch regime where almost any big batch saturates the cluster.
Key Results
Evaluated on clusters of 8 to 256 GPUs across models up to 70B parameters:
- End-to-End Speedup: LIBRA reduced time-to-convergence by 31.1% on average compared to state-of-the-art parallel auto-tuners (Alpa and Aceso), and consistently beat stitched-together baselines (like Critical Batch Size warmup paired with Aceso) by 13.4%–18.6%.
- Massive Search Reduction: Hierarchical pruning shrank a raw space of 1.52M–2.44M configurations down to just 6–8 online candidates, cutting evaluation GPU-hours by 72.6%–74.8% compared to sequential testing.
- Negligible Overhead: Critical-path runtime tuning overhead accounted for just 0.32% to 3.50% of total training time—and actually shrank as model and GPU scales grew (dropping to 0.32% on LLaMA-2 70B at 256 GPUs).
Limitations and Future Work
LIBRA is currently prototyped exclusively as a control layer above Megatron-LM; porting it to other distributed training engines is needed to test how smoothly its abstractions generalize. Additionally, experiments topped out at 256 GPUs on dense transformer models. Scaling to thousands of GPUs and testing sparse architectures like Mixture-of-Experts (MoE)—where dynamic expert routing introduces wild new communication bottlenecks—remain open frontiers.
Summary updated