Nsight Systems · Nsight Compute

Go from timeline to kernel metrics

Start with a short repeatable inference workload. Replace run_inference.py below with your offline runner and keep the model, shapes and backend fixed between captures.

Find a hotspot with Nsight Systems

nsys profile -t cuda,nvtx -o inference python run_inference.py
nsys stats --report cuda_gpu_kern_sum inference.nsys-rep

Open the report and identify a representative prefill or decode window. Select a kernel that takes substantial time on the critical path. Check launch gaps, synchronization and overlap first.

Collect metrics for one matching launch

ncu --kernel-name 'regex:YOUR_KERNEL_PATTERN'   --launch-count 1 --section SpeedOfLight   --section MemoryWorkloadAnalysis -o hotspot   python run_inference.py

Choose a kernel pattern from the Systems capture. Match launch shape and execution phase, and use a launch skip if the first match is a warmup. Graph-captured workloads may require a different collection mode. Check ncu --help for the installed version.

Test a bottleneck hypothesis

Compare achieved compute and memory throughput. If both are low, inspect grid size, occupancy and warp stalls before calling the kernel memory-bound. For decisions about serving latency, measure again outside the profiler under the same load.

Nsight Systems documentation · Nsight Compute CLI · TensorRT-LLM analysis skill