﻿# Profile a steady serving interval rather than initialization

Define and verify the NVTX domain/range contract so the selected kernel profile represents the intended serving phase.

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

A kernel profile describes model initialization even though the intended question concerns repeated decode. NVTX annotations can mark the application's useful region, and Nsight Compute can filter launches through that context. The filter still needs an exact domain and range contract; a label alone does not turn an arbitrary captured kernel into steady-state evidence.

## Define the application milestone

Choose what must finish before the target region begins: artifact loading, compilation, model preparation or a bounded warmup appropriate to the question. Define its end as well. Avoid using a fixed sleep as proof of readiness. A region called steady can still contain lazy initialization if the program starts it before the relevant first-use work actually completes.

## Use stable annotation identity

NVTX supports named contextual annotations and domains. Select stable nonsecret labels that express the operation rather than embedding request text or identifiers with unbounded cardinality. Record the annotation type used by the application. Push/pop nesting and separately started ranges have distinct filtering syntax, so the tool configuration must match the actual annotation contract.

## Verify filter activation

The documented Nsight Compute filtering requires NVTX collection to be enabled and supports include and exclude configurations. Preserve the exact domain/range expression and selected kernel records. An empty report can mean a filter mismatch rather than absent GPU work. A broad substring or regular expression can also include initialization ranges whose names happen to resemble the desired region.

## Keep launch context and completion distinct

A host annotation surrounds code that submits work; it is not automatically a device synchronization boundary. Understand which launches the filter associates with the range, and retain their stream and workload identity. An operation can finish on the GPU after the host leaves its range. The annotation gives context without changing the application's required execution dependencies.

## Exercise one known region

Use a harmless fixture with separate preparation and repeated-work ranges, then verify that only the intended kernel instances enter a bounded report. Compare the annotation timeline with selected launch records. Acceptance establishes region selection. It does not guarantee that the model is fully warmed, preserve ordinary concurrency under detailed collection or turn a host range duration into pure GPU execution time.

## Primary references

[NVIDIA Tools Extension Annotations](https://nvidia.github.io/NVTX/).

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

[Nsight Systems Timeline Collection](https://docs.nvidia.com/nsight-systems/UserGuide/index.html).

Related reading: [GPU autoscaling: a free card is not a ready replica](/journal/autoscaling-gpu-cold-start/); [GPU profiling: sampling and instrumentation observe different events](/journal/learn-gpu-profiler-sampling-instrumentation/).
