vastai-core-workflow-b

Featured

Execute Vast.ai secondary workflow: multi-instance orchestration, spot recovery, and cost optimization. Use when running distributed training, handling spot preemption, or optimizing GPU spend across multiple instances. Trigger with phrases like "vastai distributed training", "vastai spot recovery", "vastai multi-gpu", "vastai cost optimization".

AI & Automation 2,940 stars 439 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Vast.ai Core Workflow B: Multi-Instance & Cost Optimization ## Overview Secondary workflow for Vast.ai: orchestrate multiple GPU instances for distributed training, implement automatic spot interruption recovery with checkpoint-based resume, and analyze spending to reduce per-job cost. ## Prerequisites - Completed `vastai-core-workflow-a` - Understanding of distributed training (PyTorch DDP, DeepSpeed) - Checkpoint-based training pipeline ## Instructions ### Step 1: Multi-Instance Provisioning ```python import subprocess, json, time from concurrent.futures import ThreadPoolExecutor def provision_cluster(num_nodes, gpu_name="A100", min_vram=80, image=""): """Provision multiple GPU instances for distributed training.""" # Search for matching offers query = (f"num_gpus=1 gpu_name={gpu_name} gpu_ram>={min_vram} " f"reliability>0.98 inet_down>500 rentable=true") result = subprocess.run( ["vastai", "search", "offers", query, "--order", "dph_total", "--raw", "--limit", str(num_nodes * 3)], capture_output=True, text=True, check=True, ) offers = json.loads(result.stdout) if len(offers) < num_nodes: raise RuntimeError(f"Only {len(offers)} offers, need {num_nodes}") # Provision nodes in parallel instances = [] for i, offer in enumerate(offers[:num_nodes]): inst_id = provision_single(offer["id"], image, rank=i) instances.append({"id": inst_id, "rank": i, "offer": offer}) # ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category