CPU, GPU AND RAM

GPU kernel launch granularity: why tiny kernels accumulate host work

In this article
THE QUICK TAKE

Tiny GPU kernels can spend substantial application time on repeated submission and coordination; batching or fusion must retain useful work and observable latency.

A GPU launch has host-side preparation and submission work before device execution begins. When kernels are very small, that work can become a visible part of application completion. Kernel granularity determines how often the application pays submission costs and how much useful work each launch makes available.

Host submission and device execution are separate stages

The CPU prepares a launch and passes work through the runtime and driver path. The GPU later executes the submitted kernel. These intervals can overlap with other work, so adding their isolated measurements is not always a valid application model. A timeline helps locate gaps between short kernels, while end-to-end timing establishes whether those gaps affect completion. The launch API’s return is not the same event as completion of the requested device work.

Primary reference: CUDA Programming Guide: Asynchronous Execution.

A chain of small transforms exposes the gap

Imagine several elementwise transforms over a small array. Each performs little arithmetic but requires its own launch and intermediate storage. Combining suitable transforms can reduce submission and memory movement. The combined kernel may use more registers or lose flexibility, so the comparison includes those effects. This example concerns a concrete chain of operations, not a claim that every application should be compressed into one giant kernel.

Primary reference: CUDA Programming Guide.

Batching changes when inputs may proceed

Collecting several small tasks into one launch can amortize submission work, but the earliest task may wait for the batch to form. Throughput and individual latency can move in different directions. State the batching rule and the boundary used for the comparison. A hypothetical offline array workload may tolerate waiting that an interactive request cannot, even if both ultimately execute the same mathematical kernel.

Primary reference: CUDA C++ Best Practices Guide.

Graphs offer a different preparation boundary

A reusable execution graph can move some repeated preparation out of the ordinary launch path. It does not make the represented device operations disappear. Graph construction, updates and compatibility with changing shapes still require their own accounting. Distinguish a prepared replay from initial setup. This avoids attributing a reduction in repeated host work to faster arithmetic or comparing a warm prepared path with an unprepared alternative without explanation.

Measure the work the consumer waits for

Use a completion boundary that includes the last required output, not merely the final host enqueue. Compare separate launches, a fused implementation or a prepared graph under the same input and acceptance checks. Report initial preparation separately from repeated work. The result should explain which submission or movement cost was reduced and what happened to latency and resource use, rather than treating fewer launches as an end in itself.

Related reading: A GPU inference benchmark you can trust; Reproducible inference stacks: preserving a GPU pilot’s result.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles