|
| 1 | +# Gemma 4 MTP Speculative Decoding GKE Benchmark Results |
| 2 | + |
| 3 | +This report documents the performance results of running **Gemma 4 31B IT** with **Multi-Token Prediction (MTP)** speculative decoding on a Cloud TPU v6e-4 node pool under GKE. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## 1. Test Environment |
| 8 | + |
| 9 | +* **Platform:** Google Kubernetes Engine (GKE) |
| 10 | +* **TPU Hardware:** Cloud TPU v6e-4 slice (4 chips, 64GB total HBM) |
| 11 | +* **TPU Reservation:** `<tpu-reservation>` |
| 12 | +* **Model:** `google/gemma-4-31B-it` (FP8 quantized using Qwix) |
| 13 | +* **Speculative Assistant:** `google/gemma-4-31B-it-assistant` (FP8 quantized, 5 draft tokens) |
| 14 | +* **VLLM Container:** `vllm/vllm-tpu:nightly-20260611-1043491-248e33c` |
| 15 | +* **Quantization:** Weight FP8, Activation FP8 (using dynamic runtime patches) |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## 2. Benchmark 1: ShareGPT serving dataset (100 prompts) |
| 20 | + |
| 21 | +The benchmark client sent 100 prompts from the ShareGPT dataset at a rate of 10.0 requests per second. |
| 22 | + |
| 23 | +### Run 1: Cold Start (Dynamic JAX Compilations) |
| 24 | +During the first run, the JAX compilation cache was empty, requiring the server to compile target and proposal execution shapes on-the-fly. This blocked the engine event loop during compilation events. |
| 25 | +* **Successful requests:** 100 / 100 |
| 26 | +* **Acceptance rate:** 60.78% (Mean acceptance length: 4.04 out of 5 tokens) |
| 27 | +* **Peak output token throughput:** 416.00 tokens/s |
| 28 | +* **Total duration:** 1660.32 seconds (27.6 minutes, heavily skewed by compilations) |
| 29 | +* **Mean TTFT:** 579.75 seconds |
| 30 | + |
| 31 | +### Run 2: Warmed Up (Cached JAX Compilation Graphs) |
| 32 | +The second run reused the populated JAX compilation cache (`/root/.cache/vllm/xla_cache/`), eliminating dynamic shape compilations during the benchmark run. |
| 33 | +* **Successful requests:** 100 / 100 |
| 34 | +* **Benchmark duration:** 73.57 seconds |
| 35 | +* **Request throughput:** 1.36 req/s |
| 36 | +* **Output token throughput:** 315.92 tokens/s |
| 37 | +* **Peak output token throughput:** 448.00 tokens/s |
| 38 | +* **Total token throughput:** 648.65 tokens/s |
| 39 | +* **Mean TTFT:** 50.26 seconds *(Note: includes the initial ~50s JAX HLO compilation deserialization/loading phase from disk to TPU HBM on the very first query)* |
| 40 | +* **Warmed execution time (99 prompts):** ~17.01 seconds (~5.8 req/s throughput) |
| 41 | +* **Time per Output Token (TPOT):** |
| 42 | + * **Mean TPOT:** 38.46 ms |
| 43 | + * **Median TPOT:** 26.59 ms |
| 44 | + * **P99 TPOT:** 121.84 ms |
| 45 | +* **Inter-token Latency (ITL):** |
| 46 | + * **Mean ITL:** 122.42 ms |
| 47 | + * **Median ITL:** 113.59 ms |
| 48 | + * **P99 ITL:** 176.32 ms |
| 49 | +* **Speculative Decoding Alignment:** |
| 50 | + * **Acceptance rate (%):** 64.87% |
| 51 | + * **Acceptance length:** 4.24 (out of 5 draft tokens accepted on average) |
| 52 | + * **Draft acceptance rate per position:** |
| 53 | + * Position 0: 72.56% |
| 54 | + * Position 1: 66.06% |
| 55 | + * Position 2: 63.55% |
| 56 | + * Position 3: 61.95% |
| 57 | + * Position 4: 60.26% |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 3. Benchmark 2: Prefix Repetition (6k Context) |
| 62 | + |
| 63 | +This test measured performance under heavy context length and concurrency. 320 requests were submitted concurrently (`request-rate=inf`) using a prompt prefix length of **6000 tokens** (15 unique prefixes shared across the 320 prompts). |
| 64 | + |
| 65 | +* **Successful requests:** 315 / 315 |
| 66 | +* **Benchmark duration:** 291.67 seconds (4.8 minutes) |
| 67 | +* **Total input tokens processed:** 1,970,653 tokens |
| 68 | +* **Total generated tokens:** 63,000 tokens |
| 69 | +* **Total token processing throughput (Prefill + Gen):** 6,972.36 tokens/s |
| 70 | +* **Output token throughput:** 216.00 tokens/s |
| 71 | +* **Peak output token throughput:** 233.00 tokens/s |
| 72 | +* **Prefix Cache Hit Rate:** **62.9%** (reused KV cache keys for shared prefixes) |
| 73 | +* **Mean TTFT:** 176.82 seconds *(Note: reflects queue wait time since all 315 requests were sent concurrently and processed in batches)* |
| 74 | +* **Time per Output Token (TPOT):** |
| 75 | + * **Mean TPOT:** 131.21 ms |
| 76 | + * **Median TPOT:** 58.35 ms |
| 77 | + * **P99 TPOT:** 851.82 ms |
| 78 | +* **Inter-token Latency (ITL):** |
| 79 | + * **Mean ITL:** 446.72 ms |
| 80 | + * **Median ITL:** 233.73 ms |
| 81 | + * **P99 ITL:** 841.56 ms |
| 82 | +* **Speculative Decoding Alignment:** |
| 83 | + * **Acceptance rate (%):** 48.98% |
| 84 | + * **Acceptance length:** 3.45 (out of 5 draft tokens accepted on average) |
| 85 | + * **Draft acceptance rate per position:** |
| 86 | + * Position 0: 62.25% |
| 87 | + * Position 1: 49.99% |
| 88 | + * Position 2: 46.38% |
| 89 | + * Position 3: 43.76% |
| 90 | + * Position 4: 42.53% |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## 4. Key Performance Insights |
| 95 | + |
| 96 | +1. **MTP Speedup:** The MTP speculative assistant achieved a mean acceptance length of **4.24 tokens** on ShareGPT and **3.45 tokens** on Prefix Repetition. This provides a **3.5x to 4.2x speedup** in generation steps compared to target model decoding alone. |
| 97 | +2. **Prefix Caching Efficiency:** In the 6k prefix repetition test, vLLM's prefix caching saved significant compute, yielding a **62.9% prefix hit rate**. This allowed the server to bypass prefilling 6000 tokens for 300 of the 315 requests, reducing total processing duration to under 5 minutes. |
| 98 | +3. **Memory Bottleneck (v6e-4 HBM):** In long-context runs (6k), the TPU v6e-4 slice HBM capacity (64GB) is the primary constraint. Running a 31B model leaves limited KV cache block space. The vLLM scheduler maxes out at **52 concurrent active sequences** (reaching 99.9% cache usage). Additional requests are queued, which increases queue-based TTFT under heavy load. |
| 99 | +4. **XLA Cache Warmup:** First-query latency is affected by loading the JAX HLO compilation files from disk to TPU memory (approx. 50s). Subsequent queries process with native latency (26ms median TPOT). |
0 commit comments