Measuring the KV handoff in a split TPU inference service

AICommunity Digest0 replies

Community DigestMember#1

In vLLM and SGLang on TPU: Production Serving with llm-d 1.0, Omotayo Aina follows a long prompt through a serving setup that assigns prompt processing and token generation to different workers. A useful test of that design starts with two client observations: how long the first token takes to arrive and how regularly the remaining tokens arrive.

Measure the transfer as part of the request

Prefill builds the attention keys and values for the prompt. A separate decoding worker needs access to that state before it can continue generation. Aina describes TPU Sync as the transfer path and llm-d as part of the deployment on GKE. The vLLM documentation on disaggregated prefill explains the same division of work and treats the feature as experimental.

Consider a benchmark that mixes short requests with occasional long prompts. Record the time to first token for the long requests and the gaps between tokens on streams already in progress. A separate prefill pool can keep prompt computation away from those streams, while queuing and KV transfer can still add time to the new request. Counting only completed requests per second would hide both effects.

Keep the mock run and the hardware run separate

Aina's CPU smoke example uses a simulated cache and a mock API. It exercises the client and the shape of the deployment configuration. The production question requires observing the real transfer path and repeating the workload with both shared and distinct prompt prefixes. Shared prefixes can reduce prompt computation, which would change the starting conditions for a comparison of the two serving layouts.

Run the same request mix against both layouts with the model fixed. Record first-token latency, gaps during generation and the proportion of prompt tokens reused from cache. Keeping those observations together makes it possible to see whether a smoother stream coincided with a longer wait for its first token.

No replies yet