Loading…
Topic
JAX
10 posts about JAX. Every summary links to the original.
- 10 posts
- 2 companies
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
Benchmarking MoE Training on Ironwood, Part 1: Scaling to 8K Chips
The authors benchmarked DeepSeek-V3 671B pre-training on Ironwood (TPU7x) to evaluate how the seventh-generation TPU handles large Mixture-of-Experts workloads. Using a MaxText recipe with FSDP and expert parallelism, they trained the model in 1.70 minutes on 8,192 chips, with all communication inside one ICI domain. At 2,048 chips, the final result reached an effective model FLOPs utilization of 56%, and scaling from 512 to 2,048 chips was nearly 100% efficient. In one week of optimization, the FSDP + EP track raised throughput per chip by 1.56–1.82× at all three scales while keeping the model, dataset, global batch size, and target loss unchanged. The EP reduce-scatter remained exposed at 8,192 chips, which the batch-split schedule described in Part 2 hides nearly entirely.
Unlocking Stable On-Policy RL on TPU with Bitwise-Zero Train
Reinforcement learning for large language models suffers from numerical instability when the sampler and trainer assign different logprobs to the same action, creating a hidden off-policy gap. This mismatch arises because floating-point addition is non-associative, and differing execution paths use different reduction orders and intermediate precision, especially in bfloat16. The authors’ Zero-TIM implementation closes this gap by locking within-shard kernel accumulation, ordering cross-shard reductions, standardising the logprob scoring tail, and wrapping serving kernels with custom differentiation rules. Verified across 64 TPU v5p chips, the approach records zero mean absolute sampler–trainer logprob difference at every logged step in a 200-step test. The implementation is open-source in Google’s Tunix library and provides a modular blueprint for bit-exact on-policy RL on TPU.
Announcing Long-Context Training on TPUs with MaxText Context Parallelism
MaxText v0.2.4, Google Cloud’s open-source JAX training framework, now supports long-context training on Cloud TPUs through four context-parallel strategies: All-gather, A2A (DeepSpeed Ulysses), P2P (Ring Attention), and the A2A + P2P hybrid (Unified Sequence Parallelism, or USP). These strategies split a long sequence across chips to avoid exhausting high-bandwidth memory, and all use the Tokamax Splash Attention kernel. In benchmarks with Llama 3.1 8B on TPU 5p, P2P achieved 70% Model FLOPs Utilization (MFU) for sequences up to 4 million tokens. Context can be extended to 14 million tokens on both TPU 5p and TPU 7, with TPU 7 maintaining 50% MFU below 6 million tokens. The choice of strategy depends on whether gathered KV fits in HBM and on the number of KV heads, with offloading recommended before recomputation when memory is low.
What is Pathways? Single-controller training for large models
Large-model training with SPMD struggles when jobs become non-uniform, such as pipeline parallelism or RL training loops, and cannot survive hardware failures without restarting. Pathways addresses this by introducing a single Python client that describes the entire computation as a graph of blocks and tensor edges. A distributed runtime places blocks on virtual devices, moves and reshards tensors, orders operations across the cluster, and remaps around a failed host. This separates model building from execution, allowing reasoning about the whole cluster instead of one slice. Pathways runs JAX programs on TPUs and is available on Google Cloud.
Reproducing OLMo 3 7B Pre-training in MaxText: case study of large scale training on TPUs
The post describes the reproduction of AI2’s OLMo 3 7B pre-training using MaxText on Google Cloud TPUs, covering both stages, matching the reference loss curve and held-out metrics. PyTorch weights were converted to JAX with logit parity, KL divergence 1.5e-3 and 98.75% top-1 agreement, and held-out evaluations caught a data loader bug that made incorrect gains appear. The run demonstrated reliability via exact checkpoint-resume with zero loss delta, resilience to a 75% capacity loss via resize with 1% throughput preservation, and seamless TPU generation change. Performance optimizations achieved 44.5% MFU on Ironwood, and head reshaping from 32 heads by 128 to 16 by 256 yielded 12.4% faster throughput at identical parameters and FLOPs. The post emphasizes that faithful reproduction requires verification on generalization metrics and provides instructions for readers to reproduce the run with open sourced code.
Accelerating Dropless MoE Training in JAX with NVIDIA Transformer Engine
Production-scale mixture-of-experts (MoE) training must handle uneven, data-dependent expert loads, creating ragged tensors and expensive dispatch, combine, and all-to-all communication. Dropless MoE processes every selected token, preserving model quality but requiring kernels that support variable token counts without padding or dropping. The post presents JAX and NVIDIA Transformer Engine optimizations centered on group-aware MXFP8 quantization, grouped GEMM, and fused expert-parallel (EP) dispatch and combine using NCCL EP. Grouped GEMM computes each expert’s actual workload in one kernel path, while EP reduces movement overhead and can deduplicate tokens crossing networks. For DeepSeek-V3 training on NVIDIA GB200, the reported throughput increased from 103 to 1,068 TFLOPS/GPU, a 10.4x improvement; the post also reports roughly 10x throughput improvement and 97% scaling efficiency at 1,024 GPUs.
HeyGen x Google Cloud: Bringing Avatar IV to TPUs
HeyGen and Google Cloud ported Avatar IV, an 18B-plus-parameter diffusion stack for streamed talking-head video, to an eight-chip Trillium (v6e) host. The pipeline uses two diffusion transformers and a VAE decoder, with FSDP weight sharding and Ulysses sequence parallelism across the mesh, and runs through torchax, JAX, XLA, and shape-specific Pallas kernels. Optimization targeted exposed all-to-all collectives, frame-misaligned sparse-attention blocks, serial softmax work, layout copies, scheduler choices, and custom-kernel cost estimates; changes were measured per video chunk against output-quality gates. The resulting pipeline was 1.86× faster than the first working TPU version, comparable in performance to the 8×H100 production setup and up to 25% more cost efficient per generated-video minute, while shipped changes preserved byte-identical output or passed defined similarity review.
Run Ray on TPU, Part 2: Ray AI libraries
Running Ray on TPUs requires multi-host workloads to remain on one intact TPU slice whose hosts share a high-speed ICI link. This guide presents Ray's AI libraries on top of GKE and Ray Core: Ray Serve for serving, Ray Data's iter_jax_batches() for input pipelines and batch inference, and Ray Train's JaxTrainer for distributed JAX training. Serve uses accelerator_config.topology to defer slice placement to the replica, while iter_jax_batches() returns device-sharded JAX arrays and handles ragged final batches through drop, pad, or raise choices. JaxTrainer takes a training function and slice topology, launches one worker per host, and provides checkpointing, fault-tolerant restarts, and multi-slice scale-out; official TPU images and dashboard metrics round out the workflow.
Scaling Agentic RL: High-Throughput Agentic Training with Tunix
Tunix is presented as a post-training library for scaling agentic reinforcement learning, where multi-turn tool use and environment latency can leave TPUs idle. Its design combines an asyncio-based, high-concurrency trajectory collector with asynchronous vLLM-TPU and SGLang-Jax integration, then streams variable-length trajectories through a producer-consumer queue rather than waiting for a complete synchronous batch. Composable agent and environment abstractions expose APIs for custom tools, benchmarks, and external systems while preserving multi-turn token handling and lifecycle management. Lightweight RL-specific metrics correlate rollout, training, weight synchronization, model-call, and environment stages with TPU timelines, complementing targeted XProf traces. The stated outcome is a more observable pipeline intended to reduce stalls, keep accelerators utilized, and support agentic RL natively in the JAX/TPU ecosystem.
We terminated a TPU mid-training and it recovered in seconds: Introduction to elastic training with MaxText
Distributed training on multiple TPU machines normally fails as a whole when one worker disappears: collective communication times out, processes exit, and the job restarts from a checkpoint. The article demonstrates elastic training with JAX, MaxText, PathwayS, Orbax, and Cloud TPUs on GKE, using a single CPU-side controller that remains alive while TPU workers execute compiled programs. A Pathways elastic_retry wrapper catches the failure, cleans up partial state, restores the last viable checkpoint, and re-enters the training function without relaunching the workload; the demo returned to training in under two minutes, with no JobSet restarts, after losing 88 steps. It also contrasts pause-and-resume with replica resize, explains direct checkpoint persistence through ENABLE_PATHWAYS_PERSISTENCE=1, and describes planned snapshot-based recovery from host memory.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.