Google MaxText Enables 14 Million Token LLM Training on Cloud TPUs With Context Parallelism
Google has updated its open-source MaxText training framework to support long-context training up to 14 million tokens on Cloud TPUs. The update integrates four context-parallelism strategies to overcome computational and memory bottlenecks, achieving significant efficiency gains.
Google Engineers Highlight Context Growth
They emphasize that training at these lengths, not just serving them, reveals system limits, enabling applications like processing entire code repositories or ingesting hours of video.
Context parallelism addresses this by distributing sequences across chips and streaming keys and values between them, avoiding full materialization on each chip.
Context Parallelism Strategies Explained
All four strategies utilize the Tokamax Splash Attention kernel, a block-sparse flash attention kernel from Google’s open-source library of TPU kernels.

Google updated MaxText 0.2.4 to support long-context training on Cloud TPUs, addressing computational, memory, and communication bottlenecks for sequences up to 14 million tokens, according to the Google Developers Blog. Training at these lengths, not just serving them, is where the system limits show up. To solve this, Google implemented four context-parallelism strategies in MaxText: All-Gather, All-to-All (Ulysses), P2P (Ring Attention), and A2A + P2P (USP). Each strategy makes a different tradeoff.
Benchmark Results
Using these strategies, Google reported significant results with the Llama 3.1 8B model. The system also supports context lengths of up to 14 million tokens on both TPU 5p and TPU 7, maintaining approximately 50% MFU for sequence lengths below 6 million tokens. P2P performance showed a notable difference between chip versions, achieving 48.7% MFU on TPU 7, compared with 37.1% on TPU 5p.
Future Development and Availability
Google has identified two areas for future development. The second is improving performance through further optimization of Tokamax kernels and enhancements to the P2P backward pass. The functionality ships in MaxText v0.2.4, available on PyPI, and Google provides sample training recipes for both TPU 7 and TPU 5p configurations.