Understanding Linux perf: stat and record
What really happens in the kernel when you run perf stat or perf record.
What really happens in the kernel when you run perf stat or perf record.
torch.profiler integrates PyTorch operator attribution, optional source stacks, and CUDA activity in one trace. Its numbers mean what you think only if you control the capture window, the labels and the host syncs.
Nsight Systems puts host ranges, CUDA API calls, GPU kernels and memory operations on one timeline. It helps locate gaps in recorded GPU activity and inspect the host-side work around them.
Follow a batch from the CPU to the GPU, distinguish host ranges from device activity, and use an existing trace to choose the next profiling question. A starting point for the PyTorch Profiler tutorial, Nsight Systems tutorial, and their comparison.
Use existing ResNet-50 traces to learn what torch.profiler and Nsight Systems explain, what NVTX bridges, and why neither a busy timeline nor an operator percentage proves a bottleneck.