NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DSP: Dynamic Sequence Parallelism for Multi-Dimensional Transformers

Xuanlei Zhao, Shenggan Cheng, Chang Chen, Zangwei Zheng, Ziming Liu, Zheming Yang, Yang You

TL;DR

Dynamic Sequence Parallelism (DSP) is a new approach to scaling multi-dimensional Transformers (like those used in video generation or protein folding) by dynamically switching which sequence dimension is sharded across GPUs during different computation stages. By aligning the parallel axis with the computation axis, DSP reduces communication overhead by up to 75% and delivers throughput improvements ranging from 32.2% to a staggering 10x over state-of-the-art methods.

What Problem Does This Paper Address?

As we move beyond text into high-resolution video generation and complex biological modeling, Transformers are handling increasingly massive multi-dimensional sequences. These models often process data along different axes—for example, a video model might have a "Temporal Attention" block followed by a "Spatial Attention" block.

Existing "embedded" sequence parallelism (SP) methods, such as Megatron-SP or DeepSpeed-Ulysses, are rigid. They typically shard data along a single, fixed sequence dimension. When a model needs to calculate across a different dimension than the one currently sharded, these methods incur massive communication costs (like gathering the entire sequence) or require complex, manual code modifications to the attention modules. This creates a "communication bottleneck" that limits how long these sequences can actually be.

Embedded vs. Dynamic Sequence Parallelism

Methods

The authors introduce Dynamic Sequence Parallelism (DSP), which treats sequence parallelism as a high-level abstraction rather than something hard-coded into the module logic.

The core innovation is the Dynamic Switch. Instead of keeping the sharding fixed, DSP reshards the data between computation stages.

The Dynamic Switch Operation
  • The Primitives: DSP uses three main operations: Switch (an efficient all-to-all communication to change the sharded axis), Split, and Gather.
  • Decoupled Logic: Because the resharding happens between stages (e.g., after the temporal block but before the spatial block), the internal logic of the Transformer modules remains untouched. This makes DSP "plug-and-play" with specialized kernels like FlashAttention or alternative architectures like Mamba.
  • Communication Efficiency: By ensuring the data is sharded along the dimension not being calculated, the GPU has all the information it needs locally for the current axis. This simplifies communication patterns and significantly reduces the volume of data moved across the network.

Datasets

The researchers evaluated DSP using 2D-Transformer models (720M and 3B parameters) modeled after OpenSora, an open-source video generation framework.

  • Workload: They tested sequence lengths ranging from 0.5 million to 4 million tokens, representing common requirements for high-fidelity video generation.
  • Hardware: Experiments were conducted on a cluster of 128 NVIDIA H100 GPUs interconnected with NVLink (intra-node) and InfiniBand (inter-node).

Key Insights and Ideas

  • Alignment is Everything: The "aha moment" is realizing that multi-dimensional Transformers perform independent calculations along specific axes. If you align your parallelism to match those axes dynamically, you eliminate the need for redundant "all-reduce" or "all-gather" operations within the attention layers.
  • Communication Scales with Cluster Size: In DSP, the communication volume per device is $2M/N$ (where $M$ is activation size and $N$ is the number of GPUs). This means as you add more GPUs, the communication burden on each individual device actually decreases, making it exceptionally scalable for "super-clusters."
  • Ease of Use: Unlike previous methods that require deep dives into CUDA kernels or complex framework-specific code, DSP provides a simple API. It is compatible with standard PyTorch distributed frameworks like FSDP and DeepSpeed.

Key Results

  • Throughput: DSP outperformed DeepSpeed-Ulysses by 32% to 75% and beat other methods like Megatron-LM by up to 10x in end-to-end throughput.
  • Communication Volume: DSP achieved at least a 50% to 75% reduction in communication volume compared to state-of-the-art baselines.
  • Scaling: The method showed near-linear "weak scaling" (increasing GPUs and workload together) up to 64 GPUs. In some intra-node tests, it even showed "super-linear" scaling due to the extreme efficiency of the resharding strategy on NVLink.
  • Memory: DSP maintained the lowest memory footprint, effectively sharding every tensor and avoiding the "cache bloat" seen in methods like Ring-Attention.

Limitations and Future Work

The authors note a few constraints:

  • Architecture Specificity: DSP is specifically optimized for multi-dimensional Transformers. It may not provide the same level of benefit for standard 1D language models (LLMs) where there is only one sequence dimension to shard.
  • Global Operations: In rare cases where a model requires a "global" operation involving all sequence dimensions simultaneously, DSP might lose some of its efficiency.

Future Directions: The team plans to extend DSP beyond Transformers to other architectures like CNNs, RNNs, and Graph Neural Networks. They also aim to develop automated tools that can analyze a model's network structure and autonomously determine the most effective dimension-switching strategy.

Summary updated

BibTeX
@inproceedings{zhao2025dsp,
  author = {Xuanlei Zhao and Shenggan Cheng and Chang Chen and Zangwei Zheng and Ziming Liu and Zheming Yang and Yang You},
  title = {{DSP: Dynamic Sequence Parallelism for Multi-Dimensional Transformers}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=bezL796MKt},
}
Figure