Astra: Efficient and Money-saving Automatic Parallel Strategies Search on Heterogeneous GPUs

Peiran Wang, Haibing Li, Fu Haohan, Shiyong Li, Yanpeng Wang, Dou ShenarXiv 2025

Abstract

In this paper, we introduce an efficient and money-saving automatic parallel strategies search framework on heterogeneous GPUs: Astra. First, Astra searches for the efficiency-optimal parallel strategy in both GPU configurations search space (GPU types and GPU numbers) and parallel parameters search space. Then, Astra also provides the solution on heterogeneous GPUs by mathematically modeling the time consumption of heterogeneous training. At last, Astra is the first to propose the automatic parallel strategy search on money-saving. The experiment results demonstrate that Astra can achieve better throughput than expert-designed strategies. The search time cost for Astra can also be limited to 1.27 seconds in a single-GPU setting and less than 1.35 minutes in a heterogeneous-GPU setting on average with an accuracy of over 95%.

Introduction: The Challenge of Hybrid Parallelism

Training modern Large Language Models (LLMs) like Llama-3 or GLM requires distributing the model across hundreds or thousands of GPUs. This necessitates a complex mix of Data Parallelism (DP), Tensor Parallelism (TP), and Pipeline Parallelism (PP). Manually designing these "hybrid parallel" strategies is a "black art" typically reserved for elite engineers.

Existing automation tools suffer from three major gaps: they assume fixed GPU counts, struggle with heterogeneous clusters (mixing different GPU generations like A800s and H100s), and ignore the financial cost of training. Astra addresses these by treating financial cost as a primary optimization target alongside raw throughput and providing robust support for mixed-hardware environments.

The Astra Framework

Astra operates on a Megatron-LM backend and follows a multi-stage pipeline designed to prune massive search spaces efficiently. The framework architecture is divided into four main modules: Input Preprocessing, Parallel Strategy Search, Cost Simulation, and Money Calculation.

The Astra framework architecture, detailing the multi-stage process from input preprocessing to cost and money calculation.

Methods and Search Space Pruning

  1. Input Preprocessing: Astra extracts model architecture details and defines a search space of parallel parameters, including micro-batch size, recomputation settings, and parallelism sizes.
  2. Pruning via Filters: To handle the massive search space, Astra uses rule-based filters to remove illegal configurations and memory-based filters to discard strategies that would cause Out-of-Memory (OOM) errors.
  3. XGBoost Cost Model: Instead of relying on static hardware benchmarks, Astra uses a trained XGBoost model to predict the efficiency of computation and communication operators. This allows it to adapt to new operators and hardware without exhaustive re-testing.
  4. Money-Limit Search: Astra identifies a "Pareto-optimal" pool of strategies, allowing users to select the best throughput that fits within a specific hourly budget.

Modeling Heterogeneity

In a mixed-GPU setup, traditional formulas for pipeline training break because stages finish at different times based on the underlying hardware's compute power. Astra introduces a mathematical model to calculate "pipeline bubbles" and latency specifically for these scenarios.

Pipeline parallelism timeline illustrating the forward and backward passes across heterogeneous stages where compute times vary.

By re-modeling the forward and backward passes for mixed hardware, Astra can balance workloads across different GPU types, such as H100 and A800 GPUs, achieving throughput that nearly matches theoretical maximums for mixed clusters.

Key Results and Evaluation

The framework was evaluated using state-of-the-art LLM architectures (Llama-2, Llama-3, and GLM) on clusters of Nvidia A800, H100, and H800 GPUs. Astra was compared against "Expert Plans" crafted by human experts with over six years of industry experience.

  • Performance: In almost all scenarios, Astra’s automatically discovered strategies matched or outperformed those designed by human experts.
  • Accuracy: The performance simulator achieved over 95% accuracy in predicting actual training throughput.
  • Efficiency: Astra can search through tens of thousands of potential strategies in under 1.35 minutes for a heterogeneous cluster and just 1.27 seconds for a single-GPU type setup. The simulation phase is roughly 98.7% faster than existing industry competitors.

Conclusion and Future Work

Astra represents a significant step forward for "frugal" AI training by automating the search for cost-effective, high-throughput strategies in complex hardware environments. While the search is nearly instantaneous, future work will focus on further optimizing the simulation phase for extremely large models. Additionally, the authors plan to extend Astra beyond the Megatron-LM framework to other popular backends like DeepSpeed or PyTorch FSDP and explore dynamic scaling for spot-instance pricing changes.

Summary updated

BibTeX
@misc{wang2025astra,
  author = {Peiran Wang and Haibing Li and Fu Haohan and Shiyong Li and Yanpeng Wang and Dou Shen},
  title = {{Astra: Efficient and Money-saving Automatic Parallel Strategies Search on Heterogeneous GPUs}},
  year = {2025},
  eprint = {2502.13480},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.13480},
}
Figure