Loading…
Topic
TPU
18 posts about TPU. Every summary links to the original.
- 18 posts
- 3 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.
TPU Model Design Considerations and Optimization Guide
Google’s TPU codesign guide provides hardware-grounded rules for maximizing performance on TPUs, which trade general-purpose scheduling for wide systolic arrays and custom interconnects. Shape rules require aligning every reduction and output dimension to 256 and using static shapes with bucketing and masking to avoid recompilation. Architecture choices include LatentMoE to compress routed token traffic, shared experts to reduce HBM reads, and block-scaled FP8 for memory-bound layers. Parallelism strategies map DP, TP, EP, CP, and PP axes directly to physical ICI links, with EP placed on a short 1D torus axis. Measured benchmarks show pure systems tuning lifted an open 30B MoE from 12% to 23% MFU before any model change, and 256-aligned MoEs run at roughly 2x the throughput of unaligned models.
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.
Announcing New vLLM and SGLang Inference Engines on TPU
Google announced new PyTorch-native backends for vLLM and SGLang inference engines on TPU, co-developed with Inferact and RadixArk. Built on TorchTPU, the engines make TPU a native PyTorch device with standard tensor management, eager execution, and torch.compile via XLA, using a platform-plugin design that reuses each framework’s worker model and scheduler. They support production workloads including agentic multi-turn, interactive low-latency, high-throughput batch, long context, disaggregated serving, and multimodal models, with custom Pallas kernels called as PyTorch custom operators. Features include automatic prefix caching, speculative decoding with MTP, EAGLE-3, DFlash, DSpark and n-gram drafters, KV cache offloading to host memory and Managed Lustre, and TPU Sync for efficient cache transfer between hosts. Both engines are running in production at Meta and preview customers, with public benchmarks showing industry-leading cost per million tokens at 2.01 cents on Ironwood TPU, and a community contribution TPU capacity pool is available for developers.
Integrating TorchTPU into TorchTitan and Optimizing Models for TPU
TorchTitan TPU is a fork of Meta’s TorchTitan that enables PyTorch model training on Google Cloud TPUs using the TorchTPU native backend with minimal device initialization changes. SimpleFSDP replaces FSDP2 hooks with DTensor parametrization, making all-gathers and reduce-scatters ordinary nodes in the traced graph for compiler scheduling. The Graph Trainer captures the full forward, loss, and backward step as one XLA program via make_fx, achieving 51-52% MFU on Qwen3-8B with functional AdamW. On Llama 3 405B, TorchTitan TPU reaches about 57% MFU on up to 1,024 chips, and a weak-scaling test of Qwen3 235B MoE retained 92% of per-chip throughput from 64 to 8,192 chips. The repository includes an optimization playbook, a coding-agent model-onboarding skill, and supports over 500 Hugging Face models through a Transformers backend.
Hugging Face ❤️ TorchTPU: TPUs, Natively
TorchTPU adds a native PyTorch backend for Google TPUs, eliminating the need for torch_xla or JAX. Installing it on a TPU VM requires a single pip command with a CPU-only torch index. Users can load any Hugging Face model onto a TPU with device_map=“tpu” and run it in eager mode without code changes. Diffusers pipelines also support TPU natively, requiring only pipe.to(“tpu”) for eager execution or an optional compile call for deployment. The Kernels Hub provides ready-to-use TPU kernels written in Pallas, which can accelerate MoE models by over 20× at large batch sizes, as demonstrated with Qwen3-30B-A3B. The Hugging Face team is continuously testing TPU support, with 96.5% of tests passing and upstream fixes for discovered issues, including bugs in StaticCache and Qwen3 tensor-parallel plans.
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.
Autonomous LLM post-training with Tunix on TPUs
autofinetune applies autonomous research loops to LLM post-training, covering supervised fine-tuning (SFT) and reinforcement learning with GRPO through Tunix, Gemma, Cloud TPUs, Antigravity CLI, and Gemini Flash 3.7. A human defines the arena in program.md and supplies a self-contained run.py, while an agent edits hyperparameters, launches jobs, evaluates a target metric, keeps winning Git commits, reverts regressions, and logs results in results.tsv. On FunctionGemma 270M with google/mobile-actions, 20 Cloud TPU v5e-1 experiments tested LoRA settings, optimization choices, schedules, batch size, and seeds without changing the dataset, epochs, or architecture. A second study used Gemma 3 1B, GSM8K, and Cloud TPU v6e-1 for 40 GRPO experiments over two to three days, improving the combined numerical-and-format reward by about 10%.
Expanding our use of Google Cloud TPUs
Anthropic announces plans to expand its use of Google Cloud technologies, including up to one million TPUs, in an expansion worth tens of billions of dollars. The company expects the deployment to bring well over one gigawatt of capacity online in 2026, increasing resources for customer demand, testing, alignment research, and responsible deployment at scale. Anthropic says it serves more than 300,000 business customers and that large accounts, defined as customers representing more than $100,000 in run-rate revenue, have grown nearly sevenfold in the past year. The company describes a diversified compute strategy using Google TPUs, Amazon Trainium, and NVIDIA GPUs, while remaining committed to Amazon as its primary training partner and cloud provider and continuing Project Rainier.
Google for Developers Blog - News about Web, Mobile, AI and Cloud
The page presents six featured Google developer articles spanning multi-agent systems, content credentials, TPU optimization, agent plugins, Go, and Genkit Go. One article identifies bidirectional MCP, async event buses, unified validation, and tiered routing as recurring patterns in successful AI Agents Challenge submissions. Another introduces Credentio, an open-source C++ library for local-first C2PA validation, while a HeyGen case study reports a 1.86x speedup for Avatar IV on Trillium TPUs using torchax, XLA, FSDP, Ulysses sequence parallelism, and custom kernel/compiler optimizations. The collection also covers Agent Plugins 1.0.0’s plugin.json directory specification and Genkit Go’s progressive-disclosure Agent Skills based on SKILL.md bundles. A final article argues that Go’s compiler, toolchain, readability, and backward compatibility provide guardrails for reviewing and maintaining AI-generated software.
Enterprise-Grade Precision for Long-Context Multimodal Embedding Inference on Cloud TPU
Embedding models convert text, images, and audio into dense vectors used for semantic search, recommendation, intent classification, content discovery, and clustering. The post describes production support for long-context Qwen3 Embedding models on Cloud TPUs through native vLLM TPU integration and GKE Custom Compute Classes, allowing prioritized autoscaling across TPU and GPU capacity pools. Its implementation pads vocabulary tensors for hardware-safe sharding, hardens lazy loading, pre-warms sharding-aware JAX/XLA compilation caches, and uses a hybrid StepPool with CachedRequestState to preserve pooling state during chunked prefill and preemption. Parity evaluations target cosine similarity of at least 0.999 for text and 0.995 for multimodal inputs; on TPU Ironwood, Qwen3-Embedding-8B reached 83,996 total tokens per second and 5.13 requests per second at 16K+ sequence length with bf16 and TP=4.
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.
How to use Google microbenchmarks for evaluating TPU performance
Evaluating TPU performance requires measurements beyond product specifications, because real-world behavior depends on architecture and workload constraints. The suite measures network collectives, compute, HBM bandwidth, host transfers, and Ragged-Paged Attention primitives, using metrics such as GB/s, latency, TFLOPs, MFU, and TTFT-related throughput. Its src and configs directories provide implementations and tunable parameters, while sample Kubernetes recipes connect measurements to TPU architecture and runtime behavior. Roofline analysis uses peak MXU throughput and HBM bandwidth to distinguish compute-, memory-, and network-bound workloads and guide kernel, sharding, or rematerialization choices. In a 110B MoE workload on a 4x4x4 TPU 7x configuration, microbenchmark-guided changes addressed ICI stalls and memory-bound attention, reducing training step time by 21.2%.
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.
Run Ray on TPU, Part 1: The foundations
Ray 2.55 makes Google Cloud TPUs a first-class accelerator in Ray, with official APIs, pre-built images, and core-library support rather than the earlier experimental path. The central constraint is TPU slicing: a multi-host workload must land on one intact slice because its hosts communicate through the slice’s ICI (Inter-Chip Interconnect). On GKE, the Ray Operator installs KubeRay and a TPU webhook; the webhook labels hosts, while Ray Core uses those labels to reserve a whole slice atomically through the public slice_placement_group() API, with topology and accelerator version as inputs. The guide shows node selection by TPU generation and topology, a multi-host numOfHosts field, and a RayCluster manifest that brings up one worker per host. Ray AI libraries such as Data, Train, and Serve generally invoke this placement primitive themselves, while direct use targets custom distributed workloads; the API is public but alpha.
Systems Engineering Playbook: Optimizing Qwen 3.5-397B MoE on Ironwood (TPU7x)
Serving Qwen3.5-397B, a 397-billion-parameter sparse Mixture-of-Experts model, on Ironwood (TPU v7x) requires fitting roughly 400 GB of weights into HBM while sustaining utilization across contrasting workloads. The report applies a modular, model-agnostic playbook built from reusable JAX/Pallas kernels and hardware-aware cost models, focusing new work on Gated DeltaNet linear attention and Attention Data Parallelism while integrating changes into vLLM and SGLang. The architecture activates exactly 17 billion parameters per token and combines 15 repeating blocks of three GDN layers and one GQA layer. Benchmarks use a single host with four Ironwood chips, eight logical devices, 8K/1K prefill-heavy and 1K/8K decode-heavy workloads, and concurrency tiers from 64 to 512. Between April and June 2026, stated optimizations improved inference performance by approximately 4.7x for 512-concurrency prefill-heavy workloads and 3.1x for decode-heavy workloads.
Unlocking the Power of the TPU Stack: Introducing our new Developer Hub
Google Cloud has launched the TPU Developer Hub, an educational resource for model builders, optimizers, and developers working with TPU infrastructure and its supporting software stack. It organizes guidance across the developer lifecycle, covering pre-training, post-training, and inference, with material on hardware architecture, infrastructure consumption modes, and software capabilities including specialized compiler technology and XLA. Resources also address PyTorch migration and deployment, XProf-based tracing and observability, multi-chip parallelism, Pallas kernels, KV cache offloading, networking, and security for distributed workloads. The hub combines interactive Colabs, open-source code recipes, and deep-dive documentation, with content intended for both manual browsing and AI-assisted development. Its stated purpose is to help users select appropriate TPU infrastructure, diagnose bottlenecks, optimize model performance, and move from concepts toward production through practical, regularly updated guidance.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.