For Google’s TorchTPU Sprint, I served Gemma 4 26B-A4B, a mixture-of-experts model, on a Cloud TPU v6e-4 with vLLM-TorchTPU, and looked for where each decode step really spent its time. The repository holds the benchmarks, the patches and the results.
What I found
- FP8 is the slow format on v6e. The v6e MXU multiplies BF16 and INT8, so FP8 weights are converted on every step. Requantizing to INT8 was faster at every load.
- A broken speculative-decoding drafter. The Gemma 4 MTP drafter keeps its own LM head, which the loader skipped. Loading it made the drafter’s guesses useful again.
- Half the step was masked attention. At 64 requests, attention took 52% of each decode step. The kernel computed each short sequence as one 8,192-token block, so a 300-token sequence was 96% masked. Computing in 512-token blocks cut attention from 8.8 to 1.7 ms per step.
- Smaller wins. Skipping padded tokens in the MoE layers, an exact top-k sampler, and draft lengths that fill the token buckets.
Results
On ShareGPT conversations, on the same four chips, output throughput went from 2,025 to 5,346 tokens/s at 64 requests (2.6×) and from 108 to 559 at one request (5.2×). GSM8K stayed at 96.2%, against 96.6% for the FP8 checkpoint I started from.
I sent four of these changes upstream to vLLM-TorchTPU, listed below.