CUDA Kernel Profiling, Occupancy & the Roofline
Nsight Systems and Nsight Compute workflow, occupancy tuning, warp stall analysis, ILP, warp divergence, and CUDA Graphs. How to go from a slow kernel to a fast one systematically.
Overview
Measure before you optimize
Profiling is the empirical method of AI performance engineering; without measurement, optimization is guesswork. NVIDIA provides two complementary profilers, and knowing how to read and act on their output is an essential skill for any AI systems engineer.
The two tools work together in a loop.
- Run the workload under Nsight Systems and read its timeline. It answers the first question: why is the GPU idle?
- Pick the hot kernel and open it in Nsight Compute. Its hardware counters answer the second question: why is this kernel slow?
- Make one targeted fix.
- Re-profile. The next bottleneck sends you back to the timeline in step 1.
Interview questions
- How would you systematically profile and optimize a slow GEMM kernel using Nsight tooling?
- What is CUDA Graph pre-warming and why does it matter for LLM inference latency?
Sign up free to read the full topic
More AI Infrastructure topics
- AI Accelerator Software Stacks: TPU, Trainium, MTIA & Bring-up
- Bare-metal Provisioning & Fleet Firmware
- Batch GPU Scheduling on Kubernetes: Kueue, Volcano & Gang Scheduling
- CI for the Accelerator Software Stack: Compiler, Kernels & Runtime
- CUDA Memory Hierarchy & Access Patterns
- Design Data & IP Release Management
- Disaggregated Prefill-Decode Architecture
- Distributed Training: NCCL, Collectives & Parallelism
- DPUs in GPU Clusters: BlueField & DOCA
- EDA in the Cloud: Hybrid Bursting, Storage & IP Security
- EDA Licenses & Compute Farms
- Embedded Linux & BSP Builds at Scale: Yocto, Caches & Compliance
Start free on Cariara · Coding problems · System design studio