Google Tag Manager (noscript) End Google Tag Manager (noscript) HTML Benchmarking MoE Training on Ironwood, Part 1: Scaling to 8K Chips NOV. 30, 2026 Ran Ran Staff Software Engineer Matt Davidow Staff Software Engineer Nuojin Cheng Software Engineer Shuning Jin Software Engineer Suraj Kolla Software Engineer Zhengxian He Software Engineer Daniel Mandragona Software Engineer Shuwen Fang Software Engineer Ironwood header banner

Overview

Large Mixture-of-Experts (MoE) models stress every part of a training system: compute, memory, and interconnect. To evaluate how Ironwood (TPU7x), Google Cloud's seventh-generation TPU, handles this class of workload, we benchmarked DeepSeek-V3 671B pre-training. As an open-weight, industry-standard model combining multi-head latent attention (MLA), 256 fine-grained routed experts, and multi-token prediction (MTP), DeepSeek-V3 reflects the architectural demands of today's large-scale MoEs. Holding the model, dataset, global batch size, and target validation loss fixed, we measured time to train—the wall-clock time to reach that target—at 2,048, 4,096, and 8,192 chips.

Each Ironwood chip delivers 4,614 TFLOP/s of FP8 compute and 192 GiB of HBM at 7.38 TB/s, and a single pod connects up to 9,216 chips over the inter-chip interconnect (ICI). We trained DeepSeek-V3 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 (EMFU) of 56%. Convergence scaling efficiency was 96% from 2,048 to 4,096 chips and 74% from 2,048 to 8,192 chips. In internal runs, we also measured nearly 100% efficiency from 512 to 2,048 chips, using gradient accumulation to keep the global batch size the same.

We pursued this work in two workstreams. This post covers the first, the FSDP + EP track that built a MaxText recipe matching the reference training setup, scaled it to 8,192 chips, and developed many of the features our final configuration relies on: the FP8 quantization recipe, Pallas kernels for grouped matmuls and token sorting, attention optimizations, MoE token chunking with dropless fallback, rematerialization and tile size tuning, and pre-run warm-up. This track could not hide every collective. At 8,192 chips, the small per-device batch leaves little compute to overlap with communication, so the EP reduce-scatter remains exposed. The batch-split schedule hides nearly all of these collectives, and we will share details about it in Part 2 of this series later this month.

This post explains how we scaled and optimized a 671B-parameter Mixture-of-Experts (MoE) model with MaxText and JAX on Google Cloud TPUs in a matter of weeks. For each optimization, we describe the bottleneck it addressed, how it works, and what it gained, and we close with the lessons that carry over to other large MoE models.

Results

We trained with a global batch of 16,384 sequences of 4,096 tokens at every scale, and each run stops at the first evaluation at or below a log perplexity of 3.6. In one week of optimization, from September 28 to October 5, 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.

  • 2,048 chips: about 2,057 → 3,736 tokens/s/chip (+82%), with EMFU of 42.8%
  • 4,096 chips: about 1,971 → 3,084 tokens/s/chip (+56%), with EMFU of 34.9%
  • 8,192 chips: about 1,568 → 2,501 tokens/s/chip (+60%), with EMFU of 28.9%
image6 (7) Figure 1. Throughput per chip of the FSDP + EP track on Ironwood at 2,048, 4,096, and 8,192 chips. These results are from runs of the FSDP + EP track alone and don't include the batch-split schedule described in Part 2. Throughput includes the evaluation that runs during training.

Scaling

We kept the global batch at 16,384 sequences at every scale, so adding chips divides the same work more finely. Two settings share the batch: the per-device batch size (PBS), the number of sequences each JAX device processes per micro-step, and gradient accumulation (GA), the number of micro-steps per optimizer step. Each Ironwood chip is built from two chiplets, each with one TensorCore, two SparseCores, and 96 GiB of HBM, joined by a die-to-die (D2D) link six times faster than a 1D ICI link. JAX exposes each TensorCore as a device, so chips × 2 × PBS × GA = 16,384. We swept PBS 1, 2, and 4 from 512 to 8,192 chips.

FSDP + EP recipe

An Ironwood pod connects up to 9,216 chips in a 3D torus with 1.2 TB/s of bidirectional ICI bandwidth per chip, so a single slice can keep all of its communication on ICI rather than the data center network (DCN), which provides 100 Gb/s per chip. To take advantage of this, our device mesh uses two axes: heavy fully sharded data parallelism (FSDP) and modest expert parallelism (EP). The 3D torus lets FSDP span the whole slice, but pure FSDP at 8,192 chips would all-gather all 256 experts' weights onto every chip for every layer. Each chip's tokens would also be spread so thinly across the experts that the expert matmuls become HBM-bound. Also, most of the model's tensor dimensions don't divide evenly 16,384 ways, so splitting every weight that finely would require costly padding or relayouts. Adding EP fixes both problems. Each chip gathers only its own experts' weights, which cuts weight traffic and HBM footprint by the EP degree, and pooling tokens across the EP group keeps the expert matmuls compute-bound. We ruled out tensor parallelism (TP), which lowers arithmetic intensity on the small expert dimension (see the arithmetic intensity guide), and pipeline parallelism (PP), whose bubbles outweighed its communication savings at these scales. Table 1 lists the best configuration at each scale in our setting.

Table 1 updated

The two axes play different roles in different layers. The details vary slightly by scale, but at a high level:

  • Attention. In attention, the EP axis carries the batch, acting as data parallelism for activations. Attention weights are small, so at the FSDP size of 1,024 used at 4,096 and 8,192 chips, each FSDP shard would be tiny and its all-gather would be bound by latency rather than bandwidth. We therefore shard the attention weights, along their low-rank query, low-rank key-value, and embedding dimensions, only across the much smaller EP axis, and replicate them across FSDP.
  • MoE layers. The 256 routed experts are split across the EP axis (32 experts per device at EP 8, 16 at EP 16), and each expert's weights are further sharded across the FSDP axis and all-gathered before use. EP uses an all-gather and a reduce-scatter instead of all-to-all. Tokens are all-gathered within each EP group, each device runs its local experts, and the outputs are reduce-scattered back to their home devices. Each token is transferred as a single copy and replicated only on the receiving device, once for each of its top-k experts hosted there. This approach is efficient when the EP group is small and maps onto a ring (a 1D torus). Because the collective sizes are fixed regardless of routing, an imbalanced expert load cannot make any device's transfers a straggler.
  • Evaluation. The evaluation set has 1,024 sequences, fewer than the number of devices, so during evaluation the EP axis acts as context parallelism everywhere except the MoE layer, splitting each sequence across the devices in an EP group.

Strong scaling

image2 (6) Figure 2. End-to-end time vs. chip count at each PBS, with the global batch fixed at 16,384 sequences. The dashed line is linear scaling from the fastest 512-chip run (PBS 4). The box gives a linear fit of end-to-end time against GA for each PBS across all runs.

Up to 2,048 chips, scaling is nearly linear. In Figure 2, each PBS line runs parallel to the dashed linear-scaling line: doubling the chips at a fixed PBS halves GA and speeds up the run by 1.93–2.07×. The linear fits in Figure 2 show why. At a fixed PBS, end-to-end time is a straight line in GA (R² > 0.999). Most of it is micro-step work, which scales with GA, plus a fixed 15–30 seconds per run of once-per-step work such as gradient reduction and the optimizer update. Because that fixed part is small next to end-to-end times at these scales, halving GA nearly halves the time. As Table 2 shows, the fastest configuration from 512 to 2,048 chips (PBS 4) reaches 97–100% scaling efficiency relative to 512 chips, at essentially constant chip time.

Table 2 updated

Past 2,048 chips, there is no gradient accumulation left to remove. At 2,048 chips with PBS 4, GA is already 1, so each further doubling of chips must halve the PBS instead: to 2 at 4,096 chips and to 1 at 8,192. Smaller PBS are less efficient. At 512–2,048 chips, where all three PBS values fit, Figure 2 shows PBS 2 running 6–9% slower than PBS 4 at the same chip count, and PBS 1 running 33–35% slower. As a result, the fastest configuration drops to 81% scaling efficiency at 4,096 chips and 66% at 8,192 (Table 2). Most of the loss at 8,192 chips comes from the smaller PBS, not from the extra chips: compared with PBS 1 at 512 chips, the PBS 1 run at 8,192 chips still reaches 89% of linear scaling. Recovering the rest requires hiding communication behind less compute per device, which is the focus of the batch-split schedule in Part 2.

Optimization

We worked in two phases. First, a roofline analysis bounded what each part of the step could achieve under the FSDP + EP sharding, given Ironwood's per-chip compute, HBM bandwidth, and ICI bandwidth. Then we profiled the step, picked the largest gap between measured and achievable time, optimized it, and measured again. The optimizations fall into five categories, described below.

Kernel optimization

GMM v2. Each routed expert processes only the tokens assigned to it, so the expert layers are grouped matrix multiplications (GMMs) whose per-expert row counts change at every step. Switching from Tokamax's ragged-dot kernel (v1) to MaxText's GMM v2 kernel, which is built on Tokamax GMM v2, improved end-to-end throughput by ~10%. The ragged-dot kernel tiles rows on a fixed grid, so each tile that straddles an expert boundary is loaded (DMA) and computed in full once per expert, then masked. GMM v2 starts tiles at each expert's first row and sizes both the memory loads and the matmul to the valid rows, which cuts most of that waste.

Splash attention. Two changes reduce wasted attention work:

  • Diagonal sub-tile skipping. A causal mask zeroes the upper half of every tile on the diagonal, so part of the visited QK work is wasted: with 4,096-token sequences and the 2,048-token forward-pass tiles of our 8,192-chip recipe, a third of it. Splitting each diagonal tile into a 4 × 4 grid of sub-tiles and skipping the empty ones (sa_qk_diag_skip, sa_qk_diag_grid: 4) cuts that waste to 11%.
  • Skipping segment IDs. With sequence packing, segment IDs stop tokens from attending across documents, at the cost of extra vector-unit work on every computed tile. Our C4 data pipeline instead joins documents into one EOS-separated stream with no boundaries marked, so every sequence is a single segment. Since the segment mask is then a no-op, we skip it (sa_ignore_segment_ids) to avoid that overhead.
image7 (5) Figure 3. Forward-pass ragged sort (top, ragged gather) and unsort (bottom, ragged gather-reduce), shown for 2 EP shards and 4 experts: experts 0–1 are on shard 0 and experts 2–3 on shard 1. Both shards see the same six all-gathered tokens (t0–t5), each routed to its top-2 experts. The sort copies only the rows for the shard's local experts into its padded 9-row buffer and skips the padding rows. The unsort weights each expert output by its routing weight w and sums them into a partial output per token, and a reduce-scatter later combines the partial outputs across shards.

Ragged sort. Before the expert GMMs, each device sorts the tokens routed to its local experts; afterward, it unsorts them, applies the routing weights, and sums the top-k outputs from its local experts (the EP reduce-scatter then completes each token's sum). In the all-gather/reduce-scatter EP path, each device first all-gathers tokens across the EP group, but only a dynamically determined subset of them is routed to the experts on any given rank, so each rank's active token slice is ragged. Without a ragged kernel, the sort and unsort permute the full EP-all-gathered buffer, moving 8× or 16× (the EP degree) more token data than the rank needs. We integrated ragged gather and ragged gather-reduce kernels into MaxText for this path: they read the rank's start and end offsets, computed from the per-expert group sizes at runtime, and use indirect DMA to move only the tokens routed to its local experts. Because gather and gather-reduce are each other's transpose, the backward pass reuses the same two kernels with their roles swapped.

FP8 quantization

FP8 was the largest single win: on 512 chips with PBS=1, it cuts step time by 31%, from 4.375 s to 3.015 s (Figure 4). Ironwood runs FP8 natively in its matrix units: each chip peaks at 4,614 TFLOP/s in FP8, twice its 2,307 TFLOP/s in BF16, and FP8 tensors take half the bytes of BF16 in HBM and over ICI. Our recipe takes advantage of both. Faster matmuls were the smaller part of the gain: switching the matmuls to FP8 saved only 4.7%, because matmuls are only part of each step and quantization adds work outside the matrix units. Even with FP8 splash attention included, compute accounts for only 19% of the total saving. About two-thirds (68%) came from quantized-collective features. Most came from the quantized weight all-gather, which turns the expert weight-gradient all-reduce into a reduce-scatter; the quantized token all-gather and backward pre-quantization add the rest by sending FP8 payloads, which halves their bytes and avoids re-quantizing downstream. Static scaling and weight layout account for the remaining 13%.

Per-feature gains are config-dependent: our 2,048–8,192-chip recipes use a wider FSDP axis than this ablation, and at 2,048 and 4,096 chips a larger PBS, which changes which collectives are exposed and how much of the step is spent in matmuls. The split between compute and communication savings can therefore differ at those scales.

image8 (6) Figure 4. Step time saved by each FP8 feature on 512 chips (PBS=1, GA=1, EP=16, FSDP=64), added cumulatively in the order shown. Each percentage is relative to the step time before that feature was added.

Figure 5 shows how a routed MoE layer uses FP8. In the forward pass, each device quantizes its weight shard to E4M3 before the FSDP all-gather (quantized weight all-gather, QWAG) and its tokens before the EP all-gather (quantized token all-gather, QTAG). Both collectives move half the bytes. The ragged sort moves FP8 rows, and the up-projection GMM consumes FP8 on both sides without re-quantizing. The down-projection input, the BF16 output of SwiGLU, is quantized inside the GMM kernel. In the backward pass, the gradient of the combine is quantized to E5M2 with a fixed scale before the EP all-gather, so the all-gather and unsort (a ragged gather) also move FP8. The router stays in FP32, and the weight-gradient reduce-scatter stays in BF16.

image4 (7) Figure 5. FP8 data flow in a routed MoE layer. Diamonds mark quantization points. Forward activations and weights use a static scale that clips values to ±224 and maps that range onto E4M3's full ±448; backward gradients use E5M2 with a fixed scale tuned per chip count. All scales are per-tensor. Table 3 updated

Static scales are fast, but they need care. A dynamic scale computes the absolute maximum of each tensor on every step, which adds a reduction and, for sharded tensors, a cross-device collective. Static scales remove that work, and they let each device cast its own shard to FP8 before an all-gather without first agreeing on a global maximum. The cost is tuning. We calibrated the backward bounds from runs with dynamic scales and tuned them per scale. For numerical stability, the router and gate logits stay in FP32, and the LM head stays in BF16.

Chunking strategy

Token chunking. The flag num_moe_token_chunks splits a routed MoE layer's tokens into N chunks along the sequence. Each chunk runs the full path (token all-gather, top-k, sort, GMMs, unsort, reduce-scatter), so the routing buffers and intermediate activations only need to hold one chunk at a time. Chunking also gives XLA the opportunity to overlap one chunk's token communication with another chunk's expert compute.

Ragged buffer factor. Each device needs a buffer for the tokens routed to its experts. A balanced load needs (all-gathered tokens / EP) × top_k rows. In the worst case, every token sends all of its copies to the experts on one device, which needs an EP times the balanced buffer: 8× at EP 8 and 16× at EP 16. Reserving that much HBM for every layer is not affordable, so ragged_buffer_factor sizes the buffer between the two, trading HBM against the chance of overflow. Like the original DeepSeek-V3 training, our recipe is dropless, so an overflow must never drop tokens. We added two fallback modes, selected with moe_dropless_fallback.

Table 4 updated

Tuning

At 2,048 chips with a PBS of 4, HBM usage is already about 90%, so that recipe uses full rematerialization. The 4,096- and 8,192-chip recipes use a custom rematerialization policy (remat_policy: custom) that keeps selected tensors in HBM, so the backward pass reads them instead of recomputing them:

  • Layer inputs: the input to each decoder layer.
  • Attention: the low-rank and full query and key, value projections of MLA; the attention output with its log-sum-exp; and the output projection.
  • MoE: the routing maps, which are the top-k expert IDs, ragged-sort permutations, sorted token indices, and group sizes.

We also tuned the tile sizes of the flash attention and GMM v2 kernels separately at each scale. For example, up-projection forward tiles drop from 512 rows at 2,048 chips to 256 rows at 4,096 and 8,192 chips, and up-projection weight-gradient tiles drop from 1,024 to 512 rows. Evaluation, which splits each sequence across chips, also uses smaller attention blocks at 8,192 chips: 256 tokens instead of 512.

Warm-up

We measure time to train from the start of training, so a slow first step counts directly toward it. On 8,192 chips, our first step took about 55s, compared with about 4s at steady state, and most of that was spent waiting for the first training batch. Two causes stood out:

  • Data layout. TFDS assigns files to hosts before applying the seeded file shuffle, so hosts read files they don't need. We resharded the dataset from 2,048 to 16,384 files, one per device at 8,192 chips, so each host reads only the files for its own devices.
  • Compilation. The train and eval programs compiled after the clock started. We now compile both and run them once on synthetic data before training begins, so no training or evaluation data is read before the clock starts.

Summary

In one week, the FSDP + EP track turned a reference-matching MaxText recipe into one that scales to 8,192 Ironwood chips at 1.56–1.82x its starting throughput per chip with every run inside a single ICI domain. At 2,048 chips, it reached 3,736 tokens/s/chip with an EMFU of 42.8%, and scaling from 512 to 2,048 chips was nearly 100% efficient, using gradient accumulation to keep the global batch size the same. Past 2,048 chips, efficiency fell to 66% at 8,192 chips, mostly because each device's batch shrank: at a fixed PBS of 1, 8,192 chips still reached 89% of linear scaling from 512 chips.

Five lessons carry over to other large MoE models:

  • Choose a sharding strategy that fits the scale. We paired heavy FSDP across the single ICI domain with modest EP (8–16). EP pools tokens so each expert matmul stays compute-bound, and it cuts the expert weights each chip gathers. We ruled out TP, which lowers arithmetic intensity on the 2,048-wide experts, and PP, whose bubbles outweighed its savings at these scales.
  • Identify the bottleneck before quantizing. In our 512-chip FP8 ablation (PBS 1, EP 16), where the step was communication-bound, about two-thirds of FP8's gain came from quantized collectives rather than faster matmuls. How the gain splits depends on how much of a step goes to communication versus matmuls, and that balance shifts with batch size and sharding.
  • Use the largest PBS that fits, and reach the global batch with gradient accumulation. Accumulation adds little cost per sequence: each micro-step does the same work, and only a small amount of once-per-step work, such as gradient reduction and the optimizer update, sits on top. Shrinking the PBS costs more, because each micro-step still moves the same weights but has less compute to hide that communication behind.
  • Plan the chip count around the global batch. With a fixed global batch of 16,384 sequences, each device can keep its most efficient workload of 4 sequences per micro-step up to 2,048 chips. Beyond that, each device gets fewer sequences per micro-step, and scaling depends on hiding communication behind less compute.
  • Make dropless routing cheap, not free. A capped buffer with a fallback avoids reserving worst-case memory in every layer while never dropping a token. Choose the fallback by how often overflows happen: replaying the whole step is cheapest when they're rare, and a per-layer dropless path is better when they're frequent.

Much of this work carried into our final configuration. What this track could not solve was the large, exposed EP reduce-scatter at 8,192 chips, where each device has the least compute to hide it behind. Part 2 describes the batch-split schedule that hides nearly all of it.

Reproduce it yourself

The recipes for all three scales (2,048, 4,096, and 8,192 Ironwood chips) are available in the MaxText repository at benchmarks/deepseek3_671b_tpu7x. Each recipe includes the full configuration used in this post, so you can reproduce our results or use them as a starting point for your own MoE models.

Acknowledgements

This optimization work was a massive collaborative effort across engineering and management teams. We would like to express our gratitude to the following contributors who drove this initiative to success:

Ran Ran, Matt Davidow, Nuojin Cheng, Shuning Jin, Suraj Kolla, Zhengxian He, Daniel Mandragona, Shuwen Fang, Snehal Verma, Amanda Tomlinson, Burkay Donderici, Kevin Wang, Jesse Lu, Caitlin Stanton, Mohamed Omar, Vipul Aneja, Cory Kleinheksel, Xiongfei Wei, Ani Udipi, Vaibhav Singh, Jet Jiang, Andi Gavrilescu, Durlabh Malik ,Deepak Patil, Carlos Araya.

posted in: Previous Next Related Posts From Files to Cited Answers in One API Call: Managed Ingestion and SearchDocuments in Agent Retrieval Gemini AI How-To Guides Learn

From Files to Cited Answers in One API Call: Managed Ingestion and SearchDocuments in Agent Retrieval

NOV. 24, 2026
Accelerating development for massive Git repositories Mobile AI Case Studies Announcements

Accelerating development for massive Git repositories

NOV. 17, 2026
Did the user ask for this? Securing AI agents against intent hijacking with Semantic governance policies AI Cloud Case Studies Solutions

Did the user ask for this? Securing AI agents against intent hijacking with Semantic governance policies

NOV. 23, 2026