GPU Profiling with Nsight Compute is the systematic measurement of a GPU kernel's compute throughput, memory throughput, occupancy, stall reasons, and instruction mix using hardware performance counters — turning optimization from guesswork into a bottleneck-directed, data-driven loop.
Four top-level metrics locate almost every bottleneck. SM throughput, the fraction of peak compute achieved, flags instruction-level inefficiency such as poor ILP, warp divergence, or pervasive stalls when it reads low. Memory throughput, the fraction of peak bandwidth used, reads high on a memory-bound kernel and points optimization at traffic reduction or better access patterns. Occupancy, the ratio of active warps to the maximum per SM, helps hide latency but is not an end in itself: some kernels hit peak at $50\%$ occupancy because they reuse data well. Warp execution efficiency, the average number of active threads per warp instruction, exposes divergence whenever it falls below 32, with a healthy target above 28.
Stall analysis explains why the warps that are resident still are not running. Memory dependency stalls mean warps are waiting on load or store completion, a sign of too little occupancy or uncoalesced, cache-missing access. Execution dependency stalls mean warps wait on a prior instruction's result, typical of long-latency chains such as transcendental functions or integer division without enough parallel work to hide them. Synchronization stalls accumulate at `__syncthreads()` or atomics and point to load imbalance within a block or atomic contention. Instruction-fetch stalls, from instruction-cache misses, are rarer but surface in very large kernels or code with sprawling control flow.
Memory analysis turns a bandwidth number into an actionable cause. The L1 and L2 cache hit rates expose poor locality or a working set larger than the cache when they read low. Sector utilization, the fraction of each 32-byte cache sector the requesting warp actually uses, catches uncoalesced access that wastes bandwidth on bytes nobody wanted. Shared-memory efficiency is reported as transactions per request: a value of $1.0$ means no bank conflicts, while higher values indicate $N$-way conflicts that throttle shared-memory bandwidth. The DRAM read-to-write ratio flags unnecessary stores or write-back traffic, where a heavy write share on an inference-style kernel usually signals redundant output.
Read Nsight Compute profiling through a *bottleneck-first* lens rather than a *tune-everything* lens: the roofline tells you whether a kernel is compute- or memory-bound, and these counters tell you exactly which resource is the wall, so that the one optimization you apply is the one that actually moves the kernel toward its ceiling.