﻿# Nsight Compute replay: metric collection changes execution conditions

Replay-based profiles describe controlled measurement passes; compare them with ordinary execution before drawing conclusions about cache state or concurrency.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-nsight-kernel-replay-effects/
Language: en

A detailed Nsight Compute report can require replaying a kernel or a larger application range to collect different metrics. Replaying is a measurement strategy, not ordinary application behavior. It can affect cache state, concurrency, memory restoration, and total duration. Interpreting the report correctly means separating the information learned from replay from the timing and scheduling guarantees of an unprofiled run.

## Not every counter fits into one pass

Hardware exposes many metrics but cannot necessarily collect every requested combination simultaneously. The profiler can divide collection into passes and rerun work. Asking for a larger metric set can therefore change collection time substantially. Begin with a small set tied to a specific hypothesis. A complete-looking report is not inherently more useful than a focused one, particularly when the extra passes introduce assumptions that the workload does not satisfy well.

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

## Replay needs a repeatable execution unit

A kernel that reads and writes state can behave differently on the next invocation unless the measurement system restores the required conditions. The appropriate replay mode depends on dependencies and the application's behavior. Read the mode's documented scope rather than assuming every byte and external effect is automatically restored. A workload involving host interaction or interdependent kernels may need a broader replay boundary than a standalone deterministic arithmetic kernel.

Primary reference: [NVTX: NVIDIA Tools Extension Library](https://nvidia.github.io/NVTX/).

## Cache preparation changes the experiment

A profiled pass can begin with a controlled cache state that differs from the production sequence of kernels. This helps reproducibility but can change the meaning of a memory metric. Record whether the experiment represents cold access, warm reuse, or a tool-controlled condition. Compare with a representative ordinary sequence when cache reuse across kernels matters. An isolated replayed kernel cannot automatically explain every benefit of a real multi-kernel pipeline.

Primary reference: [Nsight Systems User Guide](https://docs.nvidia.com/nsight-systems/UserGuide/index.html).

## Serialization can hide concurrency interactions

Detailed collection may alter how kernels overlap or how the application is paused around measured work. A bottleneck caused by competing streams can look different when a kernel is examined in isolation. Use a system timeline to establish the ordinary overlap pattern first. Then use the detailed kernel report to explain local behavior. Keep those two levels of evidence connected rather than treating either tool view as a complete account of application performance.

## Report conclusions with the collection conditions

State the workload, selected metrics, replay mode, and ordinary timing baseline. After changing the implementation, verify that both useful completion time and the hypothesized mechanism improve. A metric difference across incompatible collection conditions may be an observation artifact. The goal is a reproducible causal explanation: a particular resource or dependency limits the real workload, a specific change addresses it, and unprofiled validation confirms the expected application effect.

Related reading: [A GPU inference benchmark you can trust](/journal/inference-benchmark-method/); [Reproducible inference stacks: preserving a GPU pilot’s result](/journal/software-stack-reproducibility/).
