nnScaler: Constraint-Guided Parallelization Plan Generation for Deep Learning Training
Zhiqi Lin, Youshan Miao, Quanlu Zhang, Fan Yang, Yi Zhu, Cheng Li, Saeed Maleki, Xu Cao, Ning Shang, Yilei Yang, Weijiang Xu, Mao Yang
Abstract
With the growing model size of deep neural networks (DNN), deep learning training is increasingly relying on handcrafted search spaces to find efficient parallelization execution plans. However, our study shows that existing search spaces exclude plans that significantly impact the training performance of well-known DNN models (e.g., AlphaFold2) under important settings, such as when handling large embedding tables in large language models.
To address this problem, we propose nnScaler, a framework that generates efficient parallelization plans for deep learning training. Instead of relying on the existing search space, nnScaler advocates a more general approach that empowers domain experts to construct their own search space through three primitives, op-trans, op-assign, and op-order, which capture model transformation and the temporal-spatial scheduling of the transformed model of any parallelization plans. To avoid space explosion, nnScaler allows the application of constraints to those primitives during space construction. With the proposed primitives and constraints, nnScaler can compose existing search spaces as well as new ones. Experiments show that nnScaler can find new parallelization plans in new search spaces that achieve up to 3.5× speedup compared to solutions such as DeepSpeed, Megatron-LM, and Alpa for popular DNN models like Swin-Transformer and AlphaFold2.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
8 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- It Takes Two to Entangle cites ZeRO: memory optimizations toward training trillion parameter models
- It Takes Two to Entangle cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Language Models are Few-Shot Learners
- LoRAFusion: Efficient LoRA Fine-Tuning for LLMs cites ZeRO: memory optimizations toward training trillion parameter models
- LoRAFusion: Efficient LoRA Fine-Tuning for LLMs cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- LoRAFusion: Efficient LoRA Fine-Tuning for LLMs cites Language Models are Few-Shot Learners
- LoRAFusion: Efficient LoRA Fine-Tuning for LLMs cites Mist: Efficient Distributed Training of Large Language Models via Memory-Parallelism Co-Optimization
- Mist: Efficient Distributed Training of Large Language Models via Memory-Parallelism Co-Optimization cites ZeRO: memory optimizations toward training trillion parameter models
- Mist: Efficient Distributed Training of Large Language Models via Memory-Parallelism Co-Optimization cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Mist: Efficient Distributed Training of Large Language Models via Memory-Parallelism Co-Optimization cites Language Models are Few-Shot Learners
- Swin Transformer V2: Scaling Up Capacity and Resolution cites ZeRO: memory optimizations toward training trillion parameter models
- Swin Transformer V2: Scaling Up Capacity and Resolution cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Swin Transformer V2: Scaling Up Capacity and Resolution cites Language Models are Few-Shot Learners
Cited by top-tier papers8
- Mist: Efficient Distributed Training of Large Language Models via Memory-Parallelism Co-OptimizationZhanda Zhu, Christina Giannoula, Muralidhar Andoorveedu, Qidong Su et al.EuroSys 2025 · 8 citations
- LoRAFusion: Efficient LoRA Fine-Tuning for LLMsZhanda Zhu, Qidong Su, Yaoyao Ding, Kevin Song et al.EuroSys 2026 · 2 citations
- Sailor: Automating Distributed Training over Dynamic, Heterogeneous, and Geo-distributed ClustersFoteini Strati, Zhendong Zhang, George Manos, Ixeia Sánchez Périz et al.SOSP 2025 · 2 citations
- DIP: Efficient Large Multimodal Model Training with Dynamic Interleaved PipelineZhenliang Xue, Hanpeng Hu, Xing Chen, Yimin Jiang et al.ASPLOS 2026 · 1 citation
- It Takes Two to EntangleZhanghan Wang, Ding Ding, Hang Zhu, Haibin Lin et al.ASPLOS 2026
Builds on23
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
- Swin Transformer V2: Scaling Up Capacity and ResolutionZe Liu, Han Hu, Yutong Lin, Zhuliang Yao et al.CVPR 2022 · 2,138 citations
- ZeRO: memory optimizations toward training trillion parameter modelsSamyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong HeSC 2020 · 852 citations
Related papers
- Alpa: Automating Inter- and Intra-Operator Parallelism for Distributed Deep LearningLianmin Zheng, Zhuohan Li, Hao Zhang, Yonghao Zhuang et al.OSDI 2022 · 75 citations
- AMP: Automatically Finding Model Parallel Strategies with Heterogeneity AwarenessDacheng Li, Hongyi Wang, Eric P. Xing, Hao ZhangNeurIPS 2022 · 57 citations
- Aceso: Efficient Parallel DNN Training through Iterative Bottleneck AlleviationGuodong Liu, Youshan Miao, Zhiqi Lin, Xiaoxiang Shi et al.EuroSys 2024 · 16 citations
- Hypertron: Efficiently Scaling Large Models by Exploring High-Dimensional Parallelization SpaceShigang Li, Jingkun Dong, Jihao Chen, Zhi Ma et al.SC 2025 · 2 citations
- H3T: Efficient Integration of Memory Optimization and Parallelism for Large-scale Transformer TrainingYuzhong Wang, Xu Han, Weilin Zhao, Guoyang Zeng et al.NeurIPS 2023 · 2 citations
