run-experiment
Skill này làm gì
Phiên bản Codex này của skill chạy thí nghiệm khởi chạy các job huấn luyện 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 từ Codex.
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.
- ✓Khi bạn muốn môi trường được kiểm tra trước khi một lần chạy dài bắt đầu.
Liên kết skill
https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/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 thí nghiệm huấn luyện của mình được khởi chạy trên máy chủ GPU từ xa được mô tả trong ghi chú dự án.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc ghi chú dự án để tìm môi trường, kiểm tra GPU và khởi chạy job. Với một môi trường mới, nó viết một đặc tả và chạy một kiểm tra đơn giản trước khi tin vào thiết lập.
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 AGENTS.md to determine the experiment environment:
- Local GPU: Look for local CUDA/MPS setup info
- Remote server: Look for SSH alias, conda env, code directory
- Vast.ai instance: Look for
gpu: vast,vast_instance, SSH host/port, remote path, and optionalauto_destroy - Modal serverless: Look for
gpu: modal, app/function name, image/dependency setup, and secrets
If no server info is found in AGENTS.md, ask the user.
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).
Step 2: Pre-flight Check
Check GPU availability on the target machine:
Remote:
ssh <server> nvidia-smi --query-gpu=index,memory.used,memory.total --format=csv,noheader
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 AGENTS.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 AGENTS.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
If gpu: vast is configured, treat the Vast.ai machine as a remote server with an explicit lifecycle:
- Verify the instance is running and reachable.
- Sync code to the configured remote path.
- Confirm data/checkpoints are already mounted or intentionally copied.
- Record the instance id in the launch summary for later cleanup.
Do not silently ignore a requested Vast.ai route. If Vast.ai CLI credentials or instance metadata are missing, stop and ask the user to configure them.
Step 3.5: W&B Integration (when wandb: true in AGENTS.md)
Skip this step entirely if wandb is not set or is false in AGENTS.md.
Before deploying, ensure the experiment scripts have W&B logging:
Check if wandb is already in the script — look for
import wandborwandb.init. If present, skip to Step 4.If not present, add W&B logging to the training script:
import wandb wandb.init(project=WANDB_PROJECT, name=EXP_NAME, config={...hyperparams...}) # Inside training loop: wandb.log({"train/loss": loss, "train/lr": lr, "step": step}) # After eval: wandb.log({"eval/loss": eval_loss, "eval/ppl": ppl, "eval/accuracy": acc}) # At end: wandb.finish()Metrics to log (add whichever apply to the experiment):
train/loss— training loss per steptrain/lr— learning rateeval/loss,eval/ppl,eval/accuracy— eval metrics per epochgpu/memory_used— GPU memory (viatorch.cuda.max_memory_allocated())speed/samples_per_sec— throughput- Any custom metrics the experiment already computes
Verify wandb login on the target machine:
ssh <server> "wandb status" # should show logged in # If not logged in: ssh <server> "wandb login <WANDB_API_KEY>"
The W&B project name and API key come from
AGENTS.md(see example below). The experiment name is auto-generated from the script name + timestamp.
Step 4: Deploy
Remote (via SSH + screen)
For each experiment, create a dedicated screen session with GPU binding:
ssh <server> "screen -dmS <exp_name> bash -c '\
eval \"\$(<conda_path>/co
Câu hỏi thường gặp
Nó tìm thông tin máy chủ ở đâu?
Nó đọc file AGENTS.md của dự án, và sẽ hỏi bạn nếu không có thông tin máy chủ ở đó.
Nó có kiểm tra GPU trước không?
Có. Nó chạy kiểm tra sơ bộ về tính sẵn sàng của GPU trước khi khởi động.
Còn Modal thì sao?
Modal được xử lý qua ứng dụng serverless và thiết lập phụ thuộc, như skill mô tả.
Chi tiết
Mô tả gốc của tác giả
Deploy and run ML experiments on local or remote GPU servers. Use when user says \"run experiment\", \"deploy to server\", \"\u8dd1\u5b9e\u9a8c\", or needs to launch training jobs.
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10615
- 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.