← Back to all articles

November 27, 2026

gpuhop: run experiments on a rented cloud GPU with one command

10 min read

#gpuhop #gpu #mlops #reinforcement-learning

Most of the work in a GPU experiment has nothing to do with the GPU. You find an offer, wait for the box to boot, copy your code over, install dependencies, start the jobs in a tmux you hope survives, check on them, copy the results back, and then try to remember to shut the instance down before it bills you through the weekend.

gpuhop does all of that for you. You run one command on your laptop:

gpuhop exp rtx4090 exp/smoke.yaml

gpuhop rents the cheapest RTX 4090 that matches your filters, pushes your code, sets up the box, runs your jobs one by one, and pulls results, logs and videos back into your project. Then it destroys the instance, and it does that even when a job fails or you press Ctrl-C.

Install

gpuhop is not on PyPI yet. If you only want the command, install it as an isolated tool:

uv tool install git+https://github.com/prabhsuratsingh/gpuhop.git
# or
pipx install git+https://github.com/prabhsuratsingh/gpuhop.git

Append @v0.1.0 to the URL to pin a release. To hack on gpuhop itself, clone the repo and run pip install -e . instead.

It runs on Windows, macOS and Linux. It needs Python 3.10 or newer, git, and the OpenSSH client, which Windows 10 and later already include. You don’t need rsync, Docker or a GitHub account.

Your first run

gpuhop init my-project           # gpuhop.yaml, setup.sh, smoke.py, train.py, exp/*.yaml
cd my-project
cp .env.example .env             # set VAST_API_KEY
gpuhop doctor                    # checks config, API key, ssh key, ssh client, code push
gpuhop exp rtx4090 exp/smoke.yaml
ls results/rtx4090/smoke/

With the default pytorch template, that smoke experiment takes about five minutes including boot and costs a few cents. It trains a small MLP and brings back metrics.csv, summary.json and a fit.mp4 video of the fit.

gpuhop doctor lets you find mistakes before you pay for anything. gpuhop also rejects unknown keys in gpuhop.yaml, so a typo fails on your laptop instead of on a rented GPU.

What one exp does

validate exp files + package code locally         (mistakes cost nothing)
rent the cheapest matching offer                  (moves on to the next offer if a host never starts)
wait for ssh -> push code + env + runtime -> bootstrap: setup.sh (cached) -> smoke
for each experiment file:  run its jobs one at a time (detached in tmux; survives your laptop sleeping)
                           -> pull results/ + logs
final pull -> destroy

A few design choices are worth calling out:

  • Your working tree ships as it is, uncommitted changes included, minus anything .gitignore excludes. .env* is never shipped, and no secret is ever placed in the container’s environment.
  • setup.sh is cached. It runs once per instance and is skipped while it and the files in setup_hash_files haven’t changed.
  • The smoke test is a gate. It must pass before any job starts, so a host with a broken driver costs you seconds, not hours.
  • Jobs run strictly one at a time. Two jobs sharing a GPU would distort every timing they report.
  • Reruns are cheap. Jobs that already succeeded are skipped unless their command or the pushed code changed. If the job runner dies (host restart, out of memory), exp restarts it and resumes.

Built so it never leaks a GPU

A rented GPU costs you money in two ways: running longer than it needs to, and destroying results before you have them. gpuhop guards against both.

An instance whose results could not be pulled is never destroyed automatically. gpuhop prints the commands to recover it instead. If you really do want to throw the results away, pressing Ctrl-C twice during the final pull abandons them and destroys the instance.

The max_hours watchdog pulls and destroys after the configured time. It runs on your laptop, so it dies if your laptop does.

The failsafe covers that case. Right after renting, exp and smoke arm a job on Vast’s own servers that stops the instance if it is still up 15 minutes after the deadline. Vast runs it at the next full UTC hour, so the worst case is about one extra hour of GPU time, then storage only. Because it stops the instance instead of destroying it, your results stay on the disk. Recover them with:

gpuhop start && gpuhop wait && gpuhop pull && gpuhop down

If Vast refuses to arm the failsafe, exp destroys the new instance rather than run unprotected.

Sweeps in a dozen lines of YAML

An experiment is a YAML file in exp/:

name: sweep
timeout_min: 30
cmd: python train.py --lr {lr} --seed {seed}
jobs:
  - matrix: {lr: [0.003, 0.001], seed: [0, 1, 2]}
    name: "lr{lr}_s{seed}"                     # run ids: lr0.003_s0, lr0.003_s1, ...
  - name: video
    cmd: python record.py results/sweep/lr0.001_s0
    allow_fail: true

That expands to six training jobs plus an optional video job. Each job writes to its own $GPUB_RESULTS directory and also sees $GPUB_GPU, $GPUB_DPH (dollars per hour), $GPUB_HOST_CPU, $GPUB_HOST_DRIVER and $GIT_SHA. If you write those into your summary, every result records what it ran on and what it cost.

Everything comes back in a predictable layout:

results/<gpu>/<exp>/<run_id>/...              whatever the job wrote to $GPUB_RESULTS
results/<gpu>/_logs/<instance>/<exp>/<job>.log
results/<gpu>/_instance/<instance>/           bootstrap.log, smoke.json, provenance.json, instance.json

provenance.json records the git SHA, whether the tree was dirty, a hash of the diff and a hash of the shipped content. Months later you can still tell which code produced which numbers.

Fair comparisons across GPUs

The aliases rtx4090, rtx5090, rtx3090, a100, h100, l40s and l4 work out of the box. Comparing two GPUs takes two commands:

gpuhop exp rtx4090 exp/sweep.yaml
gpuhop exp l40s    exp/sweep.yaml

To keep the comparison honest, pin what you can in gpuhop.yaml. image_digest refuses to launch if the image tag has moved, cpu_regex and driver_regex filter hosts by CPU and NVIDIA driver, and gpuhop freeze writes a requirements.lock.txt so every instance installs exactly the same packages.

Isaac Lab, already set up

gpuhop init -t isaaclab scaffolds a headless Isaac Lab 2.3 / Isaac Sim 5.1 project with a per-task smoke test, PPO training with rsl_rl, and policy videos recorded in a separate camera process, so rendering never distorts training timings. The template already handles the Vulkan ICD, the EULA variables, a 150 GB disk for the roughly 15 GB of wheels, and a pin to the 580 driver branch, where the RTX renderer is stable.

gpuhop init -t isaaclab my-robot
cd my-robot && cp .env.example .env
gpuhop smoke rtx4090                 # ~25 min: boot + Isaac install + smoke, then destroy
gpuhop exp rtx4090 exp/seeds.yaml    # cartpole and ant, 3 seeds each

One hardware note: videos need RT cores (RTX 4090/5090, L40S, L4). An A100 or H100 can train, but it can’t render.

What’s next

Vast.ai is the only provider so far. Providers implement a small interface (search, create, show, list, destroy, start), and everything else (ssh transport, code push, bootstrap, job runner, pull) is provider-independent, so adding more is mostly a matter of wrapping each provider’s API.

gpuhop is MIT licensed. Try it, break it, and open an issue on GitHub.