跳到正文
Skillpedia
部署与云(DevOps)14k · #11204

skypilot-multi-cloud-orchestration

它能做什么

这项技能介绍 SkyPilot,这是一个工具,可以通过统一界面在多个云服务商上运行机器学习训练或批处理任务。适合希望降低 GPU 成本、避免被单一服务商绑定的团队。

适用场景

  • ✓当你想在 GPU 价格最低的云上运行训练任务时。
  • ✓当你想使用竞价实例,并在其被停止后自动恢复时。
  • ✓当你需要跨服务商运行多节点分布式训练任务时。

技能链接

https://github.com/Orchestra-Research/AI-Research-SKILLs/blob/main/09-infrastructure/skypilot/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Orchestra-Research/AI-Research-SKILLs/blob/main/09-infrastructure/skypilot/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我在所有可用的云中找到最便宜的 GPU 来运行训练任务,如果可以的话使用竞价实例。”

每周 5 个新技能,1 分钟读完。

工作原理

你用一个简短的 YAML 文件描述任务所需的资源。SkyPilot 会检查哪些云和地区可用,选出最便宜的一个,并能在中断后从检查点继续任务。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

SkyPilot Multi-Cloud Orchestration

Comprehensive guide to running ML workloads across clouds with automatic cost optimization using SkyPilot.

When to use SkyPilot

Use SkyPilot when:

  • Running ML workloads across multiple clouds (AWS, GCP, Azure, etc.)
  • Need cost optimization with automatic cloud/region selection
  • Running long jobs on spot instances with auto-recovery
  • Managing distributed multi-node training
  • Want unified interface for 20+ cloud providers
  • Need to avoid vendor lock-in

Key features:

  • Multi-cloud: AWS, GCP, Azure, Kubernetes, Lambda, RunPod, 20+ providers
  • Cost optimization: Automatic cheapest cloud/region selection
  • Spot instances: 3-6x cost savings with automatic recovery
  • Distributed training: Multi-node jobs with gang scheduling
  • Managed jobs: Auto-recovery, checkpointing, fault tolerance
  • Sky Serve: Model serving with autoscaling

Use alternatives instead:

  • Modal: For simpler serverless GPU with Python-native API
  • RunPod: For single-cloud persistent pods
  • Kubernetes: For existing K8s infrastructure
  • Ray: For pure Ray-based orchestration

Quick start

Installation

pip install "skypilot[aws,gcp,azure,kubernetes]"

# Verify cloud credentials
sky check

Hello World

Create hello.yaml:

resources:
  accelerators: T4:1

run: |
  nvidia-smi
  echo "Hello from SkyPilot!"

Launch:

sky launch -c hello hello.yaml

# SSH to cluster
ssh hello

# Terminate
sky down hello

Core concepts

Task YAML structure

# Task name (optional)
name: my-task

# Resource requirements
resources:
  cloud: aws              # Optional: auto-select if omitted
  region: us-west-2       # Optional: auto-select if omitted
  accelerators: A100:4    # GPU type and count
  cpus: 8+                # Minimum CPUs
  memory: 32+             # Minimum memory (GB)
  use_spot: true          # Use spot instances
  disk_size: 256          # Disk size (GB)

# Number of nodes for distributed training
num_nodes: 2

# Working directory (synced to ~/sky_workdir)
workdir: .

# Setup commands (run once)
setup: |
  pip install -r requirements.txt

# Run commands
run: |
  python train.py

Key commands

Command Purpose
sky launch Launch cluster and run task
sky exec Run task on existing cluster
sky status Show cluster status
sky stop Stop cluster (preserve state)
sky down Terminate cluster
sky logs View task logs
sky queue Show job queue
sky jobs launch Launch managed job
sky serve up Deploy serving endpoint

GPU configuration

Available accelerators

# NVIDIA GPUs
accelerators: T4:1
accelerators: L4:1
accelerators: A10G:1
accelerators: L40S:1
accelerators: A100:4
accelerators: A100-80GB:8
accelerators: H100:8

# Cloud-specific
accelerators: V100:4         # AWS/GCP
accelerators: TPU-v4-8       # GCP TPUs

GPU fallbacks

resources:
  accelerators:
    H100: 8
    A100-80GB: 8
    A100: 8
  any_of:
    - cloud: gcp
    - cloud: aws
    - cloud: azure

Spot instances

resources:
  accelerators: A100:8
  use_spot: true
  spot_recovery: FAILOVER  # Auto-recover on preemption

Cluster management

Launch and execute

# Launch new cluster
sky launch -c mycluster task.yaml

# Run on existing cluster (skip setup)
sky exec mycluster another_task.yaml

# Interactive SSH
ssh mycluster

# Stream logs
sky logs mycluster

Autostop

resources:
  accelerators: A100:4
  autostop:
    idle_minutes: 30
    down: true  # Terminate instead of stop
# Set autostop via CLI
sky autostop mycluster -i 30 --down

Cluster status

# All clusters
sky status

# Detailed view
sky status -a

Distributed training

Multi-node setup

resources:
  accelerators: A100:8

num_nodes: 4  # 4 nodes × 8 GPUs = 32 GPUs total

setup: |
  pip install torch torchvision

run: |
  torchrun \
    --nnodes=$SKYPILOT_NUM_NODES \
    --nproc_per_node=$SKYPILOT_NUM_GPUS_PER_NODE \
    --node_rank=$SKYPILOT_NODE_RANK \
    --master_addr=$(echo "$SKYPILOT_NODE_IPS" | head -n1) \
    --master_port=12355 \
    train.py

Environment variables

Variable Description
SKYPILOT_NODE_RANK Node index (0 to num_nodes-1)
SKYPILOT_NODE_IPS Newline-separated IP addresses
SKYPILOT_NUM_NODES Total
常见问题

支持哪些云?

技能列出了 AWS、GCP、Azure、Kubernetes、Lambda 和 RunPod 等 20 多家服务商。

如何检查我的云凭证?

运行 sky check,验证每个云是否已正确设置。

竞价实例能节省多少钱?

技能说明竞价实例的价格可便宜 3 到 6 倍,并支持自动恢复。

详情

作者的原始描述

Multi-cloud orchestration for ML workloads with automatic cost optimization. Use when you need to run training or batch jobs across multiple clouds, leverage spot instances with auto-recovery, or optimize GPU costs across providers.

repo: Orchestra-Research/AI-Research-SKILLs

热度

GitHub 星标
14k
排名
#11204
许可证
MIT
更新时间
2026/10/10

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能