﻿# Read partially filled launch waves before blaming low occupancy

Read grid coverage and partial launch waves separately from the per-SM residency estimate before changing kernel resources.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-perf-launch-tail-waves/
Language: en

A small decode kernel has a respectable theoretical occupancy but leaves much of the device idle near completion. Reducing its register count may miss the cause: the grid might contain too little work to keep the available multiprocessors busy through the final launch wave. Read launch coverage before changing the compiled kernel's resource allocation.

## Preserve the actual grid

Record grid dimensions, block dimensions, dynamic shared memory, the selected kernel variant and the device resources available to this launch. A model batch size is not a grid size: tiling and specialization determine the mapping. Preserve the launch selected by the profiler rather than assuming every token generation step uses identical geometry.

## Distinguish capacity from coverage

The occupancy API estimates how many blocks of this function can reside on a multiprocessor for specified launch inputs. That is a capacity constraint. The grid supplies the blocks that can consume that capacity. A launch can fit many resident blocks in principle yet offer too few total blocks to occupy the device. These observations are compatible.

## Read the wave metric

Nsight Compute documents launch__waves_per_multiprocessor and the potential tail from partial waves. Read its definition for the actual execution configuration, including any restricted SM allocation. Treat a wave as an analytical description of coverage, not a promise that all blocks start and finish together. Unequal block durations can leave a tail even when the nominal grid looks evenly divisible.

## Test a coverage hypothesis

Compare representative input sizes that deliberately change the available independent work while retaining output semantics. Check whether the idle tail changes with geometry. Keep per-request latency visible: combining more requests can increase useful device work while making an individual request wait. A utilization improvement alone does not establish a serving improvement.

## Choose the relevant intervention

If insufficient grid coverage is supported, examine tiling or permissible batching before forcing a register cap. If sufficient blocks exist but execution remains uneven, investigate work distribution and dependencies instead. The useful conclusion identifies the launch population and its tail. It does not prescribe maximal occupancy or infer a precise latency saving from a fractional wave metric.

## Primary references

[Nsight Compute Profiling Guide](https://docs.nvidia.com/nsight-compute/ProfilingGuide/index.html).

[CUDA Runtime Occupancy API](https://docs.nvidia.com/cuda/cuda-runtime-api/cuda_runtime_api/group__CUDART__OCCUPANCY.html).

[Nsight Compute Command-line Interface](https://docs.nvidia.com/nsight-compute/NsightComputeCli/index.html).

Related reading: [GPU occupancy and register pressure: a coupled resource decision](/journal/learn-occupancy-register-pressure/); [GPU warp scheduling: how ready work hides stalls](/journal/learn-warp-scheduler-ready-work/).
