Libra: Taming Attention Workload Skew in Long-Context LLM Training with Bounded Sequence Pool

📅 2026-07-25
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses severe load imbalance in long-context large language model training, where the quadratic complexity of attention computation with respect to sequence length leads to straggling in data parallelism and pipeline bubbles. To mitigate this, the authors propose a bounded sequence pooling mechanism that decouples load balancing from data parallelism. Combined with variance-reduced sequence placement, SH-Tiles (chunked attention pooling), communication-computation overlap, and a pluggable sampler, the approach enables efficient scheduling without expanding the communication domain. Evaluated on Qwen3-Turbo training, the method achieves up to a 2.54× end-to-end throughput improvement and accelerates the worst-case attention straggler steps by 3.14×, demonstrating stable operation in production environments over hundreds of thousands of GPU hours.
📝 Abstract
Long-context LLM training suffers from a load-balancing problem that sequence packing does not solve. Packing samples into fixed-token sequences balances memory and linear-cost operators, but the dominant attention cost scales with the sum of squared sequence lengths. Thus, equally sized packed sequences drawn from a long-tailed corpus can carry substantially different attention workloads, creating data-parallel stragglers and pipeline bubbles. Existing approaches either balance at the granularity of sequences or microbatches, where an outlier can dominate an assignment, or disaggregate attention over a global worker pool whose communication domain grows with the data-parallel (DP) degree. We present Libra, which operationalizes the law of large numbers (LLN) as a scaling principle for load balancing: the attention-balancing pool need not grow with the DP degree. Libra groups packed sequences and their CP groups into fixed-size sequence pools. As DP scales out, Libra adds pools rather than enlarging each one, bounding every attention exchange. Variance-Reduced Sequence Placement makes this effective for finite, long-tailed workloads by co-locating sequences with complementary attention workloads to reduce residual inter-pool skew. Within each pool, Tiled Attention Pooling dispatches sequence-head SH-Tiles across GPUs, while a pipelined runtime overlaps tile exchange with attention. Libra exposes a drop-in context-parallel attention operator and a pluggable data sampler, requiring no changes to model layers, optimizers, or pipeline schedules. On Qwen3-Turbo training with 256K- and 1M-token workloads, Libra improves end-to-end throughput by up to 2.54x over Ulysses, with up to 3.14x worst-step straggler-attention speedup in microbenchmarks. Libra has run for hundreds of thousands of GPU-hours in production on jobs spanning 32K to 1M tokens while preserving training semantics.
Problem

Research questions and friction points this paper is trying to address.

long-context LLM training
attention workload skew
load balancing
sequence packing
data-parallel stragglers
Innovation

Methods, ideas, or system contributions that make the work stand out.

load balancing
long-context LLM training
attention workload skew
sequence packing
context parallelism
🔎 Similar Papers
No similar papers found.
Yan Wang
Yan Wang
Chinese University of Hong Kong
medical roboticsmechatronics
Xiulong Yuan
Xiulong Yuan
Alibaba Cloud
K
Kaiming Yang
National University of Singapore
J
Jiaxuan Peng
Alibaba Group
P
Pengju Lu
University of Chinese Academy of Sciences
Mingzhen Li
Mingzhen Li
Institute of Computing Technology, Chinese Academy of Sciences
HPCAI System
Zhipeng Zhang
Zhipeng Zhang
School of Artificial Intelligence, Shanghai Jiao Tong University
Computer Vision,Object Tracking and Segmentation
C
Chang Si
Alibaba Group
Z
Zhixiang Ruan
Alibaba Group
H
Hongqing Chen
Alibaba Group
L
Linlang Jiang
Alibaba Group
S
Siyu Wang
Alibaba Group
L
Langshi Chen
Alibaba Group
Rui Men
Rui Men
Qwen Team, Alibaba Group & Peking University
NLP
M
Man Yuan
Alibaba Group
G
Guangming Tan
University of Chinese Academy of Sciences
Y
Yong Li
Unaffiliated
W
Weile Jia
University of Chinese Academy of Sciences
Jingren Zhou
Jingren Zhou
Alibaba Group, Microsoft
Cloud ComputingLarge Scale Distributed SystemsMachine LearningQuery ProcessingQuery