Aller au contenu
Skillpedia
Machine learning18k · #10615

run-experiment

Ce qu’il fait

Cette version Codex de la skill d'exécution d'expériences lance des tâches d'entraînement sur l'infrastructure de calcul de votre projet. Elle s'adresse aux chercheurs qui veulent exécuter du code sur un GPU depuis Codex.

Quand l’utiliser

  • ✓Quand vous voulez démarrer une tâche d'entraînement sur un GPU local ou un serveur distant.
  • ✓Lorsque vous devez lancer une expérience sur Vast.ai ou Modal.
  • ✓Lorsque vous voulez qu'un environnement soit vérifié avant le démarrage d'une longue exécution.

Lien du skill

https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/run-experiment/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/run-experiment/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“J'ai besoin que mon expérience d'entraînement soit lancée sur le serveur GPU distant décrit dans les notes de mon projet.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent lit les notes du projet pour trouver l'environnement, vérifie le GPU et démarre la tâche. Pour un nouvel environnement, il rédige une fiche de spécification et lance un test simple avant de faire confiance à la configuration.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

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 optional auto_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:

  1. Verify the instance is running and reachable.
  2. Sync code to the configured remote path.
  3. Confirm data/checkpoints are already mounted or intentionally copied.
  4. 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:

  1. Check if wandb is already in the script — look for import wandb or wandb.init. If present, skip to Step 4.

  2. 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()
    
  3. Metrics to log (add whichever apply to the experiment):

    • train/loss — training loss per step
    • train/lr — learning rate
    • eval/loss, eval/ppl, eval/accuracy — eval metrics per epoch
    • gpu/memory_used — GPU memory (via torch.cuda.max_memory_allocated())
    • speed/samples_per_sec — throughput
    • Any custom metrics the experiment already computes
  4. 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
Questions fréquentes

Où trouve-t-elle les informations sur le serveur ?

Elle lit le fichier AGENTS.md du projet, et vous demande les informations si aucune n'y figure.

Vérifie-t-elle d'abord le GPU ?

Oui. Elle effectue un contrôle préalable de la disponibilité du GPU avant de démarrer.

Et pour Modal ?

Modal est géré via son application serverless et la configuration de ses dépendances, comme le décrit la skill.

Détails

Description originale de l’auteur

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.

repo: wanshuiyin/Auto-claude-code-research-in-sleep

Popularité

Étoiles GitHub
18k
Position au classement
#10615
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires