Google Adds Four Context-Parallelism Strategies to MaxText for 14-Million-Token Training
Google has added four context-parallelism strategies to MaxText, its open-source JAX training framework, enabling Llama 3.1 8b training at context lengths up to 14 million tokens on Cloud TPUs. The work targets memory and communication limits that appear when training, not just serving, very long se

TL;DR
- Google added four context-parallelism strategies to MaxText, its JAX-based training framework.
- The strategies split long sequences across chips, and reported runs reach context lengths up to 14 million tokens on Cloud TPUs.
- Ring Attention is described as the main choice for very long contexts, while All-Gather remains the baseline when the key-value cache fits.
Why long context is hard to train
Long context windows have grown quickly. Google engineers note that in about three years, context windows went from 128K-200K tokens to 1M-2M, and models trained toward 10M tokens are now appearing. Training at these lengths exposes limits that serving does not. Attention cost grows quadratically with sequence length, while activations and key-value (KV) caches grow linearly, so a single accelerator quickly runs out of memory.
What context parallelism does
Context parallelism splits one sequence across several chips. Each chip holds only part of the sequence, and keys and values are streamed between chips as needed, instead of materializing the full sequence on every device. The key-value cache is the per-token memory that attention reuses while processing a sequence, so keeping it sharded is what makes multi-million-token runs feasible.
MaxText now offers four variants: All-Gather, All-to-All (Ulysses), P2P (Ring Attention), and a hybrid A2A + P2P called USP. They differ in high-bandwidth memory (HBM) requirements, in how well they overlap communication with computation, and in how far they scale beyond the number of KV heads in a model. According to the report, P2P is the main workhorse for very long training runs, while All-Gather is the standard choice whenever the KV data fits on each chip.
Reported results
Google tested the strategies with Llama 3.1 8b on Cloud TPU infrastructure. The reported figures include about 70% Model FLOPs Utilization (MFU) for sequences up to 4 million tokens on TPU 5p, context lengths of up to 14 million tokens on both TPU 5p and TPU 7, and roughly 50% MFU for sequences below 6 million tokens. P2P reached 48.7% MFU on TPU 7, compared with 37.1% on TPU 5p. MFU is the share of the chip's theoretical peak floating-point throughput that the training run actually uses, so higher values mean less wasted hardware time.
InfoQ also reports that Google plans further work. Planned items include support for architectures that mix sliding-window and global attention, linear attention variants such as Gated Delta Net (GDN) and Kimi Delta Attention (KDA), faster Tokamax kernels, improvements to the P2P backward pass, and per-model, per-context-length "recipes" for different TPU generations. Google director Nathan Beach summed up the core issue: "attention memory -- not compute -- is usually the first wall you hit" when training with multi-million-token context on Google TPUs.
Why it matters
Teams training their own models on long documents, codebases or video will need to pick a context-parallel strategy based on their KV head count, HBM budget and TPU generation rather than assuming a single default. Developers who only consume long-context models through an API are less directly affected, but the numbers show where memory, not raw compute, sets the limit. MaxText 0.2.4 is available from PyPI, Docker Hub and GitHub, so teams already on JAX can test the strategies on their own workloads.
Sources
This article was written by Blozhik from the reporting below. Read the originals for full detail.
InGoogle Enhances its Open-Source MaxText Training Framework for Long-Context TrainingInfoQ

