NSP: Accelerating Variable-Length LLM Training via Nested Sequence Parallelism
Yi'ou Wang, Xiaoyang Li, Yijie Zheng, Shouda Liu, Yuxuan Wang
Abstract
Long-context LLM training on long-tailed corpora faces a central communication--balance tradeoff. Such sequence-length heterogeneity makes any single sequence-parallelism (SP) degree a poor fit for the workload: a small degree leaves the few long sequences badly imbalanced, while a large degree forces the many short sequences that dominate the workload to pay excessive communication. Existing dynamic-SP systems mix SP degrees within a batch, but to run several groups at once they partition the GPUs into disjoint groups, which reintroduces imbalance across groups and forces costly micro-batch workarounds. We present NSP, a sequence-parallel training system that resolves this tradeoff by nesting differently sized SP groups on shared GPUs within a single training iteration. This lets long sequences use larger SP groups while keeping short sequences on smaller ones, so communication is incurred only where needed and load is balanced per GPU rather than per group. NSP realizes this idea with a tree-structured routing planner that assigns sequences under memory constraints and an executor that exploits the resulting hierarchy through inter-level phase streaming and tree-level recomputation. NSP supports common SP backends and requires no model changes. We evaluate NSP on Qwen3-MoE workloads with up to 384K-token contexts across multiple long-tail datasets on an internal production GPU cluster. Across these settings, NSP consistently improves end-to-end training throughput, outperforming Static SP by up to 1.48x and FlexSP by up to 1.16x.
Create a lesson
Metadata
- Comments
- 19 pages, 10 figures, 1 table
Related papers
ASHE: Asynchronous Stage-owned Heterogeneous Elastic-averaging for Pipeline-Parallel Training
Shared title terminologycs.DCHamin Jung, Sookwang Lee, Shinyoung Ahn et al.
Generalized Tensor Parallelism: Powering Trillion-Parameter LLM Training at 10+ EFLOP/s
Shared title terminologycs.DCShiqing Fan, Deepak Narayanan, Jimmy Zhang et al.
LIBRA: Runtime Co-Tuning of Batch Size and Parallelism for Time-Efficient LLM Training
Shared title terminologycs.DCShengkai Lyu, Hairui Zhao, Daran Sun et al.
Reshaping Rollout Workloads for Asynchronous RL Post-Training on Heterogeneous Accelerators
Shared title terminologycs.DCJiahui Li, Hao Nie, Yibo Zhu et al.
ParaAnya: Accelerating Parallel Diffusion Sampling with Plug-and-Play Output Caching
Shared title terminologycs.DCChee-En Yu, Xiao-Xi Tan, Yi-Cheng Lin et al.
TopoEP: Topology-Aware Load Balancing for Expert-Parallel MoE Training
Shared title terminologycs.DCJiacheng Zhu, Xie Zhao, Gongming Zhao et al.