Skip to content

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

Jul 2026 · arXiv.org · Vol abs/2607.23250 · 1 citation · 42 references
Computer Science

TL;DR

Libra is presented, 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.

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 three production Qwen3 models (8B, 30B, 235B) and 256K- and 1M-token production workloads, Libra improves end-to-end training throughput over the strongest evaluated baseline (WLB-LLM) by 44% on average and up to 68% at 256 GPUs. Libra has run for hundreds of thousands of GPU-hours in production on jobs spanning 32K to 1M tokens.

View source

Similar papers

Preprint Sep 2026

NSP: Accelerating Variable-Length LLM Training via Nested Sequence Parallelism

Long-context LLM training on long-tailed corpora faces a central communication--balance tradeoff. Such sequence-length heterogeneity makes any single sequence-parallelism (SP) degree a poor fit for the workload: a small degree leaves the few long sequences badly imbalanced, while a large degree forces the many short se...

Yiou Wang, Xiao-Yang Li, Yi-Jie Zheng et al. · 0 citations
Preprint Sep 2026

HyDra: Demystifying and Taming Dynamic Context Parallelism at Production Scale

Long-context training runs on sequences whose lengths span orders of magnitude, and dynamic context parallelism (DCP) gives each sequence its own CP degree. Existing DCP systems either do not scale or perform poorly on mainstream models, leaving Megatron-Core (Mcore) DCP as the only option at production scale. Mcore DC...

Zi-Hao Fan, Yun-Zhuo Liu, Bo Jiang et al. · 0 citations
Open access Aug 2026

ATAC: Anchor-tail aware context parallelism for LLM training

This work proposes ATAC, an anchor-tail aware framework for jointly optimizing packed-document construction and context-parallel sharding in large language model training and demonstrates that input-structure-aware co-design of packing and context parallelism is an effective approach to improving calibrated pipeline-le...

Zhengyu Liu, Shuai-Kang Hou, Yan-Zhao Gao et al. · 0 citations
Preprint Sep 2026

Flattening Every Memory Peak in Long-Context Mixture-of-Experts Training

Four parallelism plans are left unbounded by the parallelism plans in common use, and each grows differently: expert dispatch with the routing matrix, the vocabulary projection with tokens times vocabulary, gradient checkpoint boundaries with depth times sequence length, and optimizer state with parameter count.

Shrey Pandit, Xuan-Phi Nguyen, Yiran Zhao et al. · 0 citations
Preprint Aug 2026

Beyond Sparse Weights: When Is Attention Compressible?

Results motivate CertKV, a training-free compressor that reserves one tail-summary slot per head and allocates the rest by value dispersion, which is top-two in seven of nine LongBench-v2 settings, remains in the leading compressed tier on 128K RULER, and realizes a ten-fold cache budget in a packed Llama prototype.

Chi-Wun Yang, Xiaoyu Li · 0 citations
#artificial intelligence Preprint Sep 2026

RBS-Attention: Radius-Bounded Sparse Prefill for Long-Context Large Language Models

RBS-Attention is proposed, a training-free sparse-prefill method with two complementary selection branches that controls the contribution of rescue blocks while preserving regular block-sparse FlashAttention execution and supports radius-adaptive dual-branch selection as an effective approach to long-context prefill.

Chu-Xu Song, Jiu-Qi Wei, Zhen-Can Peng · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.