WhoBuilt

Continuous Profiling for GPUs

Jul 22, 2025· 12 min· 436 views·Watch on YouTube

Speaker

Matthias Loibl, director of Polar Signals Cloud and a Prometheus Operator maintainer, presents GPU profiling at the AI Engineer channel.

Why profile continuously

Profiling measures where time and resources go, including memory, CPU, GPU, instructions, and function calls. Loibl contrasts tracing, which records every event but creates high overhead and large volumes of data, with sampling. Sampling at 20 or 100 times per second can run continuously with low overhead, though it may miss individual events.

GPU metrics in production

Polar Signals began previewing GPU profiling after several years of CPU and memory profiling work. Using NVIDIA NVML, it collects node and per-process utilization, memory use, clock speed, power, temperature, and PCIe throughput. These metrics can reveal idle GPU periods, thermal throttling, or data transfer bottlenecks.

Connect GPU usage to CPU work

GPU metrics can be correlated with CPU profiles collected through eBPF. Selecting a time range and viewing its flame chart can show what the CPU was doing while the GPU was underused. Loibl gives loading data as one possible CPU task that keeps a GPU from staying busy, and notes that stacks can include languages such as Python and Rust.

Measure time spent on the GPU

Loibl introduces GPU time profiling, which tracks when CUDA work starts and when its kernel ends to estimate time spent on the GPU. In the resulting view, stack widths represent GPU execution time, and colors distinguish binaries such as Python and CUDA.

Deploy the profiler

The profiler runs on Linux with eBPF and can be launched with systemd or Docker, or deployed as a Kubernetes DaemonSet using a manifest and token. Loibl says TurboPuffer is exploring GPU profiling to improve its vector engine.

Takeaways

  • Continuous sampling can provide production performance data with low overhead, while accepting that some events will be missed.
  • Compare GPU utilization with CPU profiles to investigate what is happening when the GPU is underused.
  • Check temperature and PCIe throughput alongside utilization to spot throttling and data transfer limits.
  • GPU time profiles can identify which CUDA call stacks account for GPU execution time.
  • Choose deployment based on your environment: systemd, Docker, or a Kubernetes DaemonSet.

Mentioned in this talk

Search inside this talk

What was claimed 5

Related talks