vLLM-GR · Perfetto

Follow a beam search decode step

This walkthrough summarizes an offline rank-0 capture on one NVIDIA H20. The recorded vLLM version was 0.30.0. The run label specifies a beam width of 128. Use the timings as a worked example.

Find the forward windows

Search for execute_context_1(1024)_generation_0(0). The 34.31 ms annotation contains 24.82 ms of summed kernel time. It includes session setup, a 28-layer prefill, paged BF16 KV writes and a vocabulary projection at the end.

The next two execute_context_0(0)_generation_1(1) GPU windows span 5.61 ms and 5.63 ms. Inspect CUDA runtime events for cudaGraphLaunch. This capture has three launches despite the original run label containing “eager.”

Follow the work after logits

  1. At the end of forward, look for the LM-head nvjet_sm90 GEMM. The decode projection takes about 0.675 ms per round.
  2. Follow _local_keys_kernel, _merge_chunk_kernel, _finalize_kernel and _repair_row_kernel. Together they take about 0.71 ms per decode round.
  3. _merge_beam_topk_kernel ranks candidate extensions across parent beams. The selected parent indices drive _select_kv_gather_kernel and _select_kv_scatter_kernel.

What the attention kernels reuse

Each active beam computes its own query and attends to the prompt KV shared within that request. The Hopper FlashAttnFwdSm90 path handles the prefix. The _short_suffix_fa2_merge_kernel handles the private suffix and combines the attention states. This trace alone cannot establish a cross-request prefix-cache hit.

For a similar capture, write down both annotation span and summed kernel duration. Then inspect gaps, CPU synchronization and work beyond the annotation before estimating request latency.

vLLM-GR source