Google Adds Context Parallelism to MaxText for 14M Token Training
Google has updated its open-source MaxText framework with context-parallelism strategies, enabling long-context LLM training up to 14 million tokens on Cloud TPUs.

Google has updated MaxText, its open-source JAX training framework, to address major memory and computational hurdles associated with training long-context large language models. With version 0.2.4, the framework integrates four distinct context-parallelism strategies, enabling model training with context windows extending up to 14 million tokens on Cloud TPUs.
Overcoming Attention Memory Limits
Context windows have expanded rapidly over recent years. Three years ago, standard context lengths ranged between 128K and 200K tokens, whereas current models routinely handle 1 million to 2 million tokens, and architectures targeting 10 million tokens are beginning to appear. Processing such extensive sequences allows models to analyze massive datasets, including entire software codebases or multiple hours of continuous video content. However, while serving these models poses operational challenges, training them exposes severe system limitations.
Training at multi-million-token scale introduces two core bottlenecks: quadratic growth in attention calculations and linear expansion of activations alongside key-value (KV) caches. Highlighting this issue, Google Director Nathan Beach noted that when training models with multi-million-token contexts on Google TPUs, attention memory—rather than computational power—is usually the primary bottleneck encountered. To prevent memory exhaustion, context parallelism splits sequences across multiple processing chips and streams key and value tensors between them, avoiding the need to materialize full context sequences on individual chips.
Four Parallelism Strategies and Benchmark Results
The updated MaxText framework incorporates four context-parallelism techniques: All-Gather, All-to-All (Ulysses), Peer-to-Peer (Ring Attention), and a combined A2A + P2P strategy known as USP. These methods vary based on their high-bandwidth memory (HBM) consumption, their capacity to overlap communication with computation, and their scaling performance beyond the number of KV heads.
In practice, All-Gather acts as a baseline choice when key-value caches fit within memory, while P2P (Ring Attention) functions as the primary mechanism for extremely long contexts. During testing with the Llama 3.1 8B model, Google demonstrated a 70% Model FLOPs Utilization (MFU) for context lengths reaching 4 million tokens on TPU 5p. Both TPU 5p and TPU 7 hardware supported contexts up to 14 million tokens while maintaining roughly 50% MFU for sequences under 6 million tokens. Additionally, P2P context parallelism reached an MFU of 48.7% on TPU 7, compared to 37.1% on TPU 5p.
What it means for developers
For engineering teams looking to build or fine-tune models capable of reading full repositories or analyzing long-form media, MaxText 0.2.4 provides concrete open-source tools to handle long-context training on Cloud TPUs without hitting strict hardware limits. Understanding these context-parallelism tradeoffs helps developers structure high-throughput training jobs efficiently.
At the same time, once these long-context architectures are trained and deployed, integrating them into production environments requires reliable access. Developers can try top AI models cheaply through one API at https://apixoai.online to evaluate different model capabilities and context performances without managing separate subscriptions or infrastructure.
Future Roadmap and Availability
Google has outlined two main directions for future MaxText development. First, the team plans to support additional architectural designs, such as models combining sliding-window with global attention mechanisms, as well as linear attention architectures like Gated Delta Net (GDN) and Kimi Delta Attention (KDA). Second, Google aims to improve system efficiency by optimizing Tokamax kernels, enhancing the P2P backward pass, and delivering tailored configuration recipes categorized by model type and sequence length for specific TPU hardware generations.
MaxText 0.2.4 is available to the open-source community through PyPI, DockerHub, and GitHub.
Source: Google Enhances its Open-Source MaxText Training Framework for Long-Context Training — InfoQ AI & ML. Written by the Apixo team from that report.
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key

