/vibe:skill-latency-profilerfrom vibe
Generates a disciplined latency benchmark for PyTorch models with warmup, synchronization, percentiles, and memory tracking. Useful for comparing backbones, before/after quantization, or runtime changes.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Produce a disciplined latency benchmark for any PyTorch model. Reports that anyone downstream can actually trust.
model: PyTorch nn.Module.input_shape: tuple like (1, 3, 224, 224).device: cpu | cuda | mps.warmup: default 10.iters: default 100.Run the model warmup times without timing. Catches first-forward JIT compilation and cold cache effects.
For cuda, call torch.cuda.synchronize() before and after each timed forward pass.
For mps, call torch.mps.synchronize().
Use time.perf_counter() for wall-clock measurement. Convert to milliseconds.
Sort the full list of timings. Report p50, p90, p95, p99, mean, std.
For cuda, call torch.cuda.max_memory_allocated() after the run and subtract any baseline.
For cpu, use tracemalloc or psutil.Process().memory_info().rss before and after.
Optionally repeat the benchmark for batch_size in [1, 4, 16, 32] to reveal throughput vs latency tradeoffs.
import time
import torch
import psutil, os
def profile(model, input_shape, device="cpu", warmup=10, iters=100):
proc = psutil.Process(os.getpid())
baseline_rss = proc.memory_info().rss / 1e6
model = model.to(device).eval()
x = torch.randn(input_shape, device=device)
def sync():
if device == "cuda":
torch.cuda.synchronize()
elif device == "mps":
torch.mps.synchronize()
with torch.no_grad():
for _ in range(warmup):
model(x)
sync()
if device == "cuda":
torch.cuda.reset_peak_memory_stats()
times = []
for _ in range(iters):
sync()
t0 = time.perf_counter()
model(x)
sync()
times.append((time.perf_counter() - t0) * 1000)
times.sort()
mean = sum(times) / len(times)
std = (sum((t - mean) ** 2 for t in times) / len(times)) ** 0.5
def pct(p):
idx = max(0, min(len(times) - 1, int(len(times) * p) - 1))
return times[idx]
report = {
"p50_ms": pct(0.50),
"p90_ms": pct(0.90),
"p95_ms": pct(0.95),
"p99_ms": pct(0.99),
"mean_ms": mean,
"std_ms": std,
"rss_mb": proc.memory_info().rss / 1e6 - baseline_rss,
}
if device == "cuda":
report["peak_cuda_mb"] = torch.cuda.max_memory_allocated() / 1e6
return report
torch.cuda.synchronize(); the numbers are meaningless without it.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job