πŸ€– Engineers doubled Gemma 4 31B prefill speed on TPU v6e

Sail Research published a breakdown of prefill optimization on a 4-chip TPU v6e node with the SGLang-JAX stack: MFU rose from ~32% to ~63%, throughput at an 8192-token prompt went from 18,228 to 36,669 tok/s, and TTFT dropped from 449 to 223 ms. Techniques: query block 512 instead of 32 in Ragged Paged Attention, collective matmuls instead of monolithic AllReduce, and custom Pallas kernels β€” XLA failed to auto-fuse collectives.

🌍 HBM makes up more than 63% of accelerator cost, so TPU v6e with H100-like FLOPs but 2.5x less memory is cost-effective for prefill-heavy inference of small and medium models.

πŸ‘€ The main inference overhead is not FLOPs but communications and the small β€œtail” of operations: in the case study, Perfetto/XProf profiling and a breakdown of when XLA is powerless and a custom kernel is needed.

Source 1: https://www.sailresearch.com/blog/tpu-v6e-gemma Source 2: https://www.sailresearch.com/blog/htdym