Vast.ai Migration Deep Dive
Current State
!vastai --version 2>/dev/null || echo 'vastai CLI not installed'
!pip show vastai 2>/dev/null | grep Version || echo 'N/A'
Overview
Migrate GPU workloads to Vast.ai from hyperscaler providers (AWS, GCP, Azure) or other GPU clouds (Lambda, RunPod, CoreWeave). Also covers migrating between GPU types on Vast.ai and the reverse migration away from Vast.ai.
Prerequisites
- Existing GPU workload with Docker image
- Understanding of current GPU costs and utilization
- Checkpoint-based training pipeline (for training migrations)
Instructions
Step 1: Cost Comparison Analysis
# Compare your current GPU costs against Vast.ai marketplace prices
PROVIDER_COSTS = {
"aws_p4d.24xlarge": {"gpu": "A100 40GB", "gpus": 8, "hourly": 32.77},
"aws_p3.2xlarge": {"gpu": "V100 16GB", "gpus": 1, "hourly": 3.06},
"gcp_a2-highgpu-1g": {"gpu": "A100 40GB", "gpus": 1, "hourly": 3.67},
"azure_NC24ads_A100_v4": {"gpu": "A100 80GB", "gpus": 1, "hourly": 3.67},
"lambda_1xA100": {"gpu": "A100", "gpus": 1, "hourly": 1.25},
}
VASTAI_TYPICAL = {
"RTX_4090": 0.20,
"A100": 1.50,
"H100_SXM": 3.00,
}
def savings_analysis(current_provider, current_hourly, vastai_gpu, vastai_hourly):
monthly_current = current_hourly * 730 # hours/month
monthly_vastai = vastai_hourly * 730
savings = monthly_current - monthly_vastai
pct = (savings / monthly_current) * 100
print(f"Current ({current_provider}): ${monthly_current:,.0f}/mo")
print(f"Vast.ai ({vastai_gpu}): ${monthly_vastai:,.0f}/mo")
print(f"Savings: ${savings:,.0f}/mo ({pct:.0f}%)")
savings_analysis("AWS p3.2xlarge", 3.06, "RTX_4090", 0.20)
# Output: Savings: $2,088/mo (93%)