run-experiment
Skill này làm gì
Skill này khởi chạy các job huấn luyện và thí nghiệm trên hạ tầng tính toán mà dự án của bạn dùng. Nó dành cho nhà nghiên cứu muốn chạy code trên GPU mà không phải tự thiết lập từng nền tảng.
Khi nào nên dùng
- ✓Khi bạn muốn bắt đầu một job huấn luyện trên GPU cục bộ hoặc máy chủ từ xa.
- ✓Khi bạn cần chạy thí nghiệm trên Vast.ai hoặc Modal serverless GPU.
- ✓Khi bạn muốn một lần chạy chỉ được khởi động sau khi môi trường đã được kiểm tra.
Liên kết skill
https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/run-experiment/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi cần chạy thí nghiệm huấn luyện của mình trên máy chủ GPU từ xa được mô tả trong cài đặt dự án.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc cài đặt dự án để tìm đúng môi trường, chẳng hạn máy chủ, instance Vast.ai hoặc ứng dụng Modal. Sau đó nó khởi chạy job và kiểm tra môi trường hoạt động trước khi chạy lâu dài.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Nó biết dùng GPU nào?
Nó đọc cài đặt môi trường trong ghi chú dự án, chẳng hạn cục bộ, từ xa, Vast.ai hoặc Modal.
Nó có kiểm tra môi trường trước không?
Có. Skill yêu cầu kiểm tra bản ghi môi trường và chạy thử đơn giản trước khi tin tưởng một job dài.
Còn Modal thì sao?
Các job Modal được chuyển cho skill Modal serverless, skill này tự động xử lý việc triển khai.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10589
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
ablation-planner
18kGiúp agent của bạn lên kế hoạch thí nghiệm ablation cho một bài báo, chọn các thí nghiệm mà người phản biện có khả năng yêu cầu khi kết quả chính đã ổn.
alphaxiv
18kCho phép agent của bạn đọc nhanh một bài báo nghiên cứu bằng các bản tóm tắt AlphaXiv, với toàn văn hoặc mã LaTeX dự phòng, từ liên kết arXiv hoặc ID.
analyze-results
18kGiúp agent của bạn phân tích kết quả thí nghiệm học máy, so sánh các lần chạy với một baseline, và biến các con số thành phát hiện rõ ràng và bước tiếp theo.
arxiv
18kCho phép agent của bạn tìm bài báo trên arXiv, đọc chi tiết của chúng và lưu PDF vào thư viện của bạn theo một chủ đề nghiên cứu.
Skill tương tự
pytorch-patterns
280kGiúp agent của bạn dùng PyTorch cho các mô hình học máy. Áp dụng thực hành tốt nhất để huấn luyện mô hình hiệu quả và đảm bảo kết quả có thể lặp lại.
evm-token-decimals
280kGiúp agent tránh lỗi về số thập phân khi làm việc với các mạng blockchain khác nhau. Đảm bảo giá trị token chính xác trong giao dịch và phép tính.
ito-inference
280kGiúp agent kiểm tra xem các mô hình AI đã sẵn sàng để dùng chưa. Kết nối yêu cầu tài nguyên tính toán với dịch vụ mô hình đã sẵn sàng.