# Google Open-Sources TPU Sync Cutting MoE KV Latency 90%

*Updated on November 10, 2026*

Google Cloud has open-sourced `TPU Sync` under the Apache 2.0 license, releasing a native C++ direct memory access (DMA) and key-value (KV) cache orchestration library designed to eliminate memory-transfer stalls on Cloud TPU clusters. Tested on `235-billion` to `480-billion-parameter` open-weight Mixture-of-Experts (MoE) models running on `Cloud TPU v7x (Ironwood)` and `TPU v6e`, `TPU Sync` cuts cross-tier KV cache transfer latency by over `90%` and lowers average Time to First Token (TTFT) by `90%` in disaggregated prefill/decode and `64K`-context prefix-caching workloads.

As enterprise AI workloads shift from stateless single-turn completions to million-token coding agents and multi-turn reinforcement learning (RL) rollouts, accelerator High Bandwidth Memory (HBM) fills up rapidly with contextual KV blocks. When KV state has to move between prefill nodes, decode nodes, and host RAM through standard Python ML frameworks, Python Global Interpreter Lock (GIL) contention, XLA graph recompilations, and CPU bounce-buffer copies leave expensive TPU Matrix Multiply Units (MXUs) sitting idle.

`TPU Sync` bypasses those bottlenecks by treating TPU HBM (`Tier 1`), page-locked host CPU DRAM (`Tier 2`), local NVMe SSDs / Google Cloud Managed Lustre (`Tier 3`), and the data center network (DCN) as a single co-designed memory hierarchy. On a `Qwen3 235B` MoE workload, moving live KV blocks drops from several seconds down to roughly `230 milliseconds`, sustaining up to `223 GB/s` per Ironwood host across PCIe Gen5 (`87%` of the `256 GB/s` hardware ceiling) and `~350 Gbps` across dual `200 Gbps` NICs.

For ML platform teams running `vLLM-TorchTPU`, `SGLang-TorchTPU`, or `llm-d` on Google Kubernetes Engine (GKE), `TPU Sync` ships with Python wheels for both JAX (`tpu-sync-jax`) and PyTorch (`tpu-sync-torch`). However, infrastructure engineers should treat current PyPI builds as early-stage infrastructure: Google's repository explicitly notes that APIs are evolving rapidly, RL weight-broadcast benchmarks are not yet published, and `tpu-sync-torch` requires a matching internal-aligned `torch_tpu` build.

<a aria-hidden="true" id="executive-fast-facts"></a>  Fast Facts

- **Project &amp; License**: `TPU Sync`, released under `Apache 2.0` on [Google's official tpu-sync GitHub repository](https://github.com/google/tpu-sync) alongside the [Google Cloud TPU Sync engineering blog](https://cloud.google.com/blog/topics/ai-infrastructure/introducing-tpu-sync-fast-kv-cache-and-weight-transfer-on-tpu).
- **Latency &amp; TTFT Reduction**: Slashes KV transfer overhead by `>90%` and reduces average `TTFT` by `90%` on `235B–480B` MoE models (`Qwen3 235B` KV transfer drops to `~230 ms`).
- **Hardware Bandwidth Achieved**: Up to `223 GB/s` bidirectional D2H/H2D PCIe Gen5 throughput per `TPU v7x (Ironwood)` host (out of `256 GB/s` max), `~192 Gbps` on a single `200 Gbps` NIC, and `~350 Gbps` across dual `200 Gbps` NICs.
- **Warm-Boot Crash Survival**: Stores offloaded Host-DRAM KV caches and LRU metadata in OS POSIX Shared Memory (`/dev/shm`), surviving serving container restarts without cold-start re-prefill.
- **Serving Stack Integrations**: Plugs into `vLLM-TorchTPU` (`KVConnector`), `SGLang-TorchTPU`, and `llm-d 1.0` on GKE for prefix-cache-aware routing, absorbing the earlier `TPU Raiden` codebase.

## Architectural Breakdown: Standard JAX/PyTorch Transfers vs. TPU Sync C++ DMA

Why do conventional KV cache offloading implementations struggle to saturate PCIe Gen5 and 200G Ethernet on TPUs? Normally, moving a KV slice out of TPU HBM requires acquiring a PJRT buffer lock, stalling active kernels, converting TPU physical tile layouts into row-major host buffers, and serializing metadata in Python.

| Data-Path Mechanism | Standard Python / XLA Serving | Google TPU Sync (`C++` Native Core) | Measured Infrastructure Gain |
|---|---|---|---|
| **Buffer Access &amp; Locking** | Exclusive PJRT lock + bounce copy | **Zero-copy `PJRT_RawBuffer` aliasing (no lock)** | Overlaps DMA transfers with live MXU kernels |
| **Tensor Memory Layout** | Converts TPU tiles to/from host format | **Layout-preserving native TPU physical tiles** | Lands ready for immediate MXU execution |
| **Graph Compilation Path** | Triggers XLA graph ops / recompiles | **Executes in C++ outside XLA graph** | Zero runtime XLA compilation on resharding |
| **PCIe Gen5 Host Throughput** | Bottlenecked by GIL &amp; CPU copies | **Up to 223 GB/s (of 256 GB/s max) on Ironwood** | Turns Host DRAM into ultra-fast Tier 2 cache |
| **Container Restart Behavior** | Full KV cache lost (cold re-prefill) | **POSIX `/dev/shm` warm-boot persistence** | Instant cache re-attachment after pod upgrades |

Four low-level engineering choices drive the `90%` latency drop:

1. **In-Place `PJRT_RawBuffer` Aliasing With DMA Pacing**: Instead of locking static KV cache tensors during active prefill or decode steps, `TPU Sync` constructs raw buffer descriptors over `DmaMap`-registered page-locked host RAM and paces DMA chunks so background transfers never starve MXU kernel launches.
2. **Layout-Preserving TPU Tile Transmission**: Tensors keep their exact physical TPU tile layout across HBM, host RAM, `/dev/shm`, and multi-host NICs, eliminating CPU layout-transpose overhead.
3. **Disaggregated Prefill-to-Decode Host Streaming**: Compute-bound prefill nodes asynchronously DMA completed KV blocks to pinned host RAM and stream them host-to-host (`~350 Gbps` dual-NIC NUMA-striped) directly into decode-node HBM while earlier decode tokens are still generating.
4. **POSIX `/dev/shm` Crash Persistence**: Backing Tier-2 host DRAM caches with `/dev/shm` means rolling out a container image patch or recovering from an OOM worker restart preserves terabytes of precomputed enterprise system-prompt and multi-turn agent KV state in host memory.

## Deployment Prerequisites for GKE and Cloud TPU Operators

Google validated its internal benchmarks on `TPU v7x (2x2x1)` topologies running `tpu-inference v0.24.0`, `JAX 0.10.2`, and `libtpu 0.0.42.1` (and also supports `TPU v6e`). Teams testing `TPU Sync` on GKE should size `/dev/shm` explicitly in pod specs so POSIX shared memory does not hit Kubernetes' default `64 MiB` container tmpfs ceiling:

```
# GKE Pod volume configuration for TPU Sync Tier-2 Host DRAM + Warm-Boot KV Cache
volumes:
- name: dshm-kv-tier2
 emptyDir:
   medium: Memory
   sizeLimit: 512Gi
containers:
- name: vllm-torchtpu-worker
 image: us-docker.pkg.dev/cloud-tpu-images/inference/vllm-tpu:latest
 volumeMounts:
   - mountPath: /dev/shm
     name: dshm-kv-tier2
```

Before moving production traffic onto `TPU Sync`, verify two operational boundaries: pin deployments to the repository's documented last-known-good commit SHA rather than floating `main` builds, and treat the Pathways/JAX RL weight-synchronizer module as experimental until Google publishes multi-node RL throughput baselines.

  Next Steps

1. **Benchmark Tier-2 Host DRAM Prefix Caching on TPU v6e or v7x**: Clone `google/tpu-sync` pinned to the last-known-good commit and enable the `vLLM-TorchTPU` `KVConnector` on long-context (`64K–256K`) agent workloads with shared system prompts.
2. **Expand `/dev/shm` Mounts in GKE TPU Node Pools**: Override Kubernetes' default `64 MiB` `/dev/shm` limit to match available host DRAM headroom (`256Gi–512Gi`) so `TPU Sync` can persist LRU-evicted KV blocks across container restarts.
3. **Pair Disaggregated Prefill/Decode With `llm-d 1.0` Routing**: Combine `TPU Sync` H2H streaming with prefix-cache-aware request routing in `llm-d` on GKE so multi-turn agent follow-ups hit warm host-DRAM pools instead of recomputing prefill.