| name | vastai-performance-tuning |
| description | Optimize Vast.ai GPU instance selection, startup time, and training throughput.
Use when optimizing instance selection, reducing startup latency,
or maximizing GPU utilization on rented hardware.
Trigger with phrases like "vastai performance", "optimize vastai",
"vastai slow", "vastai gpu utilization", "vastai throughput".
|
| allowed-tools | Read, Write, Edit, Bash(vastai:*), Bash(ssh:*) |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","vast-ai","api","performance"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Vast.ai Performance Tuning
Overview
Optimize GPU instance selection, startup time, and training throughput on Vast.ai. Key levers: Docker image caching, GPU selection by dlperf score, data pipeline optimization, and multi-GPU scaling.
Prerequisites
- Vast.ai account with active or planned instances
- Understanding of GPU compute bottlenecks
- Profiling tools (nvidia-smi, torch.profiler)
Instructions
Step 1: Optimize Instance Selection by Performance
vastai search offers 'num_gpus=1 gpu_ram>=24 reliability>0.95' \
--order 'dlperf-' --limit 10
def select_by_performance_per_dollar(offers):
"""Select the offer with best performance per dollar."""
for o in offers:
o["perf_per_dollar"] = o.get("dlperf", 0) / max(o["dph_total"], 0.01)
return max(offers, key=lambda o: o["perf_per_dollar"])
Step 2: Reduce Instance Startup Time
vastai create instance $ID --image pytorch/pytorch:latest \
--onstart-cmd