nsys-ai
AI-powered analysis for NVIDIA Nsight Systems profiles
Navigate GPU kernel timelines, diff two runs, and diagnose performance
bottlenecks with an evidence-first agent — from your browser or terminal.
Mission: Build an agent that understands GPU performance from first
principles — one that can identify pipeline bubbles, calculate MFU, assess
arithmetic intensity, and diagnose the root causes that cost millions of GPU
hours, turning months of expert debugging into minutes.

nsys-ai reads .nsys-rep, .parquetdir, or .sqlite exports from
NVIDIA Nsight Systems and turns
them into something you can navigate and reason about: a web timeline, terminal
viewers, a before/after diff that reports whether a change actually helped, and
a set of deterministic analysis skills an LLM agent can drive. .nsys-rep files
use a Parquet cache by default; .sqlite remains the compatibility path.

The screenshot is captured from the committed H100 fixture; the other browser
surfaces are shown in Choosing a viewer.
Installation
pip install nsys-ai
No CUDA and no Nsight install are required to analyze a profile. Python 3.10+
only. (Capturing a new .nsys-rep, or converting one, needs the nsys CLI on
your machine; analyzing an existing .sqlite does not.)
Quick start
1. Capture a profile
For ML training, capture a few representative iterations rather than the whole
run — it keeps the profile small and the profiler overhead low. Mark the region
with the CUDA profiler API and trace CUDA plus NVTX:
import torch
for step in range(warmup):
train_step()
torch.cuda.synchronize()
torch.cuda.cudart().cudaProfilerStart()
for step in range(3): # profile these iterations
train_step()
torch.cuda.synchronize()
torch.cuda.cudart().cudaProfilerStop()
nsys profile --capture-range=cudaProfilerApi --trace=cuda,nvtx \
-o my_training python train.py
# -> my_training.nsys-rep
--trace=cuda is what every skill relies on (GPU kernels, memory copies, CUDA
API). nvtx adds the annotation hierarchy that drives the iteration, region,
and layer views. To use the iteration tools (iters, diff --iteration),
annotate each step with a consistent NVTX marker — see
Focused Profiling and
NVTX Annotations.
No workload handy? Download an example profile:
cd examples/example-20-megatron-distca && python download_data.py
# -> output/megatron_distca.nsys-rep
2. Open it
# Default: open the web timeline in your browser
nsys-ai my_training.nsys-rep
# Metadata and GPU info
nsys-ai info my_training.nsys-rep
# GPU kernel summary
nsys-ai summary my_training.nsys-rep --gpu 0
Prefer the terminal? open --viewer tui needs no window; the dedicated TUI
commands render one window at a time, so they require --trim:
nsys-ai open my_training.nsys-rep --viewer tui # NVTX tree browser, full span
nsys-ai timeline my_training.nsys-rep --gpu 0 --trim 0 5 # Perfetto-style horizontal timeline
nsys-ai tui my_training.nsys-rep --gpu 0 --trim 0 5 # NVTX tree browser, explicit window
3. Compare two runs
nsys-ai diff before.sqlite after.sqlite
4. Keep the investigation in one session
The 0.3.0 command surface is built around a session directory: findings,
proposals, run specifications, diffs, and decisions can move between CLI, Web,
TUI, and MCP without reconstructing state from terminal output.
SESSION=/tmp/nsys-ai/run-001
nsys-ai doctor run-before/profile.sqlite --format json
nsys-ai diagnose run-before/profile.sqlite --session "$SESSION"
nsys-ai ask --session "$SESSION" "what is the main bottleneck?"
nsys-ai diff run-before/profile.sqlite run-after/profile.sqlite \
--no-ai --session "$SESSION"
nsys-ai review --session "$SESSION"
For a complete diagnose → propose → re-profile → diff → decision walkthrough,
including the RunSpec required by propose, see the
user guide.
Web timeline