ArXiv: 2309.14509
🎯 Pitch
Training Transformers on million-token sequences sounds impossible—until DeepSpeed-Ulysses shows that its all-to-all attention sharding keeps communication volume constant even as sequence length skyrockets, while prior methods see communication costs balloon linearly. The result? 2.5× faster training on sequences 4× longer than the state of the art, sustained at over 54% of hardware peak FLOPS.
1. Executive Summary
This paper introduces DeepSpeed-Ulysses, a system optimization methodology for training Transformer models on extremely long sequences. Evaluating GPT models from 1.2B to 30B parameters on up to 256 A100 GPUs, DeepSpeed-Ulysses partitions input data along the sequence dimension and employs an efficient all-to-all collective communication primitive for attention computation, distributing attention heads across GPUs so that each device computes full-sequence attention for a non-overlapping subset of heads. The system achieves up to 2.5× training throughput improvement over the existing SOTA baseline (Megatron-LM sequence parallelism) at 4× longer sequence lengths, sustains over 175 TFLOPs/GPU (over 54% of hardware peak), and enables training with over one million tokens in sequence length—establishing that constant communication volume is maintained when sequence length and GPU count are scaled proportionally, in contrast to prior approaches whose communication volume grows linearly with sequence length regardless of parallelism degree.
2. Context and Motivation
The Core Problem: Existing Parallelism Strategies Cannot Scale Along the Sequence Dimension
The fundamental gap this paper addresses is that existing large-model training systems have no mechanism for efficiently parallelizing computation along the sequence length dimension. This is not a minor oversight — it reflects the historical trajectory of LLM training system design, which has been exclusively optimized around three axes: batch size, hidden dimension, and model depth.
To understand why this matters, we need to look at what each existing parallelism strategy actually does. Data parallelism partitions the input batch across devices, replicating the model on each device. This handles the batch dimension but provides no help with sequence length — every device still processes the full sequence for its assigned batch slice, so the per-device activation memory grows with sequence length regardless of how many devices are used. Tensor parallelism splits individual operators (the attention and MLP weight matrices) across devices, targeting the hidden dimension. Pipeline parallelism assigns different layers to different devices, targeting model depth. None of these three touch the sequence length at all — they are, as the paper puts it, "not targeted or optimized for long sequence Transformer models" (Section 1).
This means that when practitioners want to train on longer sequences — a need that has become urgent across both generative AI and scientific applications — they hit a hard wall. The intermediate activations produced during the forward pass are proportional to batch size × sequence length × hidden dimension. When sequence length grows from 8K to 32K or 128K, the activation memory grows proportionally. Existing parallelism strategies can distribute the model parameters (via ZeRO) and the computation (via tensor and pipeline parallelism), but the per-device activation memory remains proportional to the full sequence length, because no existing strategy splits the sequence itself across devices.
This is the specific gap: there is no production-ready, memory-and-communication-efficient method for partitioning the sequence dimension across GPUs in a way that scales gracefully with both model size and sequence length.
Why Long Sequence Training Matters: Two Converging Application Domains
The paper justifies the urgency of this problem by enumerating applications from two domains that are converging on the same requirement: extremely long context windows.
Generative AI applications. The paper identifies several concrete scenarios:
-
Long-document summarization and question answering. Tasks like chapter-level or book-level summarization involve inputs estimated at "tens and hundreds of thousands of words" (Section 1). The paper cites Beltagy et al. (2020), Kryściński et al. (2022), and MosaicML (2023) as evidence that these tasks are both practically important and technically demanding. Xiong et al. (2023), Peng et al. (2023), and Touvron et al. (2023) are cited to establish that long-sequence training directly improves performance on these tasks.
-
Chat applications with extended history. The deployment of conversational AI systems (the paper references ChatGPT and subsequent open-source and product LLMs) creates a need for models that can condition on long interaction histories. The paper specifically ties this to Touvron et al. (2023) (the LLaMA 2 paper), noting that "processing long sequence is crucial for supporting longer histories in chat applications."
-
Multimodal foundation models. Models that process speech, images, and waveforms concurrently require reasoning over "high dimensional inputs with long sequences" (Section 1). A waveform sampled at 16 kHz produces 16,000 samples per second — context windows spanning minutes of audio translate to sequence lengths in the hundreds of thousands or millions. Similarly, video generation involves spatiotemporal tokens whose count scales with both spatial resolution and temporal duration.
AI for science applications. The paper draws on examples that make the scale requirements concrete in a way that general language tasks do not:
-
Genomic language models. Zvyagin et al. (2022) adapted LLMs to learn evolutionary patterns from gene sequences, but the human genome contains 6.4 billion nucleotide letters. Treating each letter as a token — or even grouping them into k-mers — yields sequence lengths orders of magnitude beyond what existing systems can handle. The paper makes this concrete: "the human genome has 6.4 billion letters" (Section 1), which is roughly 800,000× longer than the 8K context windows common at the time of writing.
-
Clinical and healthcare applications. The paper cites Li et al. (2022a) and Gao et al. (2021) on diagnostic predictive models conditioned on entire patient care records. A patient's medical history spanning years of encounters, lab results, imaging reports, and clinical notes can easily produce sequence lengths in the tens or hundreds of thousands of tokens when tokenized.
-
Weather and climate modeling. Nguyen et al. (2023) is cited for ClimaX, a foundation model for weather and climate that must process spatiotemporal data with long-range dependencies across both spatial grid points and temporal snapshots.
These applications share a common property: the information relevant to a prediction is distributed across a very long input, and truncating the input (the default workaround when sequence parallelism is unavailable) discards information that is essential for the task. For genomic models, truncating a chromosome loses the long-range regulatory interactions that span millions of base pairs. For clinical models, truncating a patient history loses earlier diagnoses and treatments that contextualize current symptoms. The paper's motivating claim is that these applications cannot be adequately served without a system that can handle sequences far longer than current parallelism strategies allow.
Prior Approaches to Sequence Parallelism and Their Shortcomings
The paper does not claim to invent sequence parallelism — it acknowledges that prior work has addressed this problem. However, it argues that existing approaches are limited in ways that make them unsuitable for the extreme-scale scenarios described above. The paper compares against two specific prior methods, each with distinct weaknesses.
ColAI-SP (Ring Self-Attention). Li et al. (2022b) proposed "ring self-attention," a sequence parallelism scheme built around ring-style communication. The core idea is that each device holds a local partition of the query (Q) projections, while key (K) and value (V) projections are transmitted around a logical ring among participating devices. Each device receives K and V from its neighbors, computes attention against its local Q, and passes the K and V along. After traversing the full ring, each device has computed global attention for its local Q partition.
The paper identifies three problems with this approach. First, the communication complexity is O(M) — linear in the message size M (which itself grows with sequence length). Each device must transmit its full K and V partitions to every other device in the ring, so the total communication volume scales with sequence length regardless of how many GPUs are used. This means adding more GPUs does not reduce the per-device communication burden. Second, ColAI-SP requires a specific attention implementation — the ring communication pattern is baked into the attention computation itself, making it incompatible with optimized attention kernels (such as FlashAttention) that a user might want to plug in. Third, the paper claims ColAI-SP is not easy to use, suggesting that adopting it requires intrusive and error-prone code changes to existing training frameworks (Section 2.2, Table 1).
Megatron-LM Sequence Parallelism. Korthikanti et al. (2022) integrated sequence parallelism into the Megatron-LM framework, but in a way that is tightly coupled with Megatron's tensor parallelism. In this approach, the sequence is partitioned along the sequence dimension, and allgather and reduce-scatter collectives are used to aggregate Q, K, and V projections for attention computation. Each device needs to gather the full Q, K, and V for its assigned portion of the attention computation.
The paper's communication analysis (Section 3.2) reveals why this approach scales poorly. Megatron-LM performs two allgather operations (aggregate message size Nh each, where h is hidden size) and two reduce-scatter operations (aggregate message size Nh each), for a total of 4Nh per transformer layer. The critical insight is that allgather and reduce-scatter of size M incur communication volume of M per link (not M/P) when the number of GPUs P is large. So the per-link communication volume is 4Nh — linear in sequence length N, regardless of how many GPUs are used. As the paper states: "Megatron-LM sequence parallelism incurs a communication volume per link of 4Nh which is P times larger than that for DeepSpeed sequence parallelism" (Section 3.2). This means that adding GPUs increases total communication cost proportionally to P without reducing per-device cost, making the approach fundamentally unscalable for long sequences.
Beyond communication, the paper identifies two additional weaknesses. First, Megatron-LM sequence parallelism is tightly integrated with Megatron's tensor parallelism, meaning it cannot be used independently — you must adopt Megatron's tensor parallelism to get sequence parallelism, which constrains deployment flexibility. Second, this coupling limits memory efficiency, because tensor parallelism itself has memory overhead from redundant activations and parameters that could otherwise be partitioned using ZeRO-style strategies.
Table 1 in the paper provides a structured comparison. Megatron-LM-SP has O(M) communication complexity (where M grows with sequence length), provides activation memory efficiency but not parameter memory efficiency, is not attention-agnostic (tied to Megatron's attention implementation), and is not easy to use (requiring adoption of the full Megatron parallelism stack). ColAI-SP shares the O(M) communication weakness and additionally fails on parameter memory efficiency, attention agnosticism, and ease of use.
How DeepSpeed-Ulysses Positions Itself
The paper's positioning is made explicit in Table 1 and the surrounding discussion. DeepSpeed-Ulysses is presented not as yet another sequence parallelism method, but as the first to simultaneously satisfy four properties:
-
Communication complexity of O(N/P). Because of the all-to-all collective design (detailed in Section 3), the per-link communication volume is
M/Prather thanM. When sequence lengthNand GPU countPare scaled proportionally, the communication volume per device remains constant. This is the paper's central technical claim and the property that distinguishes it from both ColAI-SP and Megatron-LM-SP, both of which are O(N) regardless of P. -
Full memory efficiency. By integrating with ZeRO-3, DeepSpeed-Ulysses partitions both activation memory (via sequence parallelism) and parameter/optimizer state memory (via ZeRO-3 across the combined data-parallel and sequence-parallel groups). The paper emphasizes that this enables scaling "not just to large sequence lengths but also to large models" (Section 3.3). Neither prior approach achieves both forms of memory efficiency simultaneously.
-
Attention agnosticism. The design partitions attention heads across devices — each device computes full attention for its assigned subset of heads, using the full sequence but only a fraction of the heads. Because the attention computation itself is unmodified (it operates on full Q, K, V for each head locally), any attention variant — dense, sparse, causal, cross-attention, FlashAttention — can be plugged in without changing the parallelism scheme. The paper explicitly claims support for "dense as well as sparse attention" and "efficient attention implementations such as FlashAttention v2" (Section 1).
-
Ease of use. The paper claims DeepSpeed-Ulysses "require[s] minimal code changes to the existing training frameworks" (Section 1). This is contrasted with Megatron-LM-SP, which requires adopting Megatron's tensor parallelism, and ColAI-SP, which requires a bespoke attention implementation.
The paper also positions its approach as orthogonal to existing parallelism strategies (data, tensor, pipeline, ZeRO). DeepSpeed-Ulysses adds sequence parallelism as a fourth dimension that can be combined with the other three, addressing a gap that the other three cannot fill. The paper explicitly notes: "DeepSpeed sequence parallelism is orthogonal to both data parallelism and ZeRO. Our proposed approach can be used with both methods" (Section 2.1.2).
A practical scenario the paper uses to motivate its approach is the tension between sequence length and batch size in large-scale training. Consider training on 1024 GPUs with a sequence length of 8K and micro-batch size of 1 per GPU — this yields an 8-million-token global batch size. If a practitioner wants to increase sequence length to 32K for quality reasons, the global batch size quadruples to 32 million tokens, which may harm model convergence (the paper cites Keskar et al., 2016 on large-batch training impacts). Sequence parallelism resolves this: by partitioning the sequence across 4 GPUs, each GPU processes 8K tokens, the global batch size stays at 8 million, and the model sees 32K-token sequences. This is presented not as a theoretical nicety but as a concrete workflow improvement that "requires no laborious hyperparameter search" (Section 2.1.2).
Reconciling the Landscape: What Was Missing
Before DeepSpeed-Ulysses, the landscape of LLM training parallelism had a conspicuous gap. Data parallelism handles batch size, tensor parallelism handles hidden dimension, pipeline parallelism handles depth — but sequence length, the fourth dimension of the Transformer computation, had no dedicated, scalable, general-purpose parallelism strategy. The two existing attempts at sequence parallelism (ColAI-SP and Megatron-LM-SP) existed but were limited by communication complexity that scaled linearly with sequence length, making them impractical for the million-token regimes that applications demand.
The paper's contribution, seen in this context, is not proposing that sequence parallelism is a good idea — it's showing that a specific communication primitive (all-to-all) combined with head-wise partitioning produces a sequence parallelism scheme whose communication cost is fundamentally better (constant rather than linear in sequence length when GPUs scale proportionally), and that this property, combined with ZeRO integration and attention-agnostic design, finally makes sequence parallelism a practical, scalable building block for extreme-scale training rather than a proof-of-concept.
3. Technical Approach
3.1 Reader Orientation
DeepSpeed-Ulysses is a distributed training system component that partitions Transformer input sequences across multiple GPUs and coordinates their communication so that each GPU computes a fraction of the attention heads on the full sequence. The problem it solves is that existing parallelism strategies (data, tensor, pipeline) cannot distribute the activation memory proportional to sequence length across devices, and prior sequence parallelism approaches have communication costs that grow linearly with sequence length regardless of how many GPUs are used, making them impractical for million-token regimes. The solution's "shape" is an all-to-all collective-based exchange that transforms a sequence-partitioned data layout into a head-partitioned data layout before attention computation, then transforms it back afterward, achieving communication volume that remains constant per device when sequence length and GPU count are scaled proportionally.
3.2 Big-Picture Architecture (Diagram in Words)
The system has four logical components arranged in a pipeline that each Transformer layer executes once:
-
Input Sequence Partitioner — divides the input sequence of length
$N$into$P$contiguous chunks of size$N/P$, one per GPU. This partitioning is maintained through all non-attention operations (linear projections, layer norm, MLP). -
All-to-All QKV Collector — immediately before attention, each GPU projects its local
$N/P$sequence chunk into query (Q), key (K), and value (V) embeddings, then an all-to-all collective redistributes these tensors so that each GPU receives the full sequence of length$N$but only for a non-overlapping subset of$h/P$attention heads (where$h$is total number of heads). -
Per-Head Attention Computer — each GPU independently computes standard scaled dot-product attention on its assigned heads using the full
$N$-length Q, K, V for those heads. Because attention computation is head-parallel (heads do not interact during attention), this requires no inter-GPU communication. -
All-to-All Output Collector — a second all-to-all collective redistributes the attention output tensor, transforming from the head-partitioned layout back to the sequence-partitioned layout, so each GPU once again holds
$N/P$contiguous sequence positions (but now with information from all heads having attended over the full sequence).
Information flows through one Transformer layer as follows: input sequence (partitioned, $N/P$ per GPU) → linear projections to Q, K, V (still partitioned) → first all-to-all (repartition to $N$ tokens × $h/P$ heads per GPU) → attention computation (local, no communication) → second all-to-all (repartition back to $N/P$ tokens × $h$ heads per GPU) → MLP and remaining Transformer operations (partitioned).
3.3 Roadmap for the Deep Dive
- First: the data partitioning and layout transformation — how the sequence is split, what each GPU holds at each stage, and why the all-to-all primitive is the key enabler. This establishes the spatial data flow that the rest of the design depends on.
- Second: the all-to-all communication primitive — its mechanics, why its per-link volume is
$M/P$rather than$M$, and how this differs from theallgather/reduce-scatterprimitives used by Megatron-LM. This is the theoretical core of the paper's advantage claim. - Third: the communication complexity analysis, formalizing why DeepSpeed-Ulysses is O(N/P) while Megatron-LM-SP is O(N), and what this means for scalability when sequence length and GPU count are scaled together.
- Fourth: memory efficiency and ZeRO-3 integration — how sequence parallelism reduces activation memory and how ZeRO-3 parameter partitioning is extended across the combined data-parallel and sequence-parallel groups to handle both large models and long sequences simultaneously.
- Fifth: the attention-agnostic property — why the head-partitioned design supports any attention variant and how this differs from approaches like ColAI-SP that require bespoke attention implementations.
- Sixth: the ease-of-use and orthogonality claims — how DeepSpeed-Ulysses composes with existing parallelism strategies and what code changes are required.
This order works because it moves from the concrete data movement (what physically happens on each GPU) to the abstract scaling analysis (why it works at scale) to the integration properties (how it fits into a complete training stack). Each step builds on the layout understanding established in the previous steps.
3.4 Detailed, Sentence-Based Technical Breakdown
This is primarily a systems design paper whose core idea is that by using the all-to-all communication collective to convert between sequence-partitioned and head-partitioned layouts, the communication cost of sequence parallelism can be made inversely proportional to the number of GPUs, enabling scaling to extreme sequence lengths where prior approaches become communication-bound.
3.4.1 Data Partitioning and Layout Transformation
The starting layout and why it matters. Before attention computation, each Transformer layer receives a 3D activation tensor of shape $[N, b, d]$ where $N$ is the sequence length, $b$ is the micro-batch size, and $d$ is the hidden dimension. In standard single-GPU training (and in data-parallel training where each GPU has a different batch slice), $N$ and $d$ are both fully materialized on each device. The fundamental problem is that the intermediate activations produced during the forward pass grow proportionally with $N$ — doubling the sequence length doubles the activation memory footprint per device.
DeepSpeed-Ulysses addresses this by partitioning the input tensor along the sequence dimension across $P$ GPUs. Each GPU $i$ (where $i \in \{0, 1, ..., P-1\}$) receives a contiguous slice of the sequence:
- GPU
$i$holds sequence positions$[i \times N/P, (i+1) \times N/P)$. - Its local tensor has shape
$[N/P, b, d]$. - Activation memory per device is reduced by a factor of
$P$relative to the full-sequence baseline.
This partitioning is maintained through all the linear projection layers (Q, K, V projections) that precede attention, as well as through the layer norm and MLP blocks that follow attention. Each GPU independently projects its $N/P$ sequence positions through the Q, K, V weight matrices, producing local Q, K, V tensors each of shape $[N/P, b, d]$.
The challenge at the attention boundary. The standard scaled dot-product attention operation computes:
where $d_k$ is the per-head dimension. Critically, the $QK^T$ matrix multiplication requires each query position to interact with every key position — the attention operation is global over the sequence dimension. If each GPU holds only $N/P$ sequence positions of Q, K, and V, it cannot compute the full attention — query positions on GPU 0 need to attend to key positions on GPUs 1, 2, ..., P-1.
There are two natural strategies for resolving this. One is to gather the full Q, K, V tensors on every GPU before attention (the Megatron-LM approach, which uses allgather). The other is to reorganize the data so that each GPU holds a different slice of the tensor that permits local computation without cross-device dependency. DeepSpeed-Ulysses takes the second approach, and the key insight is that attention heads are independent. There is no interaction between different attention heads during the attention computation — head 0's Q, K, V never need to interact with head 1's Q, K, V. This means that if we can give each GPU the full sequence for a subset of heads, each GPU can compute attention locally for those heads without any communication.
The layout transformation: sequence-partitioned to head-partitioned. The Q, K, V tensors on each GPU have shape $[N/P, b, d]$, where $d = h \times d_k$ (the hidden dimension equals the number of heads times the per-head dimension). Conceptually, the head dimension is embedded within the $d$ dimension. The all-to-all collective redistributes these tensors across GPUs such that:
- Before all-to-all: GPU
$i$holds sequence slice$i$(positions$[i \times N/P, (i+1) \times N/P)$) for all$h$heads. - After all-to-all: GPU
$i$holds the full sequence (positions$[0, N)$) but only for heads$[i \times h/P, (i+1) \times h/P)$.
The resulting local Q, K, V tensors on each GPU have shape $[N, b, d/P]$ — the full sequence length but only $1/P$ of the head dimension. Each GPU can now independently compute $h/P$ attention heads using the full sequence, with no cross-device communication during the attention computation itself.
After attention: the reverse transformation. The attention output tensor on each GPU has shape $[N, b, d/P]$ (full sequence, subset of heads). To continue with the rest of the Transformer layer (MLP, layer norm, residual connections), the system needs to return to the sequence-partitioned layout where each GPU handles $N/P$ sequence positions. A second all-to-all collective redistributes the output, transforming from head-partitioned back to sequence-partitioned. After this second all-to-all, each GPU holds a tensor of shape $[N/P, b, d]$ containing $N/P$ sequence positions for all $h$ heads — exactly the same layout as before the attention block.
Why two all-to-alls rather than one. One might ask whether the system could use a single all-to-all to simultaneously gather Q, K, V and scatter the attention output. The paper uses two separate all-to-alls (one before attention, one after) for two reasons. First, the input and output of attention are different tensors with different purposes — the input all-to-all establishes the layout needed for attention computation, and the output all-to-all restores the layout needed for subsequent layers. Second, separating them allows the intermediate attention computation to be entirely local, with no communication interleaved between the attention operations. This modularity is part of what makes the design attention-agnostic (any attention implementation can be plugged into the gap between the two all-to-alls).
The role of the micro-batch dimension. The paper consistently describes tensors with shape $[N, b, d]$, including the batch dimension $b$. The all-to-all collective operates on the combined $N \times b$ sequence-batch dimension — it redistributes all sequence positions across all batch elements simultaneously. Equivalently, one can think of the all-to-all as operating on a tensor of effective shape $[N \times b, d]$ (flattening the batch and sequence dimensions), then reshaping back. The batch dimension $b$ is not partitioned by sequence parallelism (that would be data parallelism's job), but it is carried through the all-to-all as an additional dimension that rides along with the sequence redistribution. Keeping $b$ explicit in the tensor shapes clarifies that the batch dimension is unaffected by sequence parallelism.
3.4.2 The All-to-All Communication Primitive
What an all-to-all collective does. In a standard allgather, every GPU broadcasts its local data to all other GPUs, and every GPU ends up with the concatenation of all local contributions — the total data volume on each GPU multiplies by $P$. An all-to-all is different: each GPU sends a different portion of its local data to each destination GPU, and receives a different portion from each source GPU. The result is a redistribution — the total amount of data on each GPU stays the same, but its composition changes.
Formally, if there are $P$ GPUs and the total aggregate message across all GPUs has size $M$ (counted in bytes or elements), then in an all-to-all:
- Each GPU starts with
$M/P$elements. - Each GPU ends with
$M/P$elements. - The total data transmitted across the interconnect is
$M$(up to a factor of$(P-1)/P$depending on whether local contributions count as "communicated"). - The per-link communication volume (the amount of data traversing any single GPU's network interface) is
$M/P$. This is the critical metric for communication-bound scalability.
On modern GPU clusters with NVSwitch intra-node interconnects and fat-tree InfiniBand inter-node topologies, the network bisection bandwidth scales with the number of GPUs $P$. The all-to-all collective exploits this: as $P$ increases, the per-link volume $M/P$ decreases, and (assuming adequate bisection bandwidth) the communication time can remain approximately constant even as total data volume $M$ grows.
How the all-to-all is used in DeepSpeed-Ulysses. For a Transformer with hidden size $h$, sequence length $N$, and parallelism degree $P$, the first all-to-all redistributes the Q, K, and V tensors. The aggregate message size across all $P$ GPUs for these three tensors combined is $3Nh$ (three tensors, each of size $N \times h$ across all GPUs, counting elements). Each GPU contributes $3Nh/P$ elements (its local Q, K, V) and receives $3Nh/P$ elements (the full Q, K, V for $h/P$ heads). The per-link communication volume for the first all-to-all is $3Nh/P$.
The second all-to-all redistributes the attention output tensor, whose aggregate message size is $Nh$ (one output tensor of size $N \times h$). The per-link volume is $Nh/P$.
The total per-link communication volume for one Transformer layer under DeepSpeed-Ulysses is therefore:
The key observation: this is inversely proportional to $P$. Doubling the number of GPUs while keeping $N$ and $h$ fixed halves the per-link communication volume. Scaling $N$ and $P$ proportionally (e.g., doubling both $N$ and $P$) keeps $4Nh/P$ constant — the per-link volume stays the same even as the sequence length (and thus total computation) grows quadratically.
Contrast with allgather-based approaches (Megatron-LM-SP). Megatron-LM sequence parallelism uses allgather and reduce-scatter collectives instead of all-to-all. The key difference is in how these collectives scale with $P$:
- In an
allgather, each GPU broadcasts its local data to all others. If each GPU's local contribution has size$M/P$, the total data received by each GPU is$M$. The per-link communication volume is$M$— it does not decrease with$P$. - In a
reduce-scatter, each GPU receives a different$1/P$fraction of a reduced result, and the total data sent by each GPU is$M$. Again, per-link volume is$M$, independent of$P$.
Megatron-LM-SP performs two allgather operations (one for keys and one for values, or equivalent) and two reduce-scatter operations per Transformer layer, each with aggregate message size $Nh$. The per-link communication volume is:
This is independent of $P$ — adding more GPUs provides no per-device communication relief. When $P=1$, both methods have the same per-link volume of $4Nh$. But when $P=64$ (a typical large-scale training configuration), DeepSpeed-Ulysses has per-link volume of $4Nh/64 = Nh/16$, while Megatron-LM-SP still has $4Nh$. The ratio is $P:1$ — DeepSpeed-Ulysses uses $P times less communication bandwidth per device.
Why this matters for end-to-end performance. Attention computation is $O(N^2)$ in sequence length (each of $N$ query positions attends to all $N$ key positions). For long sequences, the computation cost grows quadratically and quickly dominates communication. For moderate sequences, communication can be the bottleneck — especially in Megatron-LM-SP where communication cost is $O(N)$ with a large constant factor (4 allgather/reduce-scatter operations per layer, each moving the full hidden dimension). DeepSpeed-Ulysses's per-link communication volume of $4Nh/P$ grows only linearly with $N/P$, and when $P$ is chosen proportional to $N$, it stays constant. This means the system can maintain high GPU utilization at very long sequence lengths, whereas Megatron-LM-SP would become communication-bound and leave compute idle.
Clarifying the "constant communication volume" claim. The paper's headline claim that DeepSpeed-Ulysses "maintains constant communication volume when sequence length and compute devices are increased proportionally" (Abstract, Section 1) is a statement about per-link communication volume, not total aggregate volume. The total aggregate communication across all GPUs is $4Nh$ for DeepSpeed-Ulysses (same as Megatron-LM-SP). But because each GPU's network interface only carries $1/P$ of that total (vs. the full amount in allgather-based methods), the per-device bandwidth demand stays flat. This is what matters for throughput: a GPU's compute time is determined by its $N \times N/P$ attention workload, and if communication time per layer stays bounded, the GPU stays fed with work.
3.4.3 Communication Complexity Analysis (Formal Comparison)
The paper's communication analysis in Section 3.2 provides a concise formalization of the advantage described qualitatively above. The analysis compares DeepSpeed-Ulysses against Megatron-LM sequence parallelism and ColAI-SP along the dimension of per-link communication volume as a function of sequence length $N$ and parallelism degree $P$.
DeepSpeed-Ulysses per-layer communication. For one Transformer layer with hidden size $h$ and sequence length $N$ distributed over $P$ GPUs:
- QKV all-to-all: Aggregate message size
$3Nh$. Per-link volume:$3Nh/P$. - Output all-to-all: Aggregate message size
$Nh$. Per-link volume:$Nh/P$. - Total per-link volume:
$3Nh/P + Nh/P = 4Nh/P$.
The paper states: "DeepSpeed sequence parallelism incurs an aggregate communication volume per link of $4Nh/P$ (or with the complexity of $O(N/P)$). Note that this communication volume is constant when both $N$ and $P$ are increased proportionally" (Section 3.2).
Megatron-LM-SP per-layer communication. Megatron-LM partitions the sequence and uses allgather to collect K and V (or Q, K, V) for attention, then reduce-scatter for the output:
- Allgather operations: Two allgather operations with aggregate message size
$Nh$each (total$2Nh$). For each allgather of size$M$, the per-link volume is$M$(not$M/P$) when$P \gg 1$, because allgather broadcasts each device's contribution to all others. - Reduce-scatter operations: Two reduce-scatter operations with aggregate message size
$Nh$each (total$2Nh$). Similarly, per-link volume is$M$for each. - Total per-link volume:
$2Nh + 2Nh = 4Nh$. Complexity:$O(N)$, independent of$P$.
The paper states: "Megatron-LM performs two all-gather with the message volume of $Nh$ and two reduce-scatter with the volume of $Nh$ for each transformer layer. However, the cost of each all-gather and reduce-scatter of size $M$ remains $M$ when $P \gg 1$, instead of $M/P$" (Section 3.2).
ColAI-SP per-layer communication. The ring self-attention approach transmits keys and values around a ring of $P$ devices. Each device sends its local K and V to its neighbor, and after $P-1$ steps, every device has seen the full K and V for all sequence positions. The total communication volume per device is proportional to the full K and V size (linear in $N$), and the per-link volume does not decrease with $P$ (each step moves the full local K/V chunks). The paper classifies ColAI-SP as $O(M)$ where $M$ is the message size — effectively $O(N)$ when the hidden dimension is fixed.
Why this difference matters architecturally. The $O(N/P)$ vs. $O(N)$ distinction is not just a constant-factor improvement — it's a qualitative difference in scalability. For Megatron-LM-SP, scaling from $N=8K$ to $N=1M$ (a 125× increase) increases per-link communication volume by 125×, regardless of how many GPUs are used. The system will become communication-bound long before reaching 1M tokens. For DeepSpeed-Ulysses, increasing both $N$ from 8K to 1M and $P$ from 8 to 1000 keeps $N/P$ and thus per-link communication volume constant. The system's bottleneck shifts to compute (the $O(N^2)$ attention workload), which can be addressed by giving each GPU fewer heads ($h/P$) and therefore less work per sequence position.
The paper does not provide an end-to-end communication-computation overlap analysis (e.g., whether the all-to-alls can be hidden behind computation), but the fundamental scaling property — per-link volume $\propto N/P$ rather than $\propto N$ — is the central theoretical claim and the reason DeepSpeed-Ulysses can reach million-token regimes that prior methods cannot.
3.4.4 Memory Efficiency and ZeRO-3 Integration
While DeepSpeed-Ulysses reduces activation memory by partitioning the sequence dimension (reducing per-device activation footprint from $O(Nbd)$ to $O((N/P)bd)$), it does not directly reduce the memory consumed by model parameters, optimizer states, and gradients. For large models (billions to tens of billions of parameters), these model states can dominate memory usage, and the paper integrates DeepSpeed-Ulysses with ZeRO-3 to address this.
What ZeRO-3 does (background). ZeRO Redundancy Optimizer Stage 3 partitions model states (parameters, gradients, and optimizer states such as Adam's first and second moment estimates) across data-parallel ranks. Instead of each data-parallel GPU holding a full copy of the model parameters, each GPU holds only $1/D$ of the parameters (where $D$ is the data-parallel degree). When a parameter is needed for computation in a forward or backward pass, ZeRO-3 performs an allgather to materialize the full parameter on all GPUs in the data-parallel group, uses it for the forward/backward computation, then discards the full materialization (keeping only its partition). During the optimizer step, gradients are reduced-scattered across the group, so each GPU updates only its partition of the parameters. This transforms the memory cost of model states from $O(\text{model size})$ per GPU to $O(\text{model size} / D)$ per GPU.
How sequence parallelism interacts with ZeRO-3. The paper's key integration insight is that sequence parallelism introduces an additional parallel dimension beyond the data-parallel dimension. In a typical setup with data parallelism alone, the parallel group has size $D$ (the data-parallel world size). With sequence parallelism added, the training data is now parallelized in two ways: across samples (data parallelism, $D$-way) and across sequence positions (sequence parallelism, $P$-way). The paper's approach is to combine these into a single larger ZeRO group of size $D \times P$.
Specifically, the paper states: "we extend ZeRO-3 partitioning to combination of data parallel and sequence parallel ranks. In other words, in DeepSpeed sequence parallelism, ZeRO partitions model states across both sequence and data parallel group and collects per rank partitions (allgather) when they are needed" (Section 3.3).
This means that if you have 32 data-parallel ranks and 8-way sequence parallelism (total 256 GPUs training one model), ZeRO-3 partitions parameters across all 256 GPUs, not just across the 32 data-parallel ranks. Each GPU holds $1/256$ of the model parameters rather than $1/32$. This dramatically increases the effective ZeRO degree, reducing per-GPU model-state memory by an additional factor of $P$.
Why this jointly enables large models and long sequences. Before DeepSpeed-Ulysses, a practitioner training a large model faced a difficult tradeoff. Data parallelism partitions model states but does not help with activation memory, which grows with sequence length. Sequence parallelism (Megatron-LM-SP) reduces activation memory but is tightly coupled to tensor parallelism, limiting ZeRO integration and parameter memory efficiency. The practitioner had to choose: either train a large model (using ZeRO-3) but with limited sequence length (constrained by per-GPU activation memory), or train with longer sequences (using Megatron-LM-SP) but with a smaller model (constrained by parameter memory). DeepSpeed-Ulysses resolves this tradeoff by simultaneously providing activation memory reduction (via sequence partitioning, factor of $P$) and parameter memory reduction (via ZeRO-3 across the combined $D \times P$ group, factor of $D \times P$).
Memory quantification (activation vs. parameter vs. optimizer). The paper does not provide a detailed memory breakdown with specific numbers, but the qualitative picture is clear. Activation memory for a Transformer layer is proportional to $N \times b \times h$ (sequence length × batch size × hidden dimension), and sequence parallelism reduces this by $P$. Parameter memory includes the weight matrices (size proportional to $h^2 \times \text{num layers}$) and optimizer states (typically 2× to 3× the parameter size for Adam, due to momentum and variance buffers). ZeRO-3 across $D \times P$ GPUs reduces these by $D \times P$. Both reductions scale with increased parallelism, meaning that by choosing $P$ and $D$ appropriately, a practitioner can keep both activation and parameter memory within GPU limits while scaling model size and sequence length simultaneously.
Gradient reduction across combined groups. The paper notes that "gradients are reduced across both data and sequence parallel ranks for parameter update" (Section 3.3). This is a natural consequence of treating the combined $D \times P$ group as a single ZeRO group: after the backward pass, each GPU holds gradients only for the subset of operations it performed. To update parameters correctly, these gradients must be reduced (averaged) across all GPUs that computed contributions to the same parameters. Because the attention heads were partitioned across the sequence-parallel dimension, each GPU computed gradients only for $h/P$ heads. However, the linear projection layers (Q, K, V, and output projections) were applied to all heads on each GPU, so their gradients are partial contributions that need reduction across the sequence-parallel dimension too. The paper handles this by making the ZeRO-3 reduce-scatter collective operate over the full $D \times P$ group, ensuring that each GPU's parameter update reflects the average gradient across all data samples and all sequence positions.
3.4.5 Attention-Agnostic Design
One of the paper's five contribution bullet points (Section 1) is: "Fully general and implementation agnostic attention: DeepSpeed sequence parallelism (Ulysses) supports dense as well as sparse attention, and it works with efficient attention implementations such as FlashAttention v2."
Why attention agnosticism is non-trivial. Prior sequence parallelism approaches are tied to specific attention implementations. ColAI-SP's ring self-attention requires the attention computation to be interleaved with ring communication — each attention step (attending to one neighbor's K and V) must be implemented with the ring semantics baked in, making it incompatible with standard optimized attention kernels. Megatron-LM-SP's allgather-based approach is less tightly coupled but still requires the attention computation to be aware of the gathered tensor layout (full sequence, full heads), which may not match the input assumptions of highly optimized kernels like FlashAttention.
The mechanism that enables agnosticism. DeepSpeed-Ulysses achieves attention agnosticism through the modularity of its design. The all-to-all communication is a preprocessing step that transforms the data layout before attention computation begins. After the all-to-all, each GPU holds a standard-looking attention input: a tensor of shape $[N, b, d/P]$ containing the full sequence for a subset of heads. The attention computation that follows is completely standard — it is not a custom distributed attention, not a ring-attention variant, not a fused communication-attention kernel. It is simply the standard multi-head attention where each head independently computes the softmax dot-product, exactly as it would in single-GPU training, except with fewer heads per GPU.
This modularity means that any attention implementation that accepts standard Q, K, V tensors can be substituted into the gap between the two all-to-alls. The paper explicitly lists the supported variants: "self-attention, cross-attention, causal attention in both their dense and sparse counterparts, and their various optimized kernels that support long-sequence at local attention level such as different versions of FlashAttention" (Section 3.4).
How this works concretely for different attention types:
-
Dense attention: The standard softmax dot-product attention from Vaswani et al. (2017). Each GPU computes it on its
$h/P$heads. No modifications needed. -
Sparse attention (e.g., block-sparse, local sliding window, BigBird, Longformer): The attention mask or sparsity pattern is applied locally on each GPU. Because each GPU has the full sequence, it can construct the full sparsity pattern for its heads. The all-to-all does not interfere with the sparsity structure — the communication happens before the attention mask is applied, so the attention kernel sees the standard full-sequence layout.
-
FlashAttention (v1 and v2): FlashAttention is a tiled, IO-aware exact attention implementation that avoids materializing the full
$N \times N$attention matrix. It expects standard Q, K, V tensors and a causal mask (if applicable). Because DeepSpeed-Ulysses's all-to-all provides exactly those standard tensors, FlashAttention can be used as a drop-in replacement for the attention computation on each GPU. The paper states this explicitly: "it works with efficient attention implementations such as FlashAttention v2." -
Causal attention (autoregressive / decoder-only): The causal mask ensures each position attends only to previous positions. This mask is applied per-head and is independent across heads, so it works without modification on each GPU's head subset.
Contrast with the alternatives. In ColAI-SP, the attention computation is fundamentally restructured into a ring-based iterative process where each GPU computes partial attention against one neighbor's K and V at a time, accumulating results. This requires a custom attention kernel that understands the ring protocol, breaking compatibility with existing optimized kernels. In Megatron-LM-SP, the allgather produces full Q, K, V on each GPU, and the attention computation is standard — but the allgather itself is an overhead that grows with $N$ independent of $P$, making the per-layer cost higher. DeepSpeed-Ulysses achieves the same "standard attention computation" property as Megatron-LM-SP but with $1/P$ the communication cost.
Limitation acknowledged by the paper. The attention-agnostic property applies to the attention computation itself but not necessarily to the communication pattern. The all-to-all is fixed; there is no mechanism for exploiting attention sparsity to reduce communication. If the attention pattern is highly sparse (e.g., each query position only attends to a small local window of key positions), it would be more communication-efficient to only exchange the needed K and V chunks rather than redistributing the full sequence. The paper does not explore communication-avoiding schemes that exploit attention sparsity — the all-to-all always moves the full $N$-length Q, K, V tensors, even when most of the $QK^T$ products would be masked out. The paper positions this as acceptable because the communication cost $4Nh/P$ is already small at large $P$, but it means that for extremely sparse attention patterns, there may be room for further optimization beyond what DeepSpeed-Ulysses provides.
3.4.6 Ease of Use, Orthogonality, and Composition with Other Parallelism Strategies
The paper makes two claims about practical deployability: that DeepSpeed-Ulysses is easy to use (requiring minimal code changes) and that it composes orthogonally with existing parallelism strategies.
The orthogonality claim. Section 2.1.2 states: "our proposed approach is orthogonal to both data parallelism and ZeRO. Our proposed approach can be used with both methods." This means that DeepSpeed-Ulysses introduces a new, independent parallel dimension that does not conflict with or replace existing parallelism dimensions. The four dimensions are:
- Data parallelism: partitions across the batch dimension. Each data-parallel group processes a different subset of the global batch.
- Tensor parallelism: partitions individual weight matrices (and thus computation) within a layer across the hidden dimension. Multiple GPUs collaborate to compute a single layer's output for one batch element.
- Pipeline parallelism: partitions across layers. Different GPUs own different Transformer layers, and activations are passed between them in a micro-batch pipeline.
- Sequence parallelism (DeepSpeed-Ulysses): partitions across the sequence dimension within a layer's attention block, using all-to-all to convert between sequence-partitioned and head-partitioned layouts.
These four dimensions are orthogonal in the sense that they partition different axes of the computation and can be combined multiplicatively. For example, a training run could use 8-way data parallelism, 4-way tensor parallelism, 2-way pipeline parallelism, and 4-way sequence parallelism, for a total of $8 \times 4 \times 2 \times 4 = 256$ GPUs. Each dimension addresses a different constraint: data parallelism handles batch size, tensor parallelism handles very large hidden dimensions that don't fit on one GPU, pipeline parallelism handles very deep models whose layers exceed one GPU's memory, and sequence parallelism handles long sequences whose activations exceed one GPU's memory.
Why this orthogonality is important. Before DeepSpeed-Ulysses, the parallel dimensions were three (data, tensor, pipeline). The sequence dimension was either not parallelized (limiting sequence length to what fits on one GPU) or handled by Megatron-LM-SP, which is coupled to tensor parallelism and thus not orthogonal — you cannot use Megatron-LM-SP without also using Megatron's tensor parallelism. This coupling restricts deployment flexibility: a model that is small enough to fit on one GPU without tensor parallelism but that needs long sequence support cannot use Megatron-LM-SP (because there's no tensor parallelism to attach it to) but can use DeepSpeed-Ulysses. Conversely, a model that uses a non-Megatron tensor parallelism implementation (or pipeline parallelism without tensor parallelism) can still use DeepSpeed-Ulysses for sequence parallelism.
Composition with ZeRO-3 (already discussed in 3.4.4). The key composition point is that sequence parallelism and data parallelism jointly define the ZeRO-3 partition group. The paper explicitly extends ZeRO-3 to work across the combined $D \times P$ group, which is a design choice that improves memory efficiency compared to running ZeRO-3 only within the data-parallel group and treating sequence-parallel GPUs as having redundant model states.
Ease of use claim. The paper states that DeepSpeed-Ulysses is "Easy-to-use and portable, requiring minimal code changes to the existing training frameworks" (Section 1). The paper does not provide a detailed code diff or specify exactly which training frameworks are supported, but the claim follows from the modular design: the all-to-all sequence parallelism is implemented as a communication wrapper around the attention computation, not as a fundamental rewrite of the model. A user of a framework like PyTorch with DeepSpeed can presumably enable sequence parallelism by specifying a sequence-parallel degree in the DeepSpeed configuration and wrapping the model with the DeepSpeed engine, analogous to how ZeRO stages and tensor parallelism are configured.
The contrast case is Megatron-LM sequence parallelism, which requires adopting the full Megatron training framework (specific model definitions, specific parallelism orchestration, specific checkpoint format) — a non-trivial migration for teams not already using Megatron. ColAI-SP requires implementing a custom ring-attention module that replaces the standard attention, which is an intrusive code change to the model definition itself.
The code-change scope implied by the design. Based on the paper's description, the integration point is the attention module: the user's attention implementation is replaced (or wrapped) with a sequence-parallel attention that performs all-to-all before calling the original attention on a head subset, then all-to-all after. The Q, K, V linear projections and the MLP are unchanged (they already operate on the sequence-partitioned layout). The layer norm and residual connections are also unchanged since they are per-sequence-position operations (or operate across the hidden dimension, which is not partitioned by sequence parallelism).
The batch size interaction (practical workflow benefit). The paper describes a concrete scenario in Section 2.1.2 where sequence parallelism solves a batch-size scaling problem. Consider a pretraining setup on 1024 GPUs with data parallelism only: sequence length 8K, micro-batch size 1 per GPU, global batch size 8M tokens. Increasing sequence length to 32K would increase the global batch size to 32M tokens (quadrupling it), which may harm model convergence (the paper cites Keskar et al., 2016). With sequence parallelism (e.g., 4-way), each GPU still processes 8K tokens (32K / 4), the global batch size stays at 8M tokens, and the model sees full 32K-token sequences. The paper frames this as a system optimization that "require[s] no laborious hyperparameter search" — the practitioner gets longer sequences without needing to retune learning rates, batch normalization, or other hyperparameters sensitive to batch size.
3.4.7 Design Decision Summary
The paper's design makes several concrete choices, each with an explicit or implied justification:
-
All-to-all rather than allgather/reduce-scatter: all-to-all has per-link volume
$M/P$rather than$M$, enabling communication cost to decrease with parallelism degree. This is the single most important design choice and the source of the$O(N/P)$scaling advantage. -
Head partitioning rather than sequence partitioning at the attention boundary: partitioning heads (each GPU gets full sequence for
$h/P$heads) rather than keeping the sequence partitioned and coordinating attention across devices (the ColAI-SP approach). This enables completely local, unmodified attention computation with no cross-device communication during the attention operation itself. The tradeoff is that each GPU must hold the full sequence for its heads (memory$O(Nbd/P)$), but since$N$can be large this is still potentially memory-intensive. For extremely large$N$, the$N \times (d/P)$activation on each GPU could exceed memory, at which point the head partition size would need to be reduced (increasing$P$further) or alternative attention implementations (e.g., FlashAttention) that avoid materializing the full attention matrix would be needed. -
Two all-to-alls per layer (one before, one after attention): this cleanly separates communication from computation, making the attention module a drop-in component. The cost is doubling the communication relative to a hypothetical fused attention-communication kernel, but the modularity benefit — supporting any attention variant — is judged to outweigh this.
-
ZeRO-3 integration across combined data-parallel and sequence-parallel groups: this maximizes parameter memory savings (factor of
$D \times P$rather than just$D$) without introducing additional communication beyond what ZeRO-3 already requires. The downside is that allgather and reduce-scatter operations for ZeRO-3 now span a larger group, which could increase latency. The paper does not quantify this tradeoff. -
No communication-computation overlap optimization described: the paper does not discuss whether the all-to-alls can be overlapped with the Q, K, V projection computation (before attention) or with the MLP computation (after attention). On GPUs with sufficient compute and copy engines, overlapping the all-to-all communication with the linear projections would hide some of the communication latency. The paper's focus on communication volume rather than latency suggests they consider volume the primary bottleneck at scale (many GPUs, large messages), where bandwidth rather than latency dominates all-to-all cost.
-
No sparse-communication optimization for sparse attention patterns: the all-to-all always redistributes the full Q, K, V tensors regardless of attention sparsity. This is a deliberate simplicity choice — the paper prioritizes generality over the potential communication savings from pattern-aware data exchange. For the sparse attention experiments in Section 4.3, the sparse pattern is applied locally after the full all-to-all, not used to reduce communication.
4. Key Insights and Innovations
Innovation 1: Reframing Sequence Parallelism as a Layout Transformation Problem with a Communication Primitive That Inverts the Scaling Relationship
The dominant assumption in prior sequence parallelism work was that making attention global over distributed sequences requires either gathering all data to every device (Megatron-LM-SP's allgather approach) or iteratively passing partial data around a ring until every device has seen everything (ColAI-SP's ring self-attention). In both cases, the communication cost is fundamentally tied to the full sequence length — each GPU must either receive the full K and V from all other GPUs (allgather) or sequentially receive K and V chunks from every neighbor (ring). Adding more GPUs does not reduce per-device communication; it may even increase it due to more participants in the collective.
DeepSpeed-Ulysses makes a conceptual move that changes the scaling physics of the problem. Rather than asking "how do we give every GPU access to all the data?" (which necessitates moving the full dataset to every device), it asks "how do we reorganize the data so that each GPU has a different, self-contained subset of the computation?" The answer exploits a structural property of multi-head attention that was always true but had not been leveraged for communication reduction: attention heads are independent. By using an all-to-all collective to swap the partitioned dimension — from sequence to heads — the system transforms the distributed problem from "every GPU needs the full sequence" to "every GPU needs the full sequence for only a fraction of the heads."
The intellectual shift is from data replication (gather everything everywhere) to data reorganization (each GPU gets a different slice, and the slices are chosen so that local computation is sufficient). This is not merely a different implementation; it changes the communication complexity class. The allgather approach has per-link volume of M regardless of P (every GPU receives the full dataset). The all-to-all approach has per-link volume of M/P — inversely proportional to parallelism degree. The consequence, which the paper formalizes in Section 3.2, is that DeepSpeed-Ulysses achieves O(N/P) communication complexity while prior methods are O(N).
This is a fundamental rather than incremental advance because it changes the asymptotic scaling relationship between problem size and communication cost. When sequence length N and GPU count P are increased proportionally — exactly the regime needed for extreme-scale long-sequence training — DeepSpeed-Ulysses maintains constant per-device communication volume, while Megatron-LM-SP's per-device volume grows linearly with N. The evidence for this claim is both theoretical (the communication analysis in Section 3.2 deriving 4Nh/P vs. 4Nh per-layer per-link volume) and empirical: Table 3 shows that when sequence length doubles from 65,536 to 131,072 and GPU count doubles from 64 to 128, throughput drops only from 161.4 to 157.4 TFLOPs/GPU (a 2.5% degradation), consistent with near-constant communication overhead. The million-token experiment in Figure 3 — which Megatron-LM-SP cannot run at all — is a direct consequence of this scaling property.
The innovation here is not the all-to-all primitive itself (which is a standard MPI/NCCL collective) but the recognition that an all-to-all can serve as a dimension swapper — converting a sequence-partitioned layout to a head-partitioned layout and back — and that doing so yields a fundamentally better scaling law than the gather-based approach that the field had settled on. The paper's contribution to architectural thinking about distributed training is the insight that when a computation has independent sub-components (heads), you can partition along the dependency axis rather than the data axis, and the communication cost shifts from "everyone gets everything" to "everyone gets a different fraction."
Innovation 2: Establishing a Unified Architecture That Simultaneously Optimizes Activation Memory, Parameter Memory, and Communication Efficiency
Prior sequence parallelism work forced practitioners into a tradeoff between memory efficiency and communication efficiency — or between activation memory and parameter memory. Megatron-LM-SP provides activation memory reduction (by partitioning the sequence) but is tightly coupled to tensor parallelism, which limits ZeRO integration for parameter memory savings and incurs O(N) communication regardless of GPU count. ColAI-SP provides activation memory reduction but offers no parameter memory optimization and also incurs O(N) communication. ZeRO-3 provides parameter memory reduction but does nothing for activation memory, leaving sequence length bounded by per-GPU activation capacity.
DeepSpeed-Ulysses is the first sequence parallelism approach that simultaneously addresses all three resource constraints — activation memory, parameter memory, and communication bandwidth — without forcing a compromise among them. The mechanism, described in Section 3.4.4 and Section 3.3, combines sequence partitioning (activation memory reduction by factor P) with ZeRO-3 partitioning across the combined data-parallel and sequence-parallel group (parameter memory reduction by factor D × P) while using all-to-all for communication (per-link bandwidth reduction by factor P relative to allgather-based methods).
What makes this a conceptual innovation rather than just "we combined existing techniques" is the recognition that the sequence-parallel dimension can also serve as a parameter-parallel dimension. In standard ZeRO-3, parameter partitioning happens within the data-parallel group only; sequence-parallel GPUs processing different parts of the same sequence would traditionally hold redundant parameter copies (since they're working on the same data sample, just different sequence positions). The paper's insight is that these sequence-parallel GPUs do not need redundant parameters — they compute different operations (different attention heads) on the same sequence, so their parameter usage is different enough that ZeRO-3 partitioning can safely extend across the combined group. This is a subtle but important architectural insight: sequence parallelism changes which parameters each GPU actually needs during the forward/backward pass, and a memory optimizer can exploit this to partition more aggressively.
The unified nature of this solution is what distinguishes it. The paper demonstrates in Figures 4–7 that DeepSpeed-Ulysses runs longer sequences than Megatron-LM-SP across both 7B and 30B model scales, for both dense and sparse attention — and the gap widens at larger model sizes because Megatron-LM-SP's lack of ZeRO integration means parameter memory becomes the bottleneck. Table 1 formalizes this by showing that DeepSpeed-Ulysses is the only method with checkmarks in all three columns (activation memory efficiency, parameter memory efficiency, communication complexity better than O(N)). The paper thus contributes not just a new parallelism strategy but a reference architecture for how activation, parameter, and communication optimizations can co-exist without mutual interference — something prior work had implicitly assumed was impossible given the coupling between Megatron-LM-SP and tensor parallelism.
Innovation 3: Modular, Attention-Agnostic Design as a First-Class System Property
It is one thing to build a sequence parallelism scheme that works. It is another to build one that works with any attention implementation — dense, sparse, FlashAttention, causal, cross-attention — without modification. The paper treats attention agnosticism not as an afterthought but as a core design constraint, and the resulting architecture (all-to-all → arbitrary attention → all-to-all, described in Section 3.4.5) is conceptually distinct from prior approaches that baked their communication pattern into the attention computation itself.
The field's default pattern for distributed attention had been to modify the attention kernel to incorporate communication. ColAI-SP's ring self-attention requires the attention computation to interleave with ring send/receive operations — attention is not a separate module but a distributed protocol. Megatron-LM-SP's approach is less invasive (the attention computation sees gathered tensors and is standard), but the gathering is an overhead that the attention implementation must tolerate — and the whole stack is monolithic within the Megatron ecosystem, so swapping attention implementations requires navigating Megatron's internal abstractions.
DeepSpeed-Ulysses inverts this: rather than modifying attention to be distributed, it makes the environment distributed and leaves attention untouched. The all-to-alls are pre- and post-processing steps that transform the tensor layout; the attention module between them is a black box that receives standard-shaped tensors and produces standard-shaped outputs. This is a conceptual shift from "distributed attention" to "attention in a distributed environment" — a seemingly subtle distinction with major practical consequences.
The intellectual contribution is the recognition that communication and computation can be fully decoupled in sequence parallelism if the partitioning axis is chosen correctly. By partitioning heads rather than sequences at the attention boundary, the computation becomes embarrassingly parallel (heads don't interact), and communication becomes a pure data movement problem that can be solved with standard collectives. This decoupling means that any advance in attention implementation — FlashAttention v2, block-sparse patterns, locality-sensitive hashing, linear attention approximations — immediately works with DeepSpeed-Ulysses without any modification to the parallelism layer. Conversely, improvements to the communication layer (better all-to-all algorithms, topology-aware scheduling) benefit all attention types uniformly.
The evidence that this matters is both the paper's explicit support for multiple attention types (Sections 4.2 and 4.3 evaluate both dense and blocked sparse attention, and Section 1 lists FlashAttention v2 support) and the contrast with ColAI-SP, which the paper notes "requires a different (specific) kind of attention" and whose generalization to other attention types is unclear (Table 1, Section 2.2). The attention-agnostic property is what makes DeepSpeed-Ulysses a platform for long-sequence training rather than a point solution for a specific attention variant — it establishes a separation of concerns that future work on both attention algorithms and communication optimization can independently build upon.
Innovation 4: Identifying the Sequence-Dimension Gap in the Parallelism Taxonomy and Filling It with an Orthogonal, Composable Primitive
Before this paper, the standard taxonomy of parallelism for LLM training had settled around "3D parallelism": data, tensor, and pipeline. This taxonomy implicitly suggested completeness — three dimensions, three strategies, all bases covered. The paper's first conceptual contribution is diagnostic: it identifies a missing fourth dimension (sequence length) that the standard taxonomy cannot address, and it argues convincingly that this gap is not academic but a practical blocker for emerging applications.
The diagnostic move is in Section 2.1.2 and the surrounding discussion. The paper observes that data parallelism handles batch size, tensor parallelism handles hidden dimension, and pipeline parallelism handles depth — but none of these touch sequence length. The fact that the sequence dimension had been neglected is not an accident; it reflects the historical reality that sequence lengths were modest (hundreds to low thousands of tokens) and other bottlenecks (model size, batch size) dominated. But the paper argues that application requirements have shifted (genomics at billions of tokens, multimodal at millions of tokens, long-document tasks at hundreds of thousands of words), making sequence length a first-class scaling dimension that demands its own parallelism strategy.
Having identified the gap, the paper's constructive contribution is to fill it with a primitive that is orthogonal to the existing three dimensions. DeepSpeed-Ulysses sequence parallelism can be combined multiplicatively with data, tensor, and pipeline parallelism without conflict because it partitions along a different axis (sequence vs. batch vs. hidden vs. depth). This orthogonality claim is substantiated by the fact that the paper evaluates DeepSpeed-Ulysses jointly with ZeRO-3 (a data-parallel optimization) and positions it as compatible with tensor and pipeline parallelism (Section 2.1.2). The result is a 4D parallelism framework that treats sequence length as a first-class scaling dimension alongside the established three.
This is a conceptual innovation because it completes the parallelism taxonomy in a way that is both principled (there are four dimensions to a Transformer computation, and each should have a dedicated strategy) and practical (the addition is non-disruptive — existing 3D setups can add sequence parallelism without redesigning their parallelism strategy). Prior sequence parallelism attempts (Megatron-LM-SP, ColAI-SP) failed to achieve this status because they were not orthogonal: Megatron-LM-SP is coupled to tensor parallelism, and ColAI-SP is monolithic (ring-attention is the whole strategy). DeepSpeed-Ulysses is the first sequence parallelism approach that behaves like a composable building block — you can add it to an existing parallelism stack the same way you'd add another data-parallel dimension.
The significance goes beyond this paper's specific implementation. By establishing that sequence parallelism can be orthogonal and composable, the paper sets a standard for what future sequence parallelism approaches should aspire to: they should integrate with existing strategies rather than replace them, and they should partition a dimension that the other strategies leave untouched. This conceptual clarity — there are four dimensions, each needs a strategy, and the strategies should compose — is a lasting contribution to how systems researchers think about parallelism for Transformer training.
5. Experimental Analysis
Evaluation Methodology
-
Dataset. The paper does not use a traditional dataset in the sense of a benchmark with accuracy metrics. Instead, it evaluates the throughput and scalability of training Transformer models (GPT architecture) at various sequence lengths and model sizes. The evaluation measures system performance — tokens processed per second, TFLOPs achieved, memory consumption — rather than model quality on a downstream task. The "dataset" is synthesized training data at the specified sequence lengths, consistent with standard LLM pretraining evaluation methodology where synthetic or real training corpora are used interchangeably for throughput measurements.
-
Base model(s). The paper uses GPT (Radford et al., 2019) at three scales: 1.2 billion, 7 billion, and 30 billion parameters. The 1.2B model is used for sequence length scalability experiments (Figure 3) and convergence studies (Figure 8). The 7B and 30B models are used for dense and sparse attention throughput comparisons against Megatron-LM (Figures 4–7) and parallel scaling studies (Tables 2–3). The choice of GPT is motivated by its status as "a foundation model for many NLP tasks" (Section 4) and its architectural representativeness — it uses standard multi-head self-attention and MLP blocks, making it a valid proxy for the Transformer-based LLMs that the paper targets.
-
Metrics. The paper measures three categories of system performance:
- Throughput (TFLOPs/GPU): Sustained floating-point operations per second per GPU, computed from the model's FLOPs per iteration and the measured iteration time. This is the primary efficiency metric and is reported as both absolute TFLOPs and as a percentage of hardware peak (the A100's 312 TFLOPs theoretical peak for FP16). The paper reports achieving "over 175 TFLOPs/GPU (over 54% of hardware peak)" (Abstract, Section 1).
- Iteration time (milliseconds): Wall-clock time per training iteration, reported in Tables 2 and 3 for the parallel scaling studies.
- Sequence length scalability: The maximum sequence length trainable at a given GPU count, reported qualitatively (e.g., "over a million tokens" in Figure 3) and comparatively (e.g., "4× longer sequence length than Megatron-LM" in Figures 4–7).
- Training loss convergence: Per-step training loss curves (Figure 8) to validate that DeepSpeed-Ulysses does not alter model training dynamics compared to baseline training approaches.
-
Baselines. The paper compares against two primary baselines:
- Megatron-LM sequence parallelism (Korthikanti et al., 2022): The SOTA baseline for sequence parallelism at the time of writing, which uses allgather and reduce-scatter collectives to aggregate Q, K, V projections for attention computation, tightly integrated with Megatron's tensor parallelism.
- DeepSpeed-Ulysses with different ZeRO stages (for the convergence study only, Figure 8): ZeRO-1, ZeRO-2, and ZeRO-3 are compared to validate that sequence parallelism does not affect training convergence regardless of which memory optimization stage is used.
The paper does not compare against ColAI-SP (Li et al., 2022b) in the experimental evaluation, despite discussing it as a related method in Section 2.2 and Table 1. The evaluation is exclusively a head-to-head comparison with Megatron-LM sequence parallelism.
-
Generation budget / compute accounting. The paper measures compute in terms of GPU count (32, 64, 128, or 256 A100 GPUs) and sequence length (ranging from 8K to over 1M tokens). There is no "generation budget" in the sense used by inference-time scaling papers — this is a pure training throughput evaluation. Fair comparison against Megatron-LM is achieved by:
- Using the same GPU count and GPU type (A100) for both systems.
- Optimizing the configuration (sequence parallelism degree, micro-batch size) for each system independently, selecting "the sequence parallelism degree and micro-batch size that produced the best performance (measured as throughput or TFLOPs) for both DeepSpeed sequence parallelism and Megatron-LM" (Section 4.2). This ensures each system is evaluated at its own best configuration rather than forcing one system into the other's optimal settings.
- For DeepSpeed-Ulysses, always using ZeRO-3 with parallelism degrees of 32 (for 7B) and 64 (for 30B) across the combined data-parallel and sequence-parallel groups.
- For Megatron-LM, the paper does not specify the tensor parallelism degree used, but notes that Megatron-LM sequence parallelism is "tightly integrated with Megatron tensor parallelism" (Section 2.2), implying that the comparison is against Megatron's standard recommended configuration.
-
Cross-validation / statistical protocol. The paper does not report cross-validation or statistical significance testing. This is standard for systems papers evaluating throughput — iteration times are measured over multiple training steps (typically hundreds) and the reported throughput is a steady-state average once GPU warm-up is complete. The convergence study (Figure 8) shows per-step training loss curves, which implicitly capture run-to-run variation through the loss trajectory, but no error bars or standard deviations are reported.
Main Quantitative Results
Sequence Length Strong Scaling (1.2B Model)
The headline result from Figure 3 is that DeepSpeed-Ulysses enables training with over one million tokens in sequence length on a 1.2B parameter GPT model, with sequence length scaling linearly with GPU count while maintaining similar throughput.
Figure 3 plots the relationship between sequence length and GPU count across configurations ranging from 8 GPUs with 32K-token sequences to 256 GPUs with approximately 1M-token sequences. The paper states: "DeepSpeed sequence parallelism allows increasing sequence length linearly with the number of GPUs and sequence length scales linearly relative to and maintains similar computation throughput across different sequence length at appropriate GPU count" (Section 4.1).
The specific data points shown in Figure 3 (read approximately from the figure):
- 8 GPUs support 32,768 tokens
- 32 GPUs support 131,072 tokens (4× increase in GPUs, 4× increase in sequence length)
- 64 GPUs support 262,144 tokens (2× increase in GPUs, 2× increase in sequence length)
- 256 GPUs support over 1,048,576 tokens (4× increase in GPUs, 4× increase in sequence length)
This linear scaling of sequence length with GPU count is the empirical validation of the theoretical O(N/P) communication complexity claim from Section 3.2 — if per-device communication volume stays constant when N and P scale proportionally (as the theory predicts), then throughput should remain approximately constant, which is what Figure 3 demonstrates.
Critically, Megatron-LM does not appear in Figure 3 — there is no Megatron-LM data point at any of these sequence lengths, strongly implying that Megatron-LM sequence parallelism cannot run at these extreme lengths (consistent with the paper's claim that its O(N) communication makes it impractical for million-token regimes). The paper does not explicitly state this negative result, but the absence of Megatron-LM from the strong scaling plot is itself a significant comparative finding.
Dense Attention Throughput: 7B Model, 32 GPUs
Figure 4 compares DeepSpeed-Ulysses against Megatron-LM sequence parallelism on a 7B parameter GPT model with dense attention, running on 32 A100 GPUs, across sequence lengths from 8K to 128K tokens.
The paper states: "DeepSpeed sequence parallelism consistently outperforms Megatron-LM for the sequence length that can be run with both. In addition, DeepSpeed sequence parallelism can run longer sequence than Megatron-LM" (Section 4.2).
Key observations from Figure 4:
- At 8K sequence length: DeepSpeed-Ulysses achieves approximately 155 TFLOPs/GPU, while Megatron-LM achieves approximately 140 TFLOPs/GPU — a roughly 10.7% throughput advantage.
- At 16K sequence length: DeepSpeed-Ulysses sustains approximately 160 TFLOPs/GPU, while Megatron-LM drops to approximately 120 TFLOPs/GPU — the gap widens to approximately 33%.
- At 32K sequence length: DeepSpeed-Ulysses maintains approximately 160 TFLOPs/GPU, Megatron-LM drops further to approximately 105 TFLOPs/GPU — a roughly 52% advantage.
- At 64K sequence length: DeepSpeed-Ulysses achieves approximately 150 TFLOPs/GPU. Megatron-LM has no data point — it cannot run at this sequence length on 32 GPUs.
- At 128K sequence length: DeepSpeed-Ulysses achieves approximately 130 TFLOPs/GPU, operating at roughly 41.7% of the A100's 312 TFLOPs peak. Megatron-LM again has no data point.
The paper attributes DeepSpeed-Ulysses's performance advantages to two factors: "(1) DeepSpeed sequence parallelism in combination with ZeRO-3 fits more samples than Megatron-LM because of the memory optimization leading to higher throughput (2) DeepSpeed sequence parallelism benefits from efficient all-to-all communication relative to all-gather communication as applied in Megatron-LM sequence parallelism" (Section 4.2).
The first factor requires interpretation: "fits more samples" means that ZeRO-3's parameter partitioning reduces per-GPU memory usage, allowing a larger micro-batch size or eliminating the need for activation checkpointing/recomputation, both of which increase throughput by improving GPU utilization. Megatron-LM's tight coupling to tensor parallelism means it cannot use ZeRO-3 to the same degree, so it has less memory available for activations or larger micro-batches at a given sequence length.
The second factor is the direct communication advantage: the all-to-all's per-link volume of 4Nh/P versus Megatron-LM's allgather/reduce-scatter volume of 4Nh (independent of P). At P=32, this is a 32× reduction in per-link communication volume for DeepSpeed-Ulysses relative to Megatron-LM.
The widening gap as sequence length increases (from 10.7% at 8K to 52% at 32K) is consistent with Megatron-LM becoming increasingly communication-bound as N grows (its per-link volume scales as 4Nh, linear in N) while DeepSpeed-Ulysses's per-link volume as a fraction of total workload may decrease due to the quadratic attention computation dominating.
Dense Attention Throughput: 30B Model, 64 GPUs
Figure 5 replicates the dense attention comparison at larger scale: 30B parameter GPT, 64 A100 GPUs, sequence lengths from 2K to 128K tokens.
Key observations from Figure 5:
- DeepSpeed-Ulysses runs all sequence lengths from 2K through 128K tokens.
- Megatron-LM has data points only up to approximately 32K tokens — beyond that, it cannot run on 64 GPUs due to memory or communication constraints.
- At sequence lengths where both run (8K–32K), DeepSpeed-Ulysses shows throughput approximately 1.5–2.0× higher than Megatron-LM (exact numbers difficult to read from the bar chart but the visual gap is substantial).
- At 128K tokens, DeepSpeed-Ulysses achieves throughput in the range of approximately 120–140 TFLOPs/GPU (depending on the configuration; the exact value requires reading the bar chart).
The comparative pattern is consistent with the 7B results: DeepSpeed-Ulysses sustains higher throughput at every sequence length where both systems run, and it extends to sequence lengths (64K, 128K) that Megatron-LM cannot handle. The paper emphasizes this: "DeepSpeed sequence parallelism performance advantages are two folds... DeepSpeed sequence parallelism can run longer sequence than Megatron-LM" (Section 4.2).
The 30B results are particularly important because they demonstrate that the advantages scale to larger models — the ZeRO-3 integration becomes more impactful at 30B parameters (where parameter memory without ZeRO would be prohibitive), and the all-to-all communication advantage persists (the per-link volume ratio is P:1 = 64:1 at this scale).
Sparse Attention Throughput: 7B Model, 32 GPUs
Figure 6 compares DeepSpeed-Ulysses against Megatron-LM on a 7B parameter GPT model with blocked sparse attention, running on 32 A100 GPUs. Sequence lengths range from 8K to 128K tokens.
The paper states: "We observe more than 2x throughput performance of DeepSpeed sequence parallelism compared to Megatron-LM. For memory saving, DeepSpeed sequence parallelism leveraging ZeRO-3 scales to 4x longer sequence lengths than Megatron-LM" (Section 4.3).
Key observations from Figure 6:
- At sequence lengths where both run (8K–32K), DeepSpeed-Ulysses throughput exceeds 2× Megatron-LM.
- Megatron-LM cannot run beyond 32K tokens on 32 GPUs for this configuration.
- DeepSpeed-Ulysses runs up to 128K tokens — 4× the maximum sequence length Megatron-LM supports.
- DeepSpeed-Ulysses throughput at 128K tokens is approximately 80–100 TFLOPs/GPU (lower than dense attention at the same length, consistent with blocked sparse attention having lower arithmetic intensity).
The paper notes an important caveat: "the current DeepSpeed throughput is bottlenecked by the local sparse attention implementation, and as a result DeepSpeed throughput decreases as the sequence length increases" (Section 4.3). This is visible in Figure 6 as a downward trend in TFLOPs/GPU as sequence length grows. The paper attributes this to the local sparse attention kernel, not to the communication layer — suggesting that the all-to-all communication is not the bottleneck, and that optimizing the sparse attention kernel would further improve throughput at long sequences.
The paper also projects: "We expect this gap in performance between DeepSpeed and Megatron-LM to increase further for larger sequence lengths as we improve the performance of the local sparse attention implementation in future" (Section 4.3). This is a forward-looking claim that the communication advantage of DeepSpeed-Ulysses is currently under-realized because the attention computation (not communication) is the bottleneck at long sparse-attention sequence lengths.
Sparse Attention Throughput: 30B Model, 64 GPUs
Figure 7 extends the sparse attention comparison to 30B parameter GPT with blocked sparse attention on 64 A100 GPUs.
The pattern is consistent with Figure 6:
- DeepSpeed-Ulysses runs longer sequences than Megatron-LM (extending to 128K vs. Megatron-LM's maximum of approximately 32K).
- Throughput advantage of approximately 2× at sequence lengths where both run.
- DeepSpeed-Ulysses throughput degrades with increasing sequence length (visible as a downward trend), attributed to the local sparse attention kernel bottleneck.
- The gap between DeepSpeed-Ulysses and Megatron-LM widens somewhat at longer sequence lengths, consistent with Megatron-LM becoming communication-bound while DeepSpeed-Ulysses remains compute-bound (by the attention kernel, not communication).
Parallel Scaling Studies
Tables 2 and 3 present two forms of scaling analysis for a 7B dense GPT model at a fixed global batch size of 8.
Table 2: Strong scaling (fixed sequence length, increasing GPUs). Sequence length is fixed at 131,072 tokens while GPU count increases from 64 to 128 to 256.
| GPUs | Iteration Time (ms) | TFLOPs/GPU |
|---|---|---|
| 64 | 32,432.13 | 165.53 |
| 128 | 17,052.51 | 157.41 |
| 256 | 9,886.70 | 136.09 |
The paper interprets this as: "execution time decreases almost linearly as we increase the GPU count" (Section 4.4). From 64 to 128 GPUs (2×), iteration time decreases from 32,432 ms to 17,053 ms — a 1.90× speedup, close to ideal 2×. From 128 to 256 GPUs (2×), iteration time decreases to 9,887 ms — a 1.72× speedup. The sub-linear scaling at higher GPU counts is attributed to "communication overhead" (Section 4.4), visible in the TFLOPs/GPU degradation from 165.53 to 157.41 to 136.09.
This degradation (a 17.8% drop in per-GPU efficiency when scaling 4× in GPU count) is consistent with the all-to-all communication volume per GPU decreasing (since N is fixed, N/P decreases, so per-GPU communication volume 4Nh/P decreases with P), but the total number of GPUs participating in the all-to-all increases, potentially introducing latency and synchronization overhead that reduces efficiency.
Table 3: Scaled sequence length (GPU count proportional to sequence length). Sequence length and GPU count increase together: 65,536 tokens on 64 GPUs, 131,072 tokens on 128 GPUs, 262,144 tokens on 256 GPUs.
| Sequence Length | GPUs | Iteration Time (ms) | TFLOPs/GPU |
|---|---|---|---|
| 65,536 | 64 | 9,676.76 | 161.36 |
| 131,072 | 128 | 17,052.51 | 157.41 |
| 262,144 | 256 | 33,486.50 | 147.40 |
The paper notes a caveat about interpretation: this "is a form of weak scaling (not in the traditional sense) with caveat that attention computation, a function of sequence length, is quadratic in complexity. In other words, as we increase sequence length, the work increases quadratically" (Section 4.4).
In a traditional weak scaling study, problem size per GPU stays constant. Here, doubling sequence length quadruples the attention computation work (since attention is O(N^2)), while GPU count only doubles. So the per-GPU work actually increases with scale, and iteration time should increase faster than linearly. The observed iteration time scaling (9,677 ms → 17,053 ms → 33,487 ms) shows the iteration time does increase faster than linearly (the ratio from 64 to 128 GPUs is 1.76×, from 128 to 256 is 1.96×), reflecting the quadratic attention growth.
Despite this, per-GPU throughput degrades only modestly: from 161.36 to 157.41 to 147.40 TFLOPs/GPU — an 8.6% reduction when scaling sequence length 4× and GPUs 4×. The paper attributes this to "good parallel efficiency" and notes that the degradation can be "attributed to slight decrease in throughput as we increase communication workload" (Section 4.4). The fact that throughput stays above 147 TFLOPs/GPU (over 47% of hardware peak) at 256 GPUs and 262K sequence length is presented as evidence that the all-to-all communication overhead remains manageable even at substantial scale.
Convergence Study
Figure 8 shows training loss curves for a 1.3B GPT model at 32K sequence length on 8 A100 GPUs with a sequence parallelism degree of 4. The paper compares DeepSpeed-Ulysses with different ZeRO stages (ZeRO-1, ZeRO-2, ZeRO-3) against Megatron-LM sequence parallelism.
The key claim: "DeepSpeed sequence parallelism is a purely system optimization technique that enables training of long sequence Transformer model, thus there is no (negative) on quality of trained models, this assertion is validated through experiments and is shown in Figure 8" (Section 4.5).
The loss curves for DeepSpeed-Ulysses with ZeRO-1, ZeRO-2, and ZeRO-3 are essentially identical to the Megatron-LM baseline — all curves overlap closely throughout training. This validates that:
- The all-to-all communication pattern does not introduce numerical differences (e.g., due to floating-point non-associativity in different summation orders) that affect training dynamics.
- ZeRO-3's parameter partitioning and allgather/reduce-scatter operations do not affect convergence relative to ZeRO-1 or ZeRO-2 (which partition less aggressively).
- DeepSpeed-Ulysses is a "purely system optimization" with no accuracy tradeoff — the trained model is identical in quality to one trained with Megatron-LM sequence parallelism.
This is a standard validation for systems papers introducing new parallelism strategies: demonstrating that the optimization does not silently degrade model quality through numerical effects or altered optimization dynamics. The paper presents this as a sanity check rather than a novel finding.
Ablation Studies and Robustness Checks
ZeRO stage variants (Figure 8, convergence study): DeepSpeed-Ulysses is tested with ZeRO-1, ZeRO-2, and ZeRO-3 — three different memory optimization levels — to confirm that sequence parallelism does not interact adversely with any ZeRO stage. The loss curves are identical across all three ZeRO stages and match the Megatron-LM baseline, validating that the choice of ZeRO stage does not affect convergence. This is a robustness check for the ZeRO-3 integration described in Section 3.3: the aggressive parameter partitioning of ZeRO-3 (which involves additional allgather and reduce-scatter operations in the training loop) does not introduce convergence issues when combined with sequence parallelism.
Optimal configuration selection per system (Section 4.2 methodology): The paper states that for each comparison point (a specific model size, GPU count, and sequence length), it selected "the sequence parallelism degree and micro-batch size that produced the best performance (measured as throughput or TFLOPs) for both DeepSpeed sequence parallelism and Megatron-LM." This is a methodological ablation in spirit — rather than forcing both systems to use the same configuration (which might favor one over the other), each system is independently tuned to its best settings. For DeepSpeed-Ulysses, this means ZeRO-3 parallelism degrees of 32 (for 7B) and 64 (for 30B), with an unspecified sequence parallelism degree presumably chosen to maximize the micro-batch size that fits in memory. For Megatron-LM, this means the tensor parallelism and sequence parallelism degrees that produce the best throughput within Megatron's constraints.
Sparse attention bottleneck identification (Section 4.3): The paper explicitly attributes the throughput degradation at long sequence lengths in Figures 6 and 7 to "the local sparse attention implementation" rather than to DeepSpeed-Ulysses's communication layer. This is not presented as a formal ablation with a control experiment (e.g., comparing dense vs. sparse attention with identical communication patterns), but it serves as a diagnostic claim: the communication design is not the bottleneck, and further throughput improvements require optimizing the attention kernel, not the all-to-all infrastructure.
No explicit ablation of all-to-all vs. allgather with identical memory configurations: A missing ablation would be to run DeepSpeed-Ulysses with allgather-based attention (mimicking Megatron-LM's communication pattern) and ZeRO-3 to isolate the communication benefit from the memory benefit. The paper attributes DeepSpeed-Ulysses's advantage to two factors (ZeRO-3 memory efficiency AND all-to-all communication efficiency) but does not disentangle their relative contributions. The fact that DeepSpeed-Ulysses runs longer sequences than Megatron-LM (4× longer in sparse attention experiments) could be due primarily to ZeRO-3 reducing parameter memory (allowing more GPU memory for activations at long sequences), with the all-to-all communication advantage being secondary. Without an ablation that uses allgather communication with ZeRO-3, the relative importance of the two factors cannot be determined from the reported experiments.
No ablation of sequence parallelism degree: The paper chooses the optimal sequence parallelism degree per configuration but does not report sensitivity to this choice. How does throughput change as sequence parallelism degree varies for a fixed sequence length and GPU count? Is there a sweet spot balancing communication overhead (more sequence-parallel GPUs means more all-to-all participants, potentially increasing latency) against memory benefits (more sequence-parallel GPUs means smaller per-GPU sequence chunks, freeing memory for larger micro-batches)? This information would be practically useful for practitioners tuning their deployments.
No comparison against ColAI-SP: Despite discussing ColAI-SP in Section 2.2 and Table 1 as a competing sequence parallelism approach, the paper provides no experimental comparison with it. The claims about ColAI-SP's communication inefficiency, limited attention support, and usability are entirely theoretical. This is a significant omission, especially since ColAI-SP is the only other sequence parallelism method besides Megatron-LM-SP that the paper identifies.
No reporting of memory consumption: The paper claims memory efficiency advantages but reports no memory measurements. How much GPU memory does DeepSpeed-Ulysses consume per sequence length vs. Megatron-LM? What is the maximum micro-batch size each system can support at a given sequence length? Without memory data, the claim that "DeepSpeed sequence parallelism in combination with ZeRO-3 fits more samples than Megatron-LM because of the memory optimization" (Section 4.2) is supported only indirectly (higher throughput could result from larger micro-batches, but could also result from lower communication overhead alone). Memory breakdowns would substantially strengthen the paper's claims.
Limited scale range for the convergence study: The convergence study (Figure 8) uses a 1.3B model at 32K sequence length on only 8 GPUs — a relatively small-scale configuration. Whether the convergence properties hold at the extreme scales claimed elsewhere (30B models, 1M-token sequences, 256 GPUs) is not validated. While it is standard for systems papers to demonstrate convergence at a representative scale and argue (reasonably) that it generalizes, the million-token regime might introduce numerical stability issues not present at 32K tokens (e.g., softmax normalization over very large attention scores).
Critical Assessment
The experimental evaluation in this paper serves a specific purpose: to demonstrate that DeepSpeed-Ulysses achieves higher throughput and supports longer sequences than the existing SOTA (Megatron-LM sequence parallelism). The experiments largely succeed at this narrow goal, but several important limitations affect how strongly the paper's broader claims are supported.
Claim from the executive summary: DeepSpeed-Ulysses trains 2.5× faster and 4× longer sequences than existing SOTA.
The "2.5× faster" figure appears in the abstract and Section 1 but is not precisely pinned to a specific configuration in the main experimental sections. Reading Figures 4–7, the throughput advantage over Megatron-LM varies substantially with configuration: at 7B dense, 32K sequence length, the advantage is roughly 52% (160 vs. 105 TFLOPs/GPU, Figure 4); at 7B sparse, the advantage exceeds 2× (Figure 6). The 2.5× figure likely comes from a specific favorable configuration, possibly the sparse attention experiments where the gap is largest. The paper would be stronger if it specified exactly which configuration achieves 2.5× and what the minimum, maximum, and average speedups are across all tested configurations.
The "4× longer sequence length" claim is more directly supported: in the sparse attention experiments (Figures 6 and 7), DeepSpeed-Ulysses runs 128K-token sequences while Megatron-LM cannot run beyond 32K — a 4× improvement. In the dense attention experiments (Figures 4 and 5), DeepSpeed-Ulysses runs 128K while Megatron-LM is limited to 32K–64K depending on model size — a 2–4× improvement. The strongest single data point is Figure 3, where DeepSpeed-Ulysses reaches over 1M tokens (256 GPUs), while Megatron-LM has no data point at any of these extreme lengths. The "4×" claim is conservative and well-supported.
Claim from the executive summary: sustains over 175 TFLOPs/GPU (over 54% of hardware peak).
The 175 TFLOPs/GPU figure appears in the abstract and Section 1 but is not directly visible in the main body's figures or tables. Table 2 shows a maximum of 165.53 TFLOPs/GPU (64 GPUs, 131K sequence length). Table 3 shows a maximum of 161.36 TFLOPs/GPU. Figure 4 shows peaks around 160 TFLOPs/GPU for dense attention. The 175 value may come from a configuration not shown in the main evaluation (perhaps a smaller model or different sequence length not plotted in the bar charts). The abstract's claim is thus slightly stronger than what the figures in the main body directly support — a reader would need to trust that the 175 figure exists somewhere in the experimental space, possibly at a configuration optimized specifically for peak TFLOPs rather than for the comparative evaluation against Megatron-LM.
Claim from the executive summary: enables training with over a million tokens in sequence length.
Figure 3 directly supports this, showing the 256-GPU configuration with a sequence length point at approximately 1,048,576 tokens. The million-token milestone is a headline result that depends on having 256 A100 GPUs available — it is a demonstration of scalability rather than a claim that million-token training is practical on smaller clusters. The paper appropriately presents this as a scaling limit demonstration.
What the experiments demonstrate vs. what they leave untested:
The experiments provide strong evidence for two specific advantages over Megatron-LM sequence parallelism: (1) DeepSpeed-Ulysses achieves higher throughput at any sequence length where both systems can run, and (2) DeepSpeed-Ulysses can train at sequence lengths that Megatron-LM cannot run at all. The evidence for both is consistent across two model sizes (7B, 30B), two attention types (dense, sparse), and multiple sequence lengths.
However, the experiments do not directly test several claims that are central to the paper's theoretical contributions:
-
The
O(N/P)vs.O(N)communication claim is not isolated. The paper attributes DeepSpeed-Ulysses's advantage to both all-to-all communication AND ZeRO-3 memory efficiency, but the experiments do not include an ablation that separates these factors. Without a comparison where Megatron-LM is given equivalent memory optimization (e.g., by integrating ZeRO-3 with Megatron's parallelism stack, or by comparing at sequence lengths short enough that memory is not the bottleneck), we cannot determine how much of the throughput gap is due to communication efficiency vs. memory efficiency. This matters for the paper's central theoretical claim: if most of the advantage comes from ZeRO-3 fitting larger micro-batches rather than from the all-to-all's better scaling properties, then theO(N/P)analysis, while correct, is not the primary driver of the empirical results. -
The claim that communication volume is constant when
NandPscale proportionally is validated only indirectly. Table 3 shows that throughput degrades modestly (161.4 → 157.4 → 147.4 TFLOPs/GPU) whenNandPboth scale 4×. This is consistent with near-constant communication overhead, but the degradation could also reflect the quadratic attention workload growing faster than the linear increase in GPU count (as the paper itself notes). A direct communication volume measurement — or a breakdown of time spent in all-to-all collectives vs. computation — would more directly validate the constant-communication claim. -
Attention agnosticism is demonstrated but not compared against a non-agnostic baseline. The paper shows DeepSpeed-Ulysses working with both dense and blocked sparse attention (Figures 4–7), which demonstrates that the system supports multiple attention types. However, since Megatron-LM also supports both dense and sparse attention (it has data points in both sets of figures), the comparison does not highlight attention agnosticism as a differentiating advantage. A stronger demonstration would be to integrate an attention variant that ColAI-SP or Megatron-LM cannot easily support (e.g., FlashAttention v2, which the paper claims compatibility with) and show throughput improvements specifically attributable to the ability to use an optimized kernel.
-
The ease-of-use and portability claims are entirely unevaluated. The paper claims "minimal code changes" but provides no code diff, no lines-of-code comparison, and no user study or migration experience report. This is a significant gap for a systems paper that includes ease of use as one of its five headline contributions.
Missing baselines and experiments that would strengthen the paper:
-
Comparison against ColAI-SP. The paper discusses ColAI-SP extensively in Section 2.2 and positions DeepSpeed-Ulysses as superior in Table 1, but never runs the comparison. Even a limited comparison (e.g., on a single model size and sequence length) would substantiate the theoretical claims about ColAI-SP's communication inefficiency and attention limitations.
-
Communication time breakdown. Reporting the fraction of iteration time spent in all-to-all collectives would directly validate the claim that communication is not the bottleneck and that the all-to-all design is the key enabler. Without this, the reader must infer communication overhead from the TFLOPs degradation in Tables 2–3, which is confounded by workload imbalance.
-
Memory consumption data. Reporting per-GPU memory usage (total, activation, parameter, optimizer state) for each configuration would clarify how much of the throughput advantage comes from ZeRO-3 enabling larger micro-batches vs. from all-to-all communication efficiency. This is particularly important for the 30B experiments, where parameter memory is a first-order constraint.
-
Scaling to more than 256 GPUs. The million-token result uses 256 GPUs, which is the maximum tested. Whether the scaling continues to more GPUs (e.g., 512, 1024) and proportionally longer sequences (2M, 4M tokens) is unaddressed. The all-to-all collective's latency and synchronization overhead may become limiting at larger
P, but the paper does not explore this boundary. -
Comparison at identical micro-batch sizes. If DeepSpeed-Ulysses's throughput advantage is partly due to fitting larger micro-batches, comparing at identical micro-batch sizes (even if it means DeepSpeed-Ulysses under-utilizes available memory) would isolate the communication benefit. The paper's methodology of optimizing each system independently is fair for a deployment-oriented comparison but less informative for understanding the mechanism.
Conditional nature of the claims:
-
The 2.5× speedup claim holds when comparing against Megatron-LM specifically, not against an idealized baseline or against all possible sequence parallelism implementations. The advantage would likely be smaller if Megatron-LM were augmented with ZeRO-3 (though this is technically challenging due to the tensor parallelism coupling).
-
The million-token claim requires 256 A100 GPUs and applies to a 1.2B parameter model — relatively small by contemporary LLM standards. Training a 70B or 175B model at million-token sequence lengths would require substantially more GPUs even with DeepSpeed-Ulysses, and the paper does not demonstrate this combination.
-
The constant communication volume claim applies when
NandPscale proportionally, as the paper states explicitly. IfNis increased without increasingP(e.g., training on longer sequences without adding GPUs), communication volume increases linearly withN, as it does in all methods. DeepSpeed-Ulysses's advantage is specifically in the strong-scaling regime where parallelism degree grows with problem size. -
The throughput advantage over Megatron-LM widens with sequence length, meaning the paper's strongest results are at the longest sequence lengths — exactly the regime that DeepSpeed-Ulysses was designed for and where Megatron-LM's
O(N)communication becomes most damaging. At shorter sequence lengths (8K–16K), the advantage is smaller (10–50%), and at very short sequences (not tested), Megatron-LM might even be faster due to lower allgather latency compared to all-to-all for small messages.
In summary, the experimental evaluation convincingly demonstrates that DeepSpeed-Ulysses outperforms Megatron-LM sequence parallelism in throughput and maximum sequence length, with the advantage growing as sequence length increases. The experiments are methodologically sound for the narrow comparison they perform but leave several of the paper's broader claims — particularly about the relative importance of all-to-all communication vs. ZeRO-3 memory efficiency, and about ease of use — supported by theory and qualitative argument rather than direct empirical evidence.
6. Limitations and Trade-offs
6.1 The Paper Does Not Disentangle Communication Efficiency from Memory Efficiency in Its Empirical Advantage
The assumption or constraint. The paper attributes DeepSpeed-Ulysses's throughput advantage over Megatron-LM to two factors acting simultaneously: "(1) DeepSpeed sequence parallelism in combination with ZeRO-3 fits more samples than Megatron-LM because of the memory optimization leading to higher throughput (2) DeepSpeed sequence parallelism benefits from efficient all-to-all communication relative to all-gather communication as applied in Megatron-LM sequence parallelism" (Section 4.2). The experimental design does not include an ablation that isolates these two factors — for instance, by comparing at identical micro-batch sizes to neutralize the memory advantage, or by giving Megatron-LM an equivalent memory optimization to neutralize the ZeRO difference.
The consequence. The reader cannot determine how much of the observed 1.5–2.5× throughput improvement comes from the $O(N/P)$ all-to-all communication design (the paper's central theoretical contribution) versus from ZeRO-3 enabling larger micro-batches (an orthogonal memory optimization that is not sequence-parallelism-specific). This matters for two reasons. First, if most of the advantage is from ZeRO-3, then a practitioner using Megatron-LM could potentially recover much of the gap by integrating ZeRO-3 with Megatron's parallelism stack (even if technically challenging), and the all-to-all communication innovation would be less impactful in practice than the theoretical analysis suggests. Second, without this decomposition, the paper's headline claim that all-to-all communication enables $O(N/P)$ scaling cannot be directly validated from the throughput numbers — the throughput improvement is consistent with the theory but not exclusively attributable to it.
What evidence exists in the paper. All comparative experiments (Figures 4–7) run DeepSpeed-Ulysses with ZeRO-3 (parallelism degrees 32 for 7B, 64 for 30B) against Megatron-LM without ZeRO-3. The methodology section (Section 4.2) states that each system was independently optimized for its best configuration, which is methodologically fair for a deployment comparison but prevents causal attribution. The paper provides no configuration where DeepSpeed-Ulysses runs without ZeRO-3 memory optimization, no configuration where Megatron-LM is given equivalent memory savings, and no micro-batch-size-controlled comparison. The paper also provides no memory consumption measurements (per-GPU total, activation, parameter, optimizer state) that would allow the reader to infer how much additional micro-batch size ZeRO-3 enables.
Mitigation status. The paper does not acknowledge this confounding as a limitation. The two factors are presented as jointly contributing to the advantage, and no attempt is made to quantify their relative importance. A practitioner seeking to understand whether to adopt DeepSpeed-Ulysses primarily for communication efficiency or for memory efficiency receives no guidance from the experiments on this question.
6.2 The Million-Token Result Requires 256 GPUs and Applies Only to a 1.2B Model — The Joint Scaling of Model Size and Sequence Length Is Uncharacterized
The assumption or constraint. The headline million-token result in Figure 3 uses a 1.2B parameter GPT model, which is an order of magnitude smaller than the 7B and 30B models used in the throughput comparisons. The paper does not evaluate what GPU count would be needed for million-token training with a 30B or larger model. This is not an oversight per se — the paper demonstrates sequence length scaling (1.2B model, varying GPUs) and model size scaling (7B and 30B models, fixed GPU counts) separately, but it never demonstrates the joint scaling of both dimensions simultaneously.
The consequence. A practitioner training a 30B or 70B model who wants to reach million-token sequence lengths cannot extrapolate from the paper's results. The 1.2B experiment shows that 256 GPUs suffice for ~1M tokens at that model size. For a 30B model, the parameter memory alone is 25× larger, requiring proportionally more GPUs even with ZeRO-3 (or accepting a smaller micro-batch size, which reduces throughput). The activation memory at 1M tokens is also substantial — even partitioned across P GPUs, each GPU must hold the full sequence for h/P heads during attention. The paper's O(N/P) communication analysis says nothing about whether the memory per GPU remains manageable when both N and the model size are large simultaneously, because increasing P reduces per-GPU communication but also reduces per-GPU memory for parameters (via ZeRO-3 across D × P), creating a complex tradeoff space that the paper does not map out.
What evidence exists in the paper. The paper provides three separate scaling dimensions, never jointly tested: (a) sequence length scaling at 1.2B parameters (Figure 3, up to 256 GPUs, ~1M tokens), (b) model size scaling at 7B and 30B (Figures 4–7, up to 128K tokens), and (c) GPU scaling at 7B (Tables 2–3, up to 256 GPUs, up to 262K tokens). The intersection of "large model + extreme sequence length" — e.g., 30B parameters at 512K or 1M tokens — has no data. The paper provides no memory breakdowns that would allow estimating how many GPUs such a configuration would require.
Mitigation status. The paper does not acknowledge this gap. Section 3.3 states that ZeRO-3 integration "enables scaling not just to large sequence lengths but also to large models," which is a qualitative claim that is not quantitatively validated for the joint extreme. The optimistic reading is that the orthogonality of the parallelism dimensions means the results compose — if 256 GPUs can handle 1M tokens at 1.2B, and 64 GPUs can handle 128K tokens at 30B, then some larger GPU count should handle 1M tokens at 30B. But the number of GPUs required is unknown, and the paper provides no framework for estimating it.
6.3 The All-to-All Communication Always Moves the Full Q, K, V Tensors Regardless of Attention Sparsity — No Communication-Avoiding Exploitation of Sparse Patterns
The assumption or constraint. DeepSpeed-Ulysses's all-to-all communication redistributes the full Q, K, V tensors of aggregate size $3Nh$ before attention, regardless of whether the subsequent attention computation uses a sparse pattern that would only require a subset of those key-value pairs. The paper states in Section 3.4 that the design supports sparse attention ("self-attention, cross-attention, causal attention in both their dense and sparse counterparts") but the support is at the computation level — the sparse pattern is applied after the full all-to-all exchange, not used to reduce communication.
The consequence. For attention patterns with high sparsity (e.g., local sliding window attention where each query attends to only W neighboring keys with $W \ll N$), the all-to-all communicates $O(N)$ data per device when only $O(W)$ data would be needed for the actual attention computation. For extremely sparse patterns at very long sequences, this means the communication volume could exceed the useful computation by a large factor, making the system communication-bound in a regime where communication-aware sparse methods could be compute-bound. This is a fundamental tradeoff: DeepSpeed-Ulysses gains generality (any attention pattern works) but sacrifices the ability to exploit attention sparsity for communication reduction. A method that is tightly coupled to a specific sparse pattern (e.g., ring self-attention for local windows) might achieve lower communication in sparse regimes even with O(N) per-link scaling, because the constant factor on N could be much smaller.
What evidence exists in the paper. The sparse attention experiments (Figures 6–7, Section 4.3) show DeepSpeed-Ulysses throughput decreasing as sequence length increases for sparse attention, and the paper explicitly attributes this to "the local sparse attention implementation" being the bottleneck — not communication. The paper states: "the current DeepSpeed throughput is bottlenecked by the local sparse attention implementation, and as a result DeepSpeed throughput decreases as the sequence length increases" (Section 4.3). This suggests that for the blocked sparse attention variant tested, the communication is not the bottleneck — the attention kernel is. However, this is specific to the tested sparse pattern and kernel implementation; for sparser patterns or better-optimized kernels, communication could become the bottleneck, and the full all-to-all would then be wasteful.
Mitigation status. The paper does not propose a sparse-aware communication scheme and does not acknowledge the tension between its attention-agnostic design and the potential for communication reduction from sparse patterns. The attention-agnostic property is presented as an unqualified strength (Section 1: "Fully general and implementation agnostic attention"), not as a design tradeoff. The paper suggests future work on improving the "local sparse attention implementation" to raise throughput, but does not suggest communication optimizations for sparse attention.
6.4 The Evaluation Is Confined to a Single Model Architecture (GPT) and a Single Hardware Platform (A100) — Generalization to Other Architectures and Hardware Generations Is Unvalidated
The assumption or constraint. All experiments use GPT (Radford et al., 2019) as the base architecture and NVIDIA A100 GPUs as the hardware platform. The paper does not evaluate encoder-decoder architectures (e.g., T5), mixture-of-experts models, or models with non-standard attention mechanisms (e.g., grouped-query attention, multi-query attention) that modify the head structure on which DeepSpeed-Ulysses's head-partitioning strategy depends. The paper also does not evaluate on hardware generations with different interconnects (H100 with NVLink 4, or AMD/Intel alternatives) that could change the all-to-all latency and bandwidth characteristics.
The consequence. Two generalization risks arise. First, for architectures that use fewer or differently-structured attention heads, the head-partitioning strategy may need modification. Multi-query attention (MQA), for instance, shares keys and values across all heads — only queries are head-specific. In DeepSpeed-Ulysses, this would mean the all-to-all only needs to redistribute queries (not K and V) to achieve head partitioning, changing the communication volume calculation. The paper provides no guidance for adapting to such variants. Second, the all-to-all performance advantages depend on the underlying network topology — NVSwitch provides high bisection bandwidth for intra-node all-to-all, while inter-node all-to-all over InfiniBand has different bandwidth and latency characteristics. On hardware with lower bisection bandwidth, the $M/P$ per-link volume may not translate to proportionally lower communication time if the network cannot sustain full bisection bandwidth for all-to-all at large $P$.
What evidence exists in the paper. The paper provides zero experiments outside GPT on A100. The architecture is described only as "GPT... a foundation model for many NLP tasks" (Section 4). The hardware specification (A100 GPUs, NVSwitch intra-node, fat-tree IB inter-node topology) is mentioned in Section 3.2 for the communication analysis but is not varied experimentally. There are no H100 measurements, no ROCm/AMD measurements, and no experiments testing sensitivity to interconnect bandwidth (e.g., by throttling network speed or comparing intra-node-only vs. inter-node configurations).
Mitigation status. The paper does not acknowledge this as a limitation. The communication analysis in Section 3.2 contains the qualifier "on modern clusters with intra-node NVSwitch interconnect and inter-node fat tree IB topology," acknowledging that the analysis assumes specific hardware, but no experiments test sensitivity to this assumption. The generality claims ("Fully general and implementation agnostic attention," "portable") implicitly assert architecture and hardware independence, but the empirical support is limited to one architecture on one hardware generation.
6.5 The Paper Provides No Direct Validation of the Central O(N/P) Communication Claim — Communication Time Breakdowns and Volume Measurements Are Absent
The assumption or constraint. The O(N/P) communication complexity claim is the paper's central theoretical contribution (Section 3.2), and the throughput advantage over Megatron-LM is the primary empirical claim. However, the throughput numbers in Figures 4–7 and Tables 2–3 conflate communication time, computation time, and memory-related effects (micro-batch size differences due to ZeRO-3). The paper provides no direct measurement of communication time or volume — no breakdown of iteration time into all-to-all collective time vs. attention computation time vs. MLP computation time, and no measurement of bytes transmitted per GPU per iteration.
The consequence. Without direct communication measurements, the paper cannot distinguish between two possible explanations for the throughput advantage: (a) the all-to-all communication is genuinely more efficient than allgather (the claimed mechanism), or (b) ZeRO-3 allows larger micro-batches that improve GPU utilization, and the communication primitive matters less than the memory optimization. Both explanations are consistent with the observed throughput data. Furthermore, without communication time measurements, the paper cannot validate the quantitative prediction that per-link communication volume decreases as $1/P$ — the modest throughput degradation in Table 3 (161.4 → 157.4 → 147.4 TFLOPs/GPU when scaling GPUs 4×) is consistent with near-constant communication overhead but could also result from increasingly imbalanced attention computation across GPUs (since attention is O(N^2) and each GPU gets h/P heads but the full N-length sequence, the workload per GPU increases quadratically with N).
What evidence exists in the paper. The only communication-relevant measurement is the throughput degradation in the scaling tables (Section 4.4), which the paper attributes to "communication overhead" without quantifying it: "Communication overhead can be attributed to slight decrease in throughput as we increase communication workload (that is, sequence length or GPU count)" (Section 4.4). No profiling data (e.g., PyTorch profiler traces, NCCL timing logs, bandwidth utilization measurements) is reported. The $4Nh/P$ formula is derived theoretically but never validated against measured communication volumes.
Mitigation status. The paper does not acknowledge the absence of direct communication measurements as a limitation. The communication analysis is presented as theoretically derived, and the throughput results are presented as empirical validation. For a systems paper whose primary contribution is a communication optimization, the lack of communication profiling is a significant gap — practitioners cannot determine whether the communication time is 5% or 50% of iteration time at different sequence lengths and GPU counts, which is essential for predicting whether DeepSpeed-Ulysses will be communication-bound or compute-bound in their specific deployment.
6.6 The Ease-of-Use and Portability Claims Are Entirely Unevaluated — No Code Metrics, No User Study, No Migration Experience Reported
The assumption or constraint. The paper lists "Easy-to-use and portable, requiring minimal code changes to the existing training frameworks" as one of its five headline contributions (Section 1), and Table 1 awards DeepSpeed-Ulysses a checkmark in the "Ease of use" column while denying it to both Megatron-LM-SP and ColAI-SP. The paper also claims orthogonality with existing parallelism strategies (Section 2.1.2), positioning DeepSpeed-Ulysses as a composable building block.
The consequence. These claims are purely qualitative and unevaluated. A practitioner reading the paper has no way to assess: (a) what specific code changes are needed to integrate DeepSpeed-Ulysses into an existing training pipeline (e.g., a HuggingFace Transformers + PyTorch script), (b) how many lines of code must be modified, (c) whether the integration requires adopting the full DeepSpeed framework or can be used standalone, (d) whether DeepSpeed-Ulysses imposes constraints on model definition style, checkpoint format, or data loading that conflict with existing code. The claim that Megatron-LM-SP is "not easy to use" because it requires adopting Megatron's tensor parallelism (Section 2.2) is plausible but not compared against the (unquantified) effort of adopting DeepSpeed-Ulysses. The claim that ColAI-SP is "not easy to use" because it requires a custom attention implementation is similarly plausible but unquantified. The "minimal code changes" claim is presented as a contribution without evidence.
What evidence exists in the paper. None. There are no code listings, no diff examples, no lines-of-change counts, no user experience reports, and no compatibility matrix showing which training frameworks and model architectures are supported. The paper does not even specify which version of DeepSpeed (or which configuration file syntax) enables DeepSpeed-Ulysses. The convergence study (Figure 8) demonstrates that DeepSpeed-Ulysses can be configured with different ZeRO stages, but this is a configuration parameter within the DeepSpeed ecosystem, not evidence of ease of integration with external codebases.
Mitigation status. The paper does not acknowledge this as a limitation. The ease-of-use claim is presented as a factual statement alongside the quantitative throughput and scalability results. In the absence of any supporting evidence, a practitioner should treat the ease-of-use claim as aspirational rather than demonstrated.
7. Implications and Future Directions
How This Work Changes the Landscape
DeepSpeed-Ulysses changes the landscape of distributed LLM training by establishing sequence length as a first-class, independently scalable dimension in the parallelism taxonomy — on equal footing with batch size, hidden dimension, and model depth. This is a methodological shift rather than an incremental improvement: before this paper, practitioners treating sequence length as a scaling axis had to either accept the O(N) communication penalty of Megatron-LM-SP or the limited generality of ColAI-SP. DeepSpeed-Ulysses demonstrates that sequence parallelism can be both communication-efficient (O(N/P) rather than O(N)) and orthogonal to existing parallelism strategies, which means the field's default assumption — that scaling sequence length necessarily imposes a communication bottleneck — is conditional on the communication primitive chosen, not inherent to the problem.
This reframing has immediate practical consequences for how training clusters are configured. Prior to this work, the standard response to "I need to train on longer sequences" was "buy more GPUs and accept sublinear throughput scaling" — because Megatron-LM-SP's per-link communication volume of 4Nh per layer does not decrease with additional GPUs. DeepSpeed-Ulysses shows that by using an all-to-all collective to swap the partitioned dimension from sequence to heads, you can instead keep per-GPU communication volume constant when adding GPUs proportionally to sequence length. The throughput numbers in Table 3 make this concrete: scaling from 64 GPUs at 65K tokens to 256 GPUs at 262K tokens (4× more GPUs, 4× longer sequences, 16× more attention FLOPs) degrades per-GPU throughput by only 8.6% (161.4 → 147.4 TFLOPs/GPU). This is a qualitatively different scaling regime than what the field had come to expect from sequence parallelism, and it shifts the bottleneck from communication to computation (specifically, the attention kernel, as the paper's sparse attention experiments reveal).
The paper also reconciles a contradiction in prior work that had been treated as an unavoidable tradeoff: the apparent incompatibility between memory efficiency and communication efficiency for sequence parallelism. Megatron-LM-SP reduced activation memory but at the cost of O(N) communication and tight coupling to tensor parallelism (which limited ZeRO integration). ColAI-SP reduced activation memory but with O(N) communication and a bespoke attention implementation. The implicit message from prior work was "you can have activation memory reduction OR communication efficiency, but not both." DeepSpeed-Ulysses shows that this tradeoff was an artifact of the communication primitives chosen (allgather/reduce-scatter in Megatron-LM-SP, ring send/receive in ColAI-SP), not a fundamental constraint. By choosing all-to-all as the communication primitive and combining it with ZeRO-3 across the unified data-parallel + sequence-parallel group, the paper achieves activation memory reduction (factor of P), parameter memory reduction (factor of D × P), and communication volume reduction (factor of P relative to allgather) simultaneously. Table 1's checkmark pattern — three checkmarks for DeepSpeed-Ulysses vs. at most one for prior methods — captures this reconciliation.
The work also redirects research attention in the distributed training systems community. Before DeepSpeed-Ulysses, the primary research thrust in sequence parallelism was on how to approximate or restructure attention to make it distributable (ring self-attention, sparse patterns, linear attention approximations). The paper demonstrates that with the right communication primitive, exact attention can be distributed efficiently without structural modification, which means research effort can shift from "designing distributable attention variants" to "optimizing the communication layer (all-to-all algorithms, topology-aware scheduling) and the local attention kernel (FlashAttention, block-sparse implementations)." This separation of concerns — the paper's attention-agnostic property — makes the problem more modular: communication researchers can improve all-to-all performance independently, and attention kernel researchers can optimize local attention independently, with DeepSpeed-Ulysses serving as the composition layer.
Research directions that become more attractive after this paper:
- Extreme-scale training at million-plus token sequence lengths is now systemically tractable. The paper's demonstration of 1M-token training on 256 GPUs with a 1.2B model provides a concrete baseline that subsequent work can build on. The communication scaling analysis (Section 3.2) provides a theoretical framework for predicting GPU requirements at larger scales.
- Joint model-size and sequence-length scaling becomes an empirical question that can actually be explored. Before this paper, the tools didn't exist to train a 70B model at 100K+ token sequence length; now the question is "how many GPUs does it take?" rather than "is it possible?"
- All-to-all collective optimization for deep learning workloads is now a high-impact research target, since DeepSpeed-Ulysses makes all-to-all a first-class primitive in the training loop rather than an occasional synchronization operation.
- Attention kernel optimization for very long sequences becomes the rate-limiting step (as the sparse attention experiments in Figures 6–7 reveal), motivating further investment in FlashAttention-style tiled exact attention and efficient sparse attention implementations.
Research directions that become less critical after this paper:
- Designing new distributable attention variants (ring attention, chunked attention, etc.) may be less impactful if the exact attention can be distributed efficiently with standard collectives and the bottleneck is the local kernel, not the distribution scheme.
- Tight coupling between parallelism strategies (as in Megatron's tensor + sequence parallelism) is shown to be unnecessary — orthogonality is achievable and preferable, making monolithic parallelism frameworks less attractive relative to composable building blocks.
Follow-Up Research This Work Enables
Communication time profiling to directly validate the O(N/P) per-link volume claim. The paper derives the 4Nh/P formula theoretically (Section 3.2) but provides no direct measurement of all-to-all communication time or bytes transmitted. A strong follow-up would instrument the training loop with NCCL profiling (e.g., NCCL_DEBUG=INFO timestamps or PyTorch profiler traces with communication callbacks), measure the fraction of iteration time spent in all-to-all collectives across the same sequence length and GPU count sweep as Tables 2–3, and validate that per-link communication volume decreases as 1/P. This would disentangle communication overhead from the quadratic attention workload growth that confounds the TFLOPs-only analysis in Table 3. The specific experiment: run the 7B dense GPT model from Section 4.4 with sequence lengths 65K, 131K, 262K on 64, 128, 256 GPUs respectively, report the all-to-all time as a percentage of total iteration time, and verify that it stays approximately constant (predicted by O(N/P) theory) rather than growing with N.
Megatron-LM-SP + ZeRO-3 integration to isolate the all-to-all communication benefit. The paper acknowledges that DeepSpeed-Ulysses's throughput advantage over Megatron-LM comes from two sources — all-to-all communication efficiency and ZeRO-3 memory efficiency — but never isolates them. A revealing stress-test would be to integrate ZeRO-3 with Megatron-LM's sequence parallelism stack (decoupling Megatron-SP from tensor parallelism enough to allow ZeRO-3 parameter partitioning across the combined data + sequence parallel group) and rerun the 7B and 30B dense attention comparisons (Figures 4–5) at identical micro-batch sizes. If the throughput gap narrows substantially (e.g., from 1.5–2.0× to 1.1–1.3×), it would indicate that ZeRO-3 memory efficiency, not all-to-all communication, is the primary driver of DeepSpeed-Ulysses's advantage. If the gap remains large, it would validate the communication-centric narrative. Either outcome would sharpen the community's understanding of which DeepSpeed-Ulysses innovations matter most.
Joint model-size and sequence-length scaling at extreme regimes. The paper demonstrates model-size scaling (7B, 30B) at up to 128K tokens and sequence-length scaling (1.2B) at up to 1M tokens, but never jointly. A natural extension would fix sequence length at 1M tokens and scale model size from 1.2B → 7B → 30B (replicating the Figure 3 sweep but for larger models), measuring the GPU count required to stay within memory and the TFLOPs/GPU achieved. The key question: does the ZeRO-3 partitioning across the combined D × P group provide sufficient memory reduction to keep per-GPU memory within A100 80GB limits at 1M tokens for a 30B model, and if so, at what GPU count? This would produce a concrete resource requirement table (model size × sequence length → minimum GPU count) that practitioners desperately need and that the current paper only partially provides. The experiment would also reveal whether the all-to-all communication remains the bottleneck or whether ZeRO-3's parameter allgather operations become dominant at large model sizes (since ZeRO-3 allgathers parameters across the full D × P group, which grows with both data and sequence parallelism).
Sparse-aware communication optimization for attention patterns with known sparsity structure. The paper's attention-agnostic design always performs full all-to-all of Q, K, V before attention (Section 3.4), even for sparse attention where most key-query pairs are masked. For extremely sparse patterns (e.g., local sliding window with window size W << N), this means communicating O(N) data when only O(W) is needed. A follow-up would extend DeepSpeed-Ulysses with a sparse communication mode: for attention patterns where the sparsity mask is known before the all-to-all (e.g., block-sparse patterns with fixed block structure), only the K and V chunks needed for each GPU's assigned queries would be communicated, reducing the all-to-all volume from 3Nh to something proportional to the number of non-zero attention entries. The experiment would compare throughput against the current full-all-to-all approach at very long sequences (256K+) with highly sparse attention (e.g., 1% density), measuring whether the communication savings offset the additional complexity of sparse collective scheduling. This would address the tension the paper leaves unresolved between generality (attention agnosticism) and efficiency (exploiting sparsity for communication reduction).
Architecture generalization to grouped-query and multi-query attention. DeepSpeed-Ulysses's head-partitioning strategy assumes that the number of attention heads h is divisible by the sequence parallelism degree P, and that each head has its own independent Q, K, V. Grouped-query attention (GQA) and multi-query attention (MQA), used in models like LLaMA 2 and PaLM, share K and V across multiple query heads — only Q is head-specific. This changes the all-to-all communication pattern: K and V do not need to be repartitioned by head (since they are shared), only Q does. A necessary follow-up would implement and benchmark DeepSpeed-Ulysses with GQA/MQA architectures, deriving the modified communication volume formula (smaller, since K and V all-to-all is eliminated or reduced) and measuring throughput improvement over the standard multi-head implementation. This would validate whether the paper's claim of attention agnosticism extends to these increasingly common architecture variants or whether they require non-trivial modifications to the all-to-all pattern.
All-to-all topology-aware scheduling for heterogeneous interconnects. The paper's communication analysis (Section 3.2) assumes a specific topology: "intra-node NVSwitch interconnect and inter-node fat tree IB topology." On large clusters, all-to-all performance degrades when GPUs span multiple nodes due to inter-node bandwidth limitations (NVSwitch provides ~900 GB/s intra-node; InfiniBand provides ~50–200 GB/s inter-node depending on configuration). A systems follow-up would implement topology-aware all-to-all scheduling for DeepSpeed-Ulysses: prioritize intra-node data exchange in the all-to-all phases, batch inter-node transfers to amortize latency, and potentially overlap inter-node communication with the intra-node attention computation. The experiment would measure throughput at large P (256+ GPUs spanning multiple nodes) with and without topology-aware scheduling, quantifying the inter-node bandwidth penalty and how much of it can be hidden. This directly addresses a limitation the paper does not explore: the scaling experiments max out at 256 GPUs, and all-to-all performance characteristics at multi-thousand-GPU scale are unknown.
Practical Applications and Downstream Use Cases
Genomic language model pretraining at chromosome scale. The paper's motivating example — "the human genome has 6.4 billion letters" (Section 1) — maps directly onto a concrete deployment scenario. Genome-scale language models (such as GenSLMs, Zvyagin et al., 2022) need to process entire chromosomes as single sequences to capture long-range regulatory interactions. With DeepSpeed-Ulysses, a research lab training a genomic LLM on 256 A100 GPUs can now train on sequences of 1M+ nucleotides (Figure 3), covering full bacterial genomes or substantial chromosome fragments, at ~165 TFLOPs/GPU sustained throughput (Table 2). Before this work, the same lab would be limited by Megatron-LM-SP's O(N) communication to perhaps 32K–64K tokens at comparable hardware scale, forcing them to fragment genomes into overlapping windows that lose long-range context. The practical benefit is training on sequences 16–32× longer without reducing per-GPU throughput — enabling models that learn from whole-gene and operon-scale context rather than short sub-genic fragments.
Long-document summarization model training at book scale. The paper cites "chapter and book level summarization" with input lengths of "tens and hundreds of thousands of words" (Section 1). A production training pipeline for a book summarization model (e.g., fine-tuning a 7B LLaMA-style model on the BookSum dataset, Kryściński et al., 2022) using DeepSpeed-Ulysses on 64 A100 GPUs can train at 128K-token sequence lengths at ~150 TFLOPs/GPU (Figure 4, extending the trend). At a typical tokenizer density of ~0.75 tokens per word, 128K tokens covers roughly 170,000 words — a full-length novel chapter or a substantial academic survey paper. The alternative with Megatron-LM-SP on the same hardware would be limited to ~32K tokens (~43,000 words), forcing truncation that discards later sections of long documents. DeepSpeed-Ulysses eliminates this truncation without reducing throughput (in fact, throughput is higher at 128K than Megatron-LM achieves at 32K), meaning the practitioner gets longer context and faster training simultaneously.
Long-context chat model continual pretraining with sequence length extension. The paper describes a scenario where a practitioner pretraining on 1024 GPUs at 8K sequence length wants to extend to 32K sequences "without... laborious hyperparameter search" (Section 2.1.2). This maps onto the current industry practice of continual pretraining for context window extension (e.g., Xiong et al., 2023; Peng et al., 2023). A team that has already pretrained a 7B chat model at 8K context can enable 4-way sequence parallelism (P=4), keeping the global batch size at 8M tokens per step (same as before, avoiding convergence-disrupting batch size increases) while each GPU now processes 32K-token sequences. The throughput per GPU remains high (Figure 4 shows ~155 TFLOPs/GPU at 32K with P=32 on 7B; with P=4 the per-link volume is higher but still much better than Megatron-LM-SP). The practical benefit is that the team can extend context length without redesigning their data pipeline, retuning their learning rate schedule, or accepting degraded throughput — sequence parallelism absorbs the sequence length increase transparently.
Climate model training on high-resolution spatiotemporal data. The paper cites ClimaX (Nguyen et al., 2023), a weather and climate foundation model. These models process gridded atmospheric data where the "sequence length" corresponds to the number of spatial grid points × temporal snapshots. For a global weather model at 0.25° resolution (~720 × 1440 grid points = ~1M spatial positions) with 10 temporal snapshots, the effective sequence length is ~10M tokens. While the paper doesn't demonstrate 10M-token training directly, its O(N/P) scaling property and 1M-token demonstration on 256 GPUs provide the system foundation. A climate modeling group could use DeepSpeed-Ulysses to scale to multi-million-token sequences by increasing P proportionally, enabling models that capture fine-grained spatial structure without downsampling. The key benefit over the status quo (truncating or coarsening the spatial grid) is preserving high-resolution information for extreme weather event prediction, where small-scale features (thunderstorms, wind gusts) matter.
When to Prefer This Method
The paper explicitly positions DeepSpeed-Ulysses against Megatron-LM sequence parallelism (Korthikanti et al., 2022) and, to a lesser extent, ColAI-SP (Li et al., 2022b). The decision rules below are grounded in the paper's specific claims and measurements.
-
Prefer DeepSpeed-Ulysses when sequence length is the primary scaling constraint and you need to train on sequences beyond what fits in a single GPU's activation memory. The paper demonstrates training at 4× longer sequences than Megatron-LM can handle at 7B and 30B scale (Figures 4–7), and up to 1M tokens at 1.2B scale (Figure 3). If your sequence length requirement exceeds ~32K tokens at 7B+ model sizes on A100-80GB GPUs, Megatron-LM-SP cannot run at all — DeepSpeed-Ulysses is not just faster, it is the only option at these lengths among the compared methods.
-
Prefer DeepSpeed-Ulysses when you need to combine sequence parallelism with ZeRO-3 parameter partitioning. The paper's ZeRO-3 integration (Section 3.3) partitions model states across the combined data-parallel and sequence-parallel group, providing factor-of-(D × P) memory reduction. This matters for large models (30B+) trained at long sequences, where parameter memory alone can exceed GPU capacity without aggressive partitioning. Megatron-LM-SP's coupling to tensor parallelism limits ZeRO integration; DeepSpeed-Ulysses's orthogonal sequence parallelism has no such restriction.
-
Prefer DeepSpeed-Ulysses when you need flexible attention implementation choices — if your model uses FlashAttention v2, a custom block-sparse pattern, or a research attention variant, and you do not want to modify it for distributed execution. The paper's all-to-all → local attention → all-to-all design (Section 3.4) means any attention kernel that accepts standard Q, K, V tensors works without modification. ColAI-SP requires a custom ring-attention implementation; Megatron-LM-SP, while less invasive, still operates within Megatron's specific attention abstractions.
-
Consider Megatron-LM sequence parallelism if you are already fully committed to the Megatron ecosystem for tensor and pipeline parallelism and your sequence lengths are moderate (≤32K tokens at 7B–30B scale). The paper shows Megatron-LM-SP achieves competitive throughput at short sequence lengths (Figure 4: ~140 TFLOPs/GPU at 8K on 7B vs. DeepSpeed-Ulysses's ~155), and the integration cost of switching to DeepSpeed-Ulysses may outweigh the throughput gain if sequences are short enough that communication is not the bottleneck.
-
Prefer neither if your attention pattern is extremely sparse and communication-avoiding schemes can provide larger savings. DeepSpeed-Ulysses's all-to-all always communicates the full Q, K, V tensors (volume 4Nh/P per layer per link). For local sliding window attention with window size W << N, a method that exploits sparsity to communicate only O(W) data per device could achieve lower communication even with higher per-link volume (e.g., ColAI-SP's ring attention with sparse message passing). The paper does not compare against such communication-avoiding schemes, and the attention-agnostic design explicitly chooses generality over sparsity-specific communication optimization.