TASP: Topology-aware Sequence Parallelism
Not on the map. Why?
Abstract (arXiv)
Long-context large language models (LLMs) face constraints due to the quadratic complexity of the self-attention mechanism. The mainstream sequence parallelism (SP) method, Ring Attention, attempts to solve this by distributing the query into multiple query chunks across accelerators and enable each Q tensor to access all KV tensors from other accelerators via the Ring AllGather communication primitive. However, it exhibits low communication efficiency, restricting its practical applicability. This inefficiency stems from the mismatch between the Ring AllGather communication primitive it adopts and the AlltoAll topology of modern accelerators. A Ring AllGather primitive is composed of iterations of ring-styled data transfer, which can only utilize a very limited fraction of an AlltoAll topology. Inspired by the Hamiltonian decomposition of complete directed graphs, we identify that modern accelerator topology can be decomposed into multiple orthogonal ring datapaths which can concurrently transfer data without interference. Based on this, we further observe that the Ring AllGather primitive can also be decomposed into the same number of concurrent ring-styled data transfer at every iteration. Based on these insights, we propose TASP, a topology-aware SP method for long-context LLMs that fully utilizes the communication capacity of modern accelerators via topology decomposition and primitive decomposition. Experimental results on both single-node and multi-node NVIDIA H100 systems and a single-node AMD MI300X system demonstrate that TASP achieves higher communication efficiency than Ring Attention on these modern accelerator topologies and achieves up to 3.58 speedup than Ring Attention and its variant Zigzag-Ring Attention. The code is available at https://github.com/infinigence/HamiltonAttention.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 22 of its 40 references that are in the map. First posted on arXiv 30 Sep 2025.
Builds on
22 of 40 references.
References · 22
- 2017Attention Is All You Needcited by 60,361
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
- 2024Mixtral of Expertscited by 1,823
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
- 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 457
- 2022Reducing Activation Recomputation in Large Transformer Modelscited by 302
- 2023DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Modelscited by 245
10 more
- 2024Chain of Agents: Large Language Models Collaborating on Long-Context Taskscited by 206
- 2018Beyond Data and Model Parallelism for Deep Neural Networkscited by 179
- 2021Self-attention Does Not Need O(n2) Memorycited by 154
- 2021Sequence Parallelism: Long Sequence Training from System Perspectivecited by 126
- 2025A Comprehensive Survey on Long Context Language Modelingcited by 117
- 2023Striped Attention: Faster Ring Attention for Causal Transformerscited by 54
- 2023A Hybrid Tensor-Expert-Data Parallelism Approach to Optimize Mixture-of-Experts Trainingcited by 47
- 2023DISTFLASHATTN: Distributed Memory-efficient Attention for Long-context LLMs Trainingcited by 29
- 2025Serving Large Language Models on Huawei CloudMatrix384cited by 24
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectivenesscited by 1
Built on by
Not cited yet.