Data as of Aug 25, 2026 · Based on 328 AI responses from ChatGPT Search and Google AI Mode · See how Parse measures this
To address high inference latency, use a combination of tools based on the specific bottleneck. Use PyTorch Profiler to trace operator-level performance within your model code,
NVIDIA Nsight Systems for deep hardware-level analysis of GPU kernels and memory transfers, and production monitoring stacks like
Prometheus and for tracking latency metrics in real-time.
Brands AI recommends here
Best for detailed inspection of framework-level operations. It provides traces of operator execution times and memory usage within PyTorch code, helping you pinpoint slow model layers or inefficient CPU-side operations.
The industry standard for GPU performance optimization. It is highly effective for identifying hardware-level bottlenecks, including CUDA kernel execution times and memory throughput issues between the CPU and GPU.
Recommended for ongoing production monitoring. Combined with Prometheus, it is the standard for visual tracking of p95 and p99 latency metrics, allowing teams to visualize performance degradation over time in live environments.
If your problem is high inference latency, the best profiling tool depends on where the latency is coming from—but if you’re running on an NVIDIA GPU, I’d start with NVIDIA Nsight Systems.
| Tool | Best for | Use it when |
|---|---|---|
| developer.nvidia.com | End-to-end CPU/GPU latency | Best first choice for finding why inference is slow |
| docs.pytorch.org | PyTorch operators | You want to identify which model ops are expensive |
| Nsight Compute | Individual CUDA kernels | You know the problematic kernel and want to optimize it |
TensorRT trtexec / profiler | TensorRT inference | You're deploying an optimized TensorRT engine |
Nsight Systems is particularly useful for latency because it gives you a timeline showing CPU execution, CUDA API calls, GPU kernels, memory transfers, synchronization, and stream concurrency. NVIDIA itself recommends it as the high-level CUDA/system profiler.
Start with:
nsys profile -o inference_profile python inference.py
Then inspect the timeline for:
For TensorRT specifically, NVIDIA recommends a workflow of TensorRT's built-in layer profiler → Nsight Systems → Nsight Compute if necessary.
If you're using PyTorch, I'd use torch.profiler first for a quick operator-level view, then Nsight Systems when I need to understand the actual CPU/GPU timeline. PyTorch Profiler can attribute time to operators and expose device-kernel activity.
Bottom line: 👉 NVIDIA GPU + inference latency problem → Nsight Systems is my first choice. 👉 PyTorch model-level diagnosis → PyTorch Profiler. 👉 Known slow CUDA kernel → Nsight Compute.
If you tell me PyTorch vs TensorFlow vs TensorRT, GPU model, and whether you're optimizing single-request latency or throughput, I can give you a concrete profiling workflow and commands.
There is no single "best" tool because the right choice depends on whether your bottleneck is CPU vs. GPU hardware, Python overhead , or serving framework/network latency.
The top-tier performance profiling tools are categorized below by where they shine:
nsys tracks the entire system timeline—showing CPU activity, CUDA API calls, GPU kernel execution, and memory transfers (HtoD, DtoH ). It helps you spot hidden CPU bottlenecks, kernel launch gaps, and stream synchronization stalls.To help narrow down the ideal tool for your specific setup, let me know:
The best performance profiling tool depends on your hardware stack and framework, but PyTorch Profiler is the top choice for PyTorch models, while NVIDIA Nsight Systems is the gold standard for deep hardware-level GPU profiling.
To fix high inference latency, you must pinpoint whether your bottleneck is CPU-bound preprocessing, GPU kernel execution, or memory bandwidth limitations.
Top Performance Profiling Tools
| Tool | Best Used For | Key Feature |
|---|---|---|
| PyTorch Profiler | PyTorch models & operator timing | Tracks CPU/GPU operator timelines and memory usage directly in code. |
| NVIDIA Nsight Systems | Deep GPU hardware analysis | System-wide visualization of CPU-to-GPU interactions and kernel execution. |
| TensorRT Profiler | NVIDIA hardware optimization | Analyzes layer-by-layer execution times for optimized engines. |
| ONNX Runtime Profiler | Cross-platform/ONNX deployments | Measures per-operation latency for lightweight runtimes. |
How to Choose and Proceed
If you tell me your model framework (PyTorch, ONNX, TensorRT) and target hardware (CPU, NVIDIA GPU, Apple Silicon), I can recommend the exact profiling commands or script setup to get your bottleneck data.
If your problem is inference latency, my default recommendation is NVIDIA Nsight Systems if you're running on an NVIDIA GPU. It gives you the best system-level view of where latency is going: CPU execution, CUDA kernels, memory transfers, synchronization, Python/framework overhead, and GPU utilization. It can also automatically annotate common PyTorch operations.
| Situation | Best tool | Why |
|---|---|---|
| NVIDIA GPU, end-to-end latency | Nsight Systems | Best for seeing the entire CPU↔GPU execution timeline |
| PyTorch model-level profiling | torch.profiler | Easy operator/kernel-level breakdown; useful for finding expensive ops and graph breaks PyTorch Docs |
| Individual CUDA kernel optimization | Nsight Compute | Much deeper analysis of individual GPU kernels |
| ONNX Runtime inference | ONNX Runtime profiler + onnxruntime_perf_test | Reports per-operator latency and runtime/threading behavior ONNX Runtime GitHub |
| TensorFlow | TensorFlow Profiler / TensorBoard | CPU/GPU traces, kernel statistics, memory, input pipeline analysis TensorFlow |
| CPU inference | Intel VTune / Linux perf | Excellent for CPU hotspots, threading, cache behavior, and memory stalls |
I'd profile in this order:
torch.profiler to identify the responsible model operations.The key distinction is that torch.profiler tells you which model operations are expensive, while Nsight Systems tells you why the hardware is spending that time.
If you tell me PyTorch vs TensorFlow, NVIDIA vs AMD/CPU, and whether you're using TorchScript/torch.compile/ONNX/TensorRT, I can recommend the exact profiling setup and commands for your stack.
trtexec or programmatic profiling) shows layer-by-layer execution times and precision optimization bottlenecks (FP16/INT8).To help narrow down the best choice, tell me:
I can recommend the most efficient profiling workflow for your stack.
If your problem is high inference latency, there isn't one universal profiler—but for a GPU-backed ML model, my recommendation is:
If you're running on an NVIDIA GPU, Nsight Systems is the best first tool for diagnosing inference latency. It gives you a system-wide timeline showing CPU activity, CUDA API calls, GPU kernels, synchronization, memory transfers, and gaps where the GPU is idle. NVIDIA's own JAX profiling guidance specifically recommends Nsight Systems as the place to start, before drilling into individual kernels with Nsight Compute.
I'd start with PyTorch Profiler if you want to understand which model operators are responsible for latency. It can correlate PyTorch operators with CPU/CUDA activity, input shapes, stack traces, and device kernels.
For example:
with torch.profiler.profile(
activities=[
torch.profiler.ProfilerActivity.CPU,
torch.profiler.ProfilerActivity.CUDA,
],
record_shapes=True,
) as prof:
model(inputs)
print(prof.key_averages().table(
sort_by="self_cuda_time_total",
row_limit=20
))
| Question | Tool |
|---|---|
| Why is my entire inference request slow? | Nsight Systems |
| Which PyTorch operation is slow? | PyTorch Profiler |
| Why is a particular CUDA kernel slow? | Nsight Compute |
| Is the GPU underutilized? | Nsight Systems / DCGM |
| Is CPU→GPU synchronization hurting latency? | Nsight Systems |
| Is memory transfer the bottleneck? | Nsight Systems |
| Is a specific kernel limited by memory bandwidth/compute? | Nsight Compute |
Nsight Compute is the tool I'd use after Nsight Systems identifies a suspicious kernel; it provides much deeper GPU-kernel metrics, but is considerably heavier and isn't where I'd start for end-to-end latency.
For high inference latency, profile one realistic request and look for:
The key insight is that "GPU utilization is 90%" doesn't necessarily mean your model is efficiently using the GPU. A timeline can reveal synchronization and launch overhead that a simple latency or utilization metric hides.
If you tell me PyTorch/TensorFlow/ONNX/TensorRT + GPU model + current inference latency, I can recommend a specific profiling workflow and the exact commands to run.
There is no single "best" tool because the right choice depends entirely on where your bottleneck lives (e.g., Python code overhead, GPU kernel execution, or network/serving queue delay).
The industry-standard performance profiling tools are categorized below by what they do best:
To help narrow down the ideal tool, tell me:
If your problem is high inference latency, the best profiling tool depends on where the latency is coming from. If you're running on an NVIDIA GPU, my first choice is NVIDIA Nsight Systems.
1. NVIDIA Nsight Systems — best first tool for end-to-end latency
It gives you a timeline across CPU → CUDA → GPU, including CUDA API calls, kernel launches, memory transfers, CPU scheduling, and GPU activity. That makes it particularly good for answering “where is my 50 ms actually going?”
For example, it can reveal:
cudaDeviceSynchronize, .item(), etc.)A typical starting point is:
nsys profile --trace=cuda,nvtx,osrt -o profile python inference.py
Then inspect the timeline and work downward from the largest gaps.
2. PyTorch Profiler — best for figuring out which PyTorch operators are slow
If you're using PyTorch, torch.profiler is the easiest model-level tool. It can correlate expensive PyTorch operators with device/kernel activity, input shapes, and stack traces.
with torch.profiler.profile(
activities=[
torch.profiler.ProfilerActivity.CPU,
torch.profiler.ProfilerActivity.CUDA,
],
record_shapes=True,
) as prof:
for _ in range(10):
model(x)
print(prof.key_averages().table(
sort_by="cuda_time_total",
row_limit=20
))
3. NVIDIA Nsight Compute — best for optimizing an individual GPU kernel
Once Nsight Systems tells you which kernel is problematic, use Nsight Compute to determine why: memory bandwidth, Tensor Core utilization, occupancy, instruction throughput, etc. NVIDIA explicitly positions Nsight Compute as the detailed CUDA-kernel profiler, while Nsight Systems is the higher-level system profiler.
Don't start by optimizing individual operators.
Use:
Nsight Systems → PyTorch Profiler → Nsight Compute
In other words:
“Where is the latency?” → “Which model operation causes it?” → “Why is that kernel slow?”
If you're using TensorRT, I'd also use its profiling tools/trtexec; NVIDIA's tooling can profile TensorRT layers and correlate them with the originating ONNX operators.
If you tell me PyTorch vs TensorFlow vs ONNX Runtime vs TensorRT, and CPU vs NVIDIA GPU vs AMD GPU, I can recommend the exact profiling setup and commands for your model.
If your main problem is high inference latency, my default recommendation is PyTorch Profiler if you're using PyTorch. It gives you a detailed CPU/GPU execution trace, per-operator timing, input shapes, stack traces, and device-kernel activity.
| Tool | Best for | My pick |
|---|---|---|
| PyTorch Profiler | Finding slow model ops, CPU↔GPU gaps, synchronization, kernel activity | ⭐ Start here |
| NVIDIA Nsight Systems | Deep GPU/CPU timeline analysis, CUDA kernels, launch overhead, concurrency | ⭐ Second step |
| TensorFlow Profiler | TensorFlow/Keras models | ⭐ Start here for TF |
| TensorBoard Profiler | Visualizing PyTorch/TF traces | Great companion |
| cProfile / py-spy | Python-level overhead outside the model | Useful if CPU/Python is suspicious |
For NVIDIA GPUs, Nsight Systems is particularly useful after the framework profiler identifies a suspicious region: it can expose CPU/GPU scheduling, CUDA activity, kernel launches, and synchronization in a system-wide timeline. It also has PyTorch-specific profiling integration.
For TensorFlow, TensorFlow Profiler + TensorBoard provides host/device traces, per-op statistics, GPU kernel statistics, and memory analysis. www.tensorflow.org It can also profile actual TensorFlow Serving inference requests rather than just isolated model execution.
1. Measure end-to-end latency first
2. Run PyTorch Profiler on a small number of representative inference iterations.
Look specifically for:
3. If the trace points toward GPU/runtime behavior, switch to Nsight Systems.
This is often where you discover something like:
CPU preprocessing → GPU idle → kernel launch → tiny kernel → synchronization → another kernel
when what you wanted was a continuously busy GPU.
4. Then optimize and benchmark again.
One important caveat: don't profile every request in production—the profiler itself can perturb timing. PyTorch provides scheduled profiling specifically so you can capture selected iterations rather than tracing an entire workload.
Bottom line: If you tell me PyTorch vs. TensorFlow, GPU type (e.g. A100/H100/T4), and how you're serving the model (TorchServe, Triton, vLLM, custom API, etc.), I can recommend the exact profiling setup and what latency bottlenecks I'd look for first.
vLLM
vllm.ai
There is no single "best" tool, because the right choice depends entirely on where your hardware bottleneck lies (CPU vs. GPU) and at what level of the stack you need visibility (high-level operator timeline vs. low-level hardware kernel execution).
The industry-standard profiling tools are categorized below by their best use cases:
nsys) — Best for GPU/System Timeline Analysis
ncuda) — Best for Deep GPU Kernel Optimization
To help narrow down the ideal tool, could you tell me: