run-experiment
하는 일
이 스킬은 프로젝트가 쓰는 연산 환경에서 학습과 실험 작업을 시작합니다. 플랫폼마다 직접 설정하지 않고 GPU에서 코드를 돌리려는 연구자를 위한 스킬입니다.
사용하는 경우
- ✓로컬 GPU나 원격 서버에서 학습 작업을 시작하고 싶을 때.
- ✓Vast.ai나 Modal 서버리스 GPU에서 실험을 실행해야 할 때.
- ✓긴 실행 전에 환경이 확인된 뒤에만 실행을 시작하고 싶을 때.
스킬 링크
https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/run-experiment/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“프로젝트 설정에 정의된 원격 GPU 서버에서 제 학습 실험을 시작해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 프로젝트 설정을 읽어 서버, Vast.ai 인스턴스, Modal 앱 같은 맞는 환경을 찾습니다. 그다음 작업을 시작하고, 긴 실행 전에 환경이 작동하는지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Run Experiment
Deploy and run ML experiment: $ARGUMENTS
Workflow
Step 1: Detect Environment
Read the project's CLAUDE.md to determine the experiment environment:
- Local GPU (
gpu: local): Look for local CUDA/MPS setup info - Remote server (
gpu: remote): Look for SSH alias, conda env, code directory - Vast.ai (
gpu: vast): Check forvast-instances.jsonat project root — if a running instance exists, use it. Also checkCLAUDE.mdfor a## Vast.aisection. - Modal (
gpu: modal): Serverless GPU via Modal. No SSH, no Docker, auto scale-to-zero. Delegate to/serverless-modal.
Modal detection: If CLAUDE.md has gpu: modal or a ## Modal section, the entire deployment is handled by /serverless-modal. Jump to Step 4: Deploy (Modal) — Steps 2-3 are not needed (Modal handles code sync and GPU allocation automatically).
Environment contract (../shared-references/compute-env-contract.md): before
building or trusting any environment, read the provider's env ledger
(.aris/compute/<provider>.md) — an unchanged spec hash means warm-reuse, a
changed one means rebuild. New env → write the declarative spec first, render it
for this provider's shape, and never declare it ready on import-success alone:
run the seeded kernel witness, and after any rebuild/doc edit run the
agent-follows-doc pass (a fresh subagent executes the documented invocation
verbatim and reports doc-vs-reality divergence).
Vast.ai detection priority:
- If
CLAUDE.mdhasgpu: vastor a## Vast.aisection:- If
vast-instances.jsonexists and has a running instance → use that instance - If no running instance → call
/vast-gpu provisionwhich analyzes the task, presents cost-optimized GPU options, and rents the user's choice
- If
- If no server info is found in
CLAUDE.md, ask the user.
Step 2: Pre-flight Check
Check GPU availability on the target machine:
Remote (SSH):
ssh <server> nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv,noheader
Remote (Vast.ai):
ssh -p <PORT> root@<HOST> nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv,noheader
(Read ssh_host and ssh_port from vast-instances.json, or run vastai ssh-url <INSTANCE_ID> which returns ssh://root@HOST:PORT)
Local:
nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv,noheader
# or for Mac MPS:
python -c "import torch; print('MPS available:', torch.backends.mps.is_available())"
Free GPU = memory.used < 500 MiB.
Step 3: Sync Code (Remote Only)
Check the project's CLAUDE.md for a code_sync setting. If not specified, default to rsync.
Option A: rsync (default)
Only sync necessary files — NOT data, checkpoints, or large files:
rsync -avz --include='*.py' --exclude='*' <local_src>/ <server>:<remote_dst>/
Option B: git (when code_sync: git is set in CLAUDE.md)
Push local changes to remote repo, then pull on the server:
# 1. Push from local
git add -A && git commit -m "sync: experiment deployment" && git push
# 2. Pull on server
ssh <server> "cd <remote_dst> && git pull"
Benefits: version-tracked, multi-server sync with one push, no rsync include/exclude rules needed.
Option C: Vast.ai instance
Sync code to the vast.ai instance (always rsync, code dir is /workspace/project/):
rsync -avz -e "ssh -p <PORT>" \
--include='*.py' --include='*.yaml' --include='*.yml' --include='*.json' \
--include='*.txt' --include='*.sh' --include='*/' \
--exclude='*.pt' --exclude='*.pth' --exclude='*.ckpt' \
--exclude='__pycache__' --exclude='.git' --exclude='data/' \
--exclude='wandb/' --exclude='outputs/' \
./ root@<HOST>:/workspace/project/
Install dependencies per the env contract (ordered phases — pins first, one
pip install per phase; see ../shared-references/compute-env-contract.md):
ssh -p <PORT> root@<HOST> "pip install -q torch==<pinned>" # phase 1: pins
ssh -p <PORT> root@<HOST> "pip install -q <remaining packages>" # phase 2+
Legacy fallback — requirements.txt only, no env spec: install as one phase,
and treat any version fight as the signal to convert to ordered phases:
scp -P <PORT> requirements.txt root@<HOST>:/workspace/
ssh -p <PORT> root@<HOST> "pip install -q -r /workspace/requirements.txt"
Step 3.5: W&B Integration (when wandb: true in CLAUDE.md)
**Skip this step entirely if wandb is not set o
자주 묻는 질문
어떤 GPU를 쓸지 어떻게 아나요?
프로젝트 메모의 환경 설정, 예를 들어 로컬, 원격, Vast.ai, Modal 중 무엇인지 읽습니다.
환경을 먼저 확인하나요?
네. 스킬은 긴 작업을 믿기 전에 환경 기록을 확인하고 간단한 테스트를 실행하라고 말합니다.
Modal은 어떻게 하나요?
Modal 작업은 배포를 자동으로 처리하는 서버리스 Modal 스킬로 넘어갑니다.
상세 정보
작성자의 원본 설명
Deploy and run ML experiments on local, remote, Vast.ai, or Modal serverless GPU. Use when user says "run experiment", "deploy to server", "跑实验", or needs to launch training jobs.
인기도
- GitHub 스타
- 18k
- 순위
- #10589
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
ablation-planner
18k에이전트가 논문의 제거 실험(ablation)을 계획하도록 돕습니다. 주요 결과가 좋아 보이면 심사위원이 요청할 가능성이 높은 실험을 고릅니다.
alphaxiv
18k에이전트가 arXiv 링크나 ID로 AlphaXiv 요약을 써서 논문 한 편을 빠르게 읽도록 합니다. 요약이 없으면 원문이나 LaTeX를 씁니다.
analyze-results
18k에이전트가 머신러닝 실험 결과를 분석하고, 실행 결과를 기준선과 비교하며, 숫자를 명확한 발견과 다음 단계로 정리하도록 돕습니다.
arxiv
18k에이전트가 arXiv에서 학술 논문을 검색하고, 세부 정보를 읽고, 연구 주제에 맞는 PDF를 내 라이브러리에 저장하도록 돕습니다.