Install any skill in seconds. Free to start, no credit card required.
Get Started Free →SSH job queue for multi-seed/multi-config ML experiments with OOM-aware retry, stale-screen cleanup, and wave-transition race prevention. Use when user says "batch experiments", "队列实验", "run grid", "multi-seed sweep", "auto-chain experiments", or when /run-experiment is insufficient for 10+ jobs that need orchestration.
.claude/skills/wanshuiyin-experiment-queue/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 144% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 95% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 245% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 173% | 0% |
Orchestrate large batches of ML experiments on SSH remote GPU servers with proper state tracking, OOM retry, stale cleanup, and wave transitions.
Use when /run-experiment is insufficient:
Do NOT use for:
/run-experiment)Based on session audit (2026-04-16), the major wall-clock sinks in multi-seed grid experiments are:
All of these are pure engineering friction that can be orchestrated.
> Environment contract: queue jobs assume the target env is already built > and validated per ../shared-references/compute-env-contract.md (spec-hash > ledger + kernel witness). A wave of jobs dying at import time = the env > contract was skipped, not a queue bug; check the provider's > .aris/compute/<provider>.md ledger before re-queueing.
A manifest lists jobs with explicit state:
yamlproject: my_grid_experiment cwd: /home/user/your_project conda: my_env # Optional: override conda hook path if conda is not at a standard location. # Can be a bare path (wrapped automatically) or a full `eval "$(... shell.bash hook)"` string. # Falls back to auto-detect of ~/anaconda3, ~/miniconda3, /opt/anaconda3, etc., # or the ARIS_CONDA_HOOK environment variable. # conda_hook: /custom/path/to/conda ssh: gpu-server default_cmd: > python run_distill.py --backbone softmax --lam 0.5 --K 500 --L 96 --W 16 --n_steps 30000 --batch_size 128 --lr 1e-4 preconditions: - type: checkpoint_exists path: checkpoints/transformer/teacher_L96_K500_N{N}.pt gpus: [0, 1, 2, 3, 4, 5, 6, 7] max_parallel: 8 gpu_free_threshold_mib: 500 # optional, default 500; raise for shared servers, lower for tight packing oom_retry: delay: 120 max_attempts: 3 jobs: - id: s200_N64_n50K args: {seed: 200, n_hidden: 64, n_train_subset: 50000, subset_seed: 2024} - id: s200_N128_n50K args: {seed: 200, n_hidden: 128, n_train_subset: 50000, subset_seed: 2024} # ... 14 more
pending → running → completed
↘ failed_oom → pending (after delay) [retry up to N]
↘ failed_other → stuck (needs manual inspection)
stale screen (process gone, screen lingering) → failed_other → stuck> Operator note on stuck (the agent's move, not the queue's): the queue > deterministically parks failed_other jobs as stuck — that part is code and > unchanged. Before handing a stuck batch to the human, the OPERATING AGENT > should check: if the same failure repeats across jobs, try ONE clean > reimplement of the agent-generated wrapper/attempt script only — never > user/project source, the manifest, queue state, logs, or results (per > external-cadence.md, "Let a broken attempt restart, not just patch"). > Reserve the human handoff for contract/environment doubts, not merely broken > attempt code.
A "wave" is a batch of jobs that fit available GPUs. Next wave only starts when:
Input can be:
N=[64,128,256] × n=[50K,150K,500K,652K])Bind run identifiers once so every later step refers to the same paths:
bash# REPLACE the placeholder path before running, or pre-export PROJECT_DIR: PROJECT_DIR="${PROJECT_DIR:?set PROJECT_DIR to the local project root}" RUN_TS=$(date -u +%Y%m%dT%H%M%SZ) LOCAL_RUN_DIR="$PROJECT_DIR/experiment_queue/$RUN_TS" mkdir -p "$LOCAL_RUN_DIR"
Save the built manifest to $LOCAL_RUN_DIR/manifest.json for reproducibility.
cwd exists on remotemax_parallel free GPUs)If any precondition fails, show user which jobs are blocked and why.
Resolve the bundled helper directory ($PROJECT_DIR / $RUN_TS / $LOCAL_RUN_DIR already set in Step 1). Phase 3.3 (Arch C) moved the canonical scripts to skills/experiment-queue/scripts/; tools/experiment_queue/ retains os.execv shims for legacy resolver layers:
bashif [ -z "${ARIS_REPO:-}" ] && [ -f .aris/installed-skills-codex.txt ]; then ARIS_REPO=$(awk -F'\t' '$1=="repo_root"{print $2; exit}' .aris/installed-skills-codex.txt 2>/dev/null) || true fi [ -n "${ARIS_REPO:-}" ] || { echo "ERROR: ARIS_REPO not set. Use install_aris_codex.sh managed install or export ARIS_REPO=/path/to/ARIS."; exit 1; } # Prefer the new canonical location; fall back to legacy tools/ shim path. QUEUE_TOOLS="$ARIS_REPO/skills/experiment-queue/scripts" [ -f "$QUEUE_TOOLS/queue_manager.py" ] || QUEUE_TOOLS="$ARIS_REPO/tools/experiment_queue" [ -f "$QUEUE_TOOLS/queue_manager.py" ] || { echo "ERROR: queue_manager.py not found at $ARIS_REPO/skills/experiment-queue/scripts/ or $ARIS_REPO/tools/experiment_queue/"; exit 1; }
Compute remote paths (note: modern scp runs in SFTP mode and does NOT reliably expand $HOME in destination paths — use remote-relative for scp, $HOME-prefixed for ssh command strings):
bashREMOTE_RUN_REL=".aris_queue/runs/$RUN_TS" REMOTE_RUN_DIR="\$HOME/$REMOTE_RUN_REL"
Bootstrap remote run dir + copy helpers + copy manifest. Per-invocation, idempotent:
bashssh <server> "mkdir -p \"$REMOTE_RUN_DIR/logs\" \"\$HOME/.aris_queue\"" scp "$QUEUE_TOOLS/queue_manager.py" "$QUEUE_TOOLS/build_manifest.py" <server>:.aris_queue/ scp "$LOCAL_RUN_DIR/manifest.json" <server>:"$REMOTE_RUN_REL/manifest.json"
Launch the scheduler as a detached nohup process:
bashssh <server> "nohup python3 \"\$HOME/.aris_queue/queue_manager.py\" \\ --manifest \"$REMOTE_RUN_DIR/manifest.json\" \\ --state \"$REMOTE_RUN_DIR/queue_state.json\" \\ --log-dir \"$REMOTE_RUN_DIR/logs\" \\ > \"$REMOTE_RUN_DIR/queue_mgr.log\" 2>&1 &"
Notes: --log-dir is what queue_manager.py actually consumes (per-job log files for OOM detection). Do NOT pass --log <path> — that flag is declared but unused.
Persist run identifiers for monitoring + resume (sourceable later):
bash{ printf 'PROJECT_DIR=%q\n' "$PROJECT_DIR" printf 'RUN_TS=%q\n' "$RUN_TS" printf 'LOCAL_RUN_DIR=%q\n' "$LOCAL_RUN_DIR" printf 'REMOTE_RUN_REL=%q\n' "$REMOTE_RUN_REL" printf 'REMOTE_RUN_DIR=%q\n' "$REMOTE_RUN_DIR" } > "$LOCAL_RUN_DIR/run_meta.txt"
%q shell-escapes values; REMOTE_RUN_DIR keeps a literal $HOME (correct for later reuse inside ssh "...").
Resume an existing queue. Do NOT regenerate RUN_TS. Reload from run_meta.txt and re-run only the launch command above (not the bootstrap):
bashLOCAL_RUN_DIR="/abs/path/to/project/experiment_queue/<existing-run-ts>" . "$LOCAL_RUN_DIR/run_meta.txt" # Then re-run the launch command verbatim; do NOT re-run mkdir/scp.
The scheduler:
screenqueue_state.json continuouslyUser can check state anytime, using $REMOTE_RUN_DIR from Step 3 (or reload it from $LOCAL_RUN_DIR/run_meta.txt):
bashssh <server> "cat \"$REMOTE_RUN_DIR/queue_state.json\"" \ | jq '.jobs | group_by(.status) | map({(.[0].status): length}) | add'
Note: /monitor-experiment is currently focused on screen sessions, result JSONs, and W&B; it does not yet read queue_state.json directly. For queue-state monitoring, use the literal command above.
When all jobs in manifest.json are completed or stuck:
queue_manager.py) exits cleanly with All jobs done to its own stdout (captured in $REMOTE_RUN_DIR/queue_mgr.log). It does NOT write the local summary.$LOCAL_RUN_DIR/summary.md (read $REMOTE_RUN_DIR/queue_state.json, group by status, optionally pull per-job logs)./analyze-results if analyze_on_complete: true.Instead of writing 24 job entries manually:
yamlgrid: N: [64, 128, 256] n: [50000, 150000, 500000, 652000] seed: [42, 200, 201] template: id: "s${seed}_N${N}_n${n}" args: {seed: ${seed}, n_hidden: ${N}, n_train_subset: ${n}}
Expands to 36 jobs automatically.
For sequential phases (teacher → student):
yamlphases: - name: train_teachers grid: N: [384, 512] template: cmd: python run_train.py --direction c --backbone softmax --n_hidden ${N} ... expected_output: checkpoints/transformer/teacher_L96_K500_N${N}.pt - name: distill_students depends_on: [train_teachers] # must be a LIST, even for a single dependency grid: N: [384, 512] seed: [42, 200, 201] template: cmd: python run_distill.py --n_hidden ${N} --seed ${seed} ... expected_output: figures/distill_sw_N${N}_*_seed${seed}.json
Scheduler enforces depends_on: distill_students jobs stay pending until every train_teachers job is terminal — completed or stuck. A failed teacher does not hold its students back, so check queue_state.json for stuck jobs before trusting a dependent wave.
Detect OOM from stdout:
regextorch\.OutOfMemoryError: CUDA out of memory
On detection:
failed_oomoom_retry.delay secondspendingoom_retry.max_attempts before marking stuckEvery 60s, for each running screen:
screen -ls)ps -p)completed, kill stale screenfailed_other, kill screenIf scheduler crashes / is killed:
queue_state.jsonrunning job: check screen; if still alive, keep; if not, re-evaluate statepending: continue normallymarkdown# Experiment Queue Summary **Project**: my_grid_experiment **Started**: 2026-04-16 11:36:29 **Completed**: 2026-04-16 18:02:14 **Total wall-clock**: 6h 25m **Jobs**: 40 completed, 2 OOM-retried then completed, 0 stuck ## Phases | Phase | Jobs | Success | OOM retries | Duration | | --- | --- | --- | --- | --- | | train_teachers | 2 | 2 | 0 | 58m | | distill_students | 24 | 24 | 2 | 4h 02m | | multi_seed_validation | 16 | 16 | 0 | 1h 25m | ## Results Files - 42 JSON files in `figures/distill_sw_*.json` ## Next Steps - Run `/analyze-results` on output JSONs - Figures auto-regen via `artifact-sync` (if configured)
/run-experiment| Feature | /run-experiment | experiment-queue | | --- | --- | --- | | Single-shot experiment | ✅ | ✅ (overkill) | | Multi-GPU parallel | Basic | Proper scheduling | | Wave transitions | Manual | Automatic | | OOM retry | Manual | Automatic | | Stale screen cleanup | Manual | Automatic | | Teacher→student chain | Manual | Built-in | | State persistence | No | Yes (JSON) | | Resume on crash | No | Yes | | Grid expansion | Manual | Declarative |
Rule: Use /run-experiment for ≤5 jobs. Use experiment-queue for ≥10 jobs or anything with phases.
memory.used < 500 MiB before launching new jobqueue_state.jsonstuck and alertdepends on has reached a terminal state. Note "terminal" includes stuck: if a teacher job fails, the phase still completes and its students launch against a missing checkpoint. Check queue_state.json for stuck jobs before trusting a dependent wave's results.
stuck, alertsUser: "跑 T5+T6 全部实验:T5 = N∈{80,192} × n 4 values × seed {200,201}, T6 = N∈{384,512} × n 4 values × seed {42,200,201}; T6 需要先 train teacher"
Claude invokes /experiment-queue:
Then user can check anytime or wait for summary report.
/run-experiment — single experiment deployment/monitor-experiment — check progress (now reads from queue_state.json)/analyze-results — post-hoc analysisskills/experiment-queue/scripts/queue_manager.py (canonical, Phase 3.3 move) — the scheduler implementation. Legacy entry at tools/experiment_queue/queue_manager.py is an os.execv shim.skills/experiment-queue/scripts/build_manifest.py (canonical, Phase 3.3 move) — build manifest from grid spec. Legacy entry at tools/experiment_queue/build_manifest.py is an os.execv shim.Identified via 2026-04-16 post-mortem analysis (Codex GPT-5.5 xhigh) of a 1.5-day multi-seed paper experiment session:
This skill targets the wall-clock sink specifically; see artifact-sync and paper-fix-auto-apply for the other two.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→pass | 16,399 | 8,737 | -47% | 1 | 1 | 0% | 2,591 | 6,324 | +144% | 0 | 0 | — |
case-01 | fail→fail | 26,303 | 17,892 | -32% | 1 | 1 | 0% | 3,994 | 5,315 | +33% | 0 | 0 | — |
case-02 | fail→fail | 8,026 | 7,674 | -4% | 1 | 1 | 0% | 406 | 5,217 | +1185% | 0 | 0 | — |
case-03 | fail→fail | 27,057 | 10,427 | -61% | 1 | 1 | 0% | 5,197 | 5,307 | +2% | 0 | 0 | — |
case-09 | pass→pass | 13,519 | 2,871 | -79% | 1 | 1 | 0% | 1,982 | 5,274 | +166% | 0 | 0 | — |
case-04 | pass→pass | 8,058 | 3,713 | -54% | 1 | 1 | 0% | 1,223 | 5,471 | +347% | 0 | 0 | — |
case-05 | fail→pass | 25,883 | 16,170 | -38% | 1 | 1 | 0% | 5,027 | 7,502 | +49% | 0 | 0 | — |
case-06 | fail→pass | 20,505 | 8,261 | -60% | 1 | 1 | 0% | 3,135 | 6,123 | +95% | 0 | 0 | — |
case-07 | fail→pass | 8,957 | 2,686 | -70% | 1 | 1 | 0% | 1,528 | 5,269 | +245% | 0 | 0 | — |
case-10 | fail→fail | 15,819 | 6,831 | -57% | 1 | 1 | 0% | 2,300 | 5,922 | +157% | 0 | 0 | — |
case-11 | pass→pass | 11,529 | 7,758 | -33% | 1 | 1 | 0% | 1,784 | 5,382 | +202% | 0 | 0 | — |
case-12 | pass→pass | 10,503 | 3,390 | -68% | 1 | 1 | 0% | 1,655 | 5,262 | +218% | 0 | 0 | — |
case-13 | fail→pass | 13,162 | 5,693 | -57% | 1 | 1 | 0% | 2,084 | 5,691 | +173% | 0 | 0 | — |
case-14 | pass→pass | 10,036 | 4,247 | -58% | 1 | 1 | 0% | 1,746 | 5,545 | +218% | 0 | 0 | — |
case-15 | fail→pass | 9,119 | 3,771 | -59% | 1 | 1 | 0% | 1,758 | 5,543 | +215% | 0 | 0 | — |
case-16 | fail→pass | 10,710 | 7,337 | -31% | 1 | 1 | 0% | 1,611 | 6,136 | +281% | 0 | 0 | — |
case-17 | fail→pass | 15,143 | 4,512 | -70% | 1 | 1 | 0% | 2,106 | 5,676 | +170% | 0 | 0 | — |
case-18 | fail→pass | 13,550 | 5,257 | -61% | 1 | 1 | 0% | 2,480 | 5,819 | +135% | 0 | 0 | — |
case-19 | pass→pass | 6,521 | 3,117 | -52% | 1 | 1 | 0% | 1,141 | 5,417 | +375% | 0 | 0 | — |
case-20 | fail→pass | 14,611 | 12,005 | -18% | 1 | 1 | 0% | 2,506 | 6,806 | +172% | 0 | 0 | — |
case-21 | fail→pass | 15,351 | 7,231 | -53% | 1 | 1 | 0% | 2,426 | 5,993 | +147% | 0 | 0 | — |
case-22 | fail→pass | 22,167 | 4,052 | -82% | 1 | 1 | 0% | 3,320 | 5,604 | +69% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +55 percentage points is the difference between those two pass rates over the 19 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/11/2026 | +68% |
Other measured skills in the registry, with their headline benchmark lift.