-
Notifications
You must be signed in to change notification settings - Fork 0
AI Infra Debug
Roberto Fronteddu edited this page Jun 24, 2026
·
10 revisions
- Baseline measurements: “Before changing anything, I measured X, Y, Z. The bottleneck appears to be A.”
- Concrete improvement: For example: reduced latency, improved GPU utilization, removed a memory bottleneck, improved batching, reduced redundant work, or found a config issue.
- Final writeup: 1–2 page writeup
Summary:
- Investigated [system/component].
- Found bottleneck in [area].
- Implemented/tested [change].
- Result: [metric before] -> [metric after].
- Remaining opportunities: [ranked list].
Method:
- Baseline setup
- Metrics collected
- Tools used
- Assumptions
Findings:
- ...
- ...
- ...
Changes made:
- ...
Risks / tradeoffs:
- ...
Recommended next steps:
- ...
- ...
- ...
- What matters most:
- latency
- throughput
- GPU utilization
- memory
- cost
- reliability
- developer simplicity
- What is the current behavior, and what would count as a useful improvement
Useful Commands:
- watch -n 1 nvidia-smi: Shows GPU memory, utilization, power, running processes.
- htop: Shows CPU usage.
- iostat -x 1: Shows disk bottlenecks, if available.
- df -h: Checks disk space.
- du -sh .: Checks directory size.
import time
t0 = time.perf_counter()
# work here
t1 = time.perf_counter()
print(f"Elapsed: {t1 - t0:.3f}s")
Without torch.cuda.synchronize(), GPU timing can lie because CUDA work is asynchronous.
import time
import torch
torch.cuda.synchronize()
t0 = time.perf_counter()
# GPU work here
torch.cuda.synchronize()
t1 = time.perf_counter()
print(f"GPU elapsed: {t1 - t0:.3f}s")