Chip Foundry Services Request Assessment

GPU Profiling Nsight Compute

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.

Run kernel under Nsight Compute
capture hardware counters
Read the top-level metrics
SM throughput
compute-bound signal
Memory throughput
bandwidth-bound signal
Occupancy
latency-hiding headroom
Warp efficiency
divergence below 32
Diagnose the dominant stall
Memory dependency
uncoalesced / cache miss
Execution dependency
long-latency chains
Synchronization
barrier / atomic contention
Fix the one bottleneck, then repeat
Apply targeted fix
coalesce, tile, reduce sync
Re-profile
confirm the metric moved
↻ iterate until near the roofline ceiling
Reading a Kernel Profile the counter mix names the bottleneck: low compute, saturated bandwidth = memory-bound TOP-LEVEL METRICS (% OF PEAK) SM throughput38% · low, not compute-bound Memory throughput91% · high, memory-bound Occupancy62% · hides latency Warp efficiency74% · some divergence Diagnosis: memory-bound Bandwidth is saturated while compute sits idle — the stall breakdown points to memory dependency. Fix: coalesce accesses, tile for cache reuse, raise arithmetic intensity — then re-profile. optimize the resource at its ceiling; other tuning yields nothing

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.