NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Efficient Scaling of LLM Training with Flexible Context Parallelism

Yifan Niu, Han Xiao, Dongyi Liu, Wei zhou, Jia Li

NeurIPS page · Open on the map

Category: Efficient LLM Inference & Training › Fault-Tolerant LLM Training · Type: new method · Keywords: flexible context parallelism, LLM training scaling, load balancing, communication optimization, heterogeneous sequence lengths

Areas: Long Context › Long-context mechanisms › Efficient long-context attention

Summary

Flexible Context Parallelism (FCP) is an adaptive parallelism strategy that reconfigures communication groups and context parallelism degrees during LLM training to efficiently handle heterogeneous sequence lengths, achieving up to 1.47× speedup.

Explained to a 5-year-old

When teaching a big computer brain lots of text, the text sometimes has short sentences and sometimes long ones. The old way of sharing work among many computers always used the same plan, which made some computers wait a lot. The new idea lets the computers change how they share work every time they get a new batch of text, so the waiting goes away. This helps the computers use almost all of their power, making the training finish much faster. As a result, training these models needs less time and less energy, which is good for everyone.

Explained to a 5-year-old, longer

When we teach a big computer brain (a large language model) how to understand words, we feed it lots of sentences. Some sentences are short, like "Hi", and some are long, like a whole paragraph. The computers that help train the brain usually split the work into equal parts, but that doesn't match the uneven lengths. This mismatch makes some computers finish early while others keep working, which is wasteful. The researchers came up with a new way to let the computers change how they split the work for each batch of sentences. They can decide how many computers to use for each batch, even numbers that are not powers of two, like 3 or 5. A special algorithm quickly figures out the best way to split the work in just a few thousandths of a second. This dynamic splitting keeps the computers busy all the time, using almost all of their power. Because the work matches the length of the sentences, there is less waiting and less idle time. The result is that the whole training process runs faster, sometimes more than one and a half times quicker. For batches that are extremely uneven, the speed improvement can be even larger, up to more than two times faster. All of this means that training big language models becomes cheaper, faster, and uses less energy, which is great for the planet.

For a technical reader

The paper addresses the inefficiency of static parallelism strategies when training large language models on mixed-length sequences, which leads to load imbalance and communication overhead. It introduces a dynamic context parallelism scheme that re-configures communication groups and degree of parallelism per training batch, supporting flexible (non-power-of-two) degrees. A polynomial-time algorithm computes near-optimal parallelism configurations with millisecond latency, allowing the system to adapt instantly to each batch’s heterogeneity. Experiments show speedups of up to 1.47× on average and 2.24× on highly unbalanced batches, outperforming Megatron-LM and DeepSpeed while preserving near-linear scaling. The approach can be integrated into existing training frameworks to improve hardware utilization and reduce training time for both text-only and multimodal language models.

Problem

Training large language models on heterogeneous sequence lengths suffers from load imbalance, redundant communication, and poor hardware utilization due to static parallelism strategies. Existing libraries cannot adapt parallelism degrees dynamically, leading to suboptimal scaling efficiency.

Method

The approach adaptively reconfigures communication groups and context parallelism degrees per batch, supports non-power-of-two degrees, and uses a polynomial-time algorithm to generate near-optimal strategies with millisecond overhead. It dynamically balances load across heterogeneous batches, reducing idle time and communication redundancy.

Results

The approach achieves up to 1.47× average throughput speedup over Megatron-LM and DeepSpeed, with near-linear scaling efficiency across large clusters, and reaches 2.24× speedup for extremely unbalanced batches.

Contributions

A dynamic, polynomial-time algorithm for generating flexible parallelism strategies and a framework that adapts communication groups on the fly to handle heterogeneous sequence lengths. The contributions enable high hardware efficiency and substantial speedups for both LLM and multimodal LLM training.

Practical relevance

The method enables practitioners to train large language models more efficiently on heterogeneous data, reducing hardware costs and improving scalability for real-world deployments.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction