GPU marketplaces like Vast.ai are a cheap way to fine-tune open models, as long as the data is not confidential: the host can see
the machine while your job runs. The harder problem is that training scripts assume the hardware under them stays alive.
When a host disappears, two things break:
- Checkpoints that only exist on the local disk are gone.
- If the machine hangs instead of dying, the rental keeps billing while nothing trains.
Here is what I ended up building, and what the measurements were.
1. Upload checkpoints outside the training loop. A small agent in the container watches the checkpoint directory and uploads
each finished checkpoint to Cloudflare R2. The training script writes a marker file when a checkpoint is complete, so half-written
ones are never uploaded. The agent uses a temporary key that only works for this job's folder.
2. Count traffic and start-up, not only the GPU price. One QLoRA 7B run was billed $0.81, most of it traffic for downloading
the model; after choosing hosts by the full hourly price including traffic, the next run was $0.19. In six later runs the first
training step came 4.5 to 8.5 minutes after renting, and those minutes are billed. My own rule of thumb, not a measurement:
checkpoint often enough that one lost interval costs less than one start-up.
3. Handle the dead host. A supervisor outside the GPU machine checks the instance and the agent's heartbeat. When the host
is gone it rents another machine, the agent restores the last checkpoint and the script resumes. In a test where I destroyed the
machine twice during one run, training continued after 3.5 and 13 minutes.
4. Handle the hung host. If the GPU stops responding for five minutes, or the job makes no progress for half an hour while the
GPU sits idle, the job is moved to another machine.
5. Handle the dead supervisor. If the supervisor itself goes away, nobody replaces failed machines or checks spending
limits. So the agent watches how long it has gone without a new storage key from the supervisor and, after a safety window, stops
the job and the machine from the inside. I tested this on Vast with the window shortened to a few minutes: the machine stopped,
and after that Vast billed only for disk. In normal settings the window is about 2.5–3.5 hours; I have not run a test of that
length.
Do it yourself or not. The hidden price of the free route is someone's time: setup, the recovery logic, a
watcher that runs around the clock and bill monitoring. If nobody on the team owns that, a service costs less
than the hours.
Disclosure: I run NomadGPU (nomadgpu.com), a small service that does the above on your own Vast.ai
account, with spending limits in dollars. Live numbers from our own test jobs:
status.nomadgpu.com/s/status.
Top comments (5)
This is the most honest accounting of rented-GPU fine-tuning I have read in a while. The part most write-ups skip is exactly your section 5: everyone builds the supervisor that replaces dead hosts, and almost nobody asks who replaces the supervisor. The self-destruct on a missing storage key, with the 2.5–3.5 hour window, is a genuinely elegant answer to that.
Two details I would steal immediately. First, the marker file so a half-written checkpoint is never uploaded — that is a lesson you only learn by losing one. Second, pricing by the full hourly cost including traffic and the 4.5–8.5 minute start-up, not the headline GPU rate. The $0.81 run turning into a $0.19 run once the model download was counted is the kind of number that reframes the whole marketplace.
One question on the hung-host rule: how do you tell a genuinely stalled job apart from a phase where the GPU legitimately idles, like a long evaluation or a checkpoint write? Does the 30-minute no-progress check look at step count, loss movement, or log heartbeats — and has a slow-but-healthy phase ever tripped it?
Great question — that's exactly the false positive we designed against, so the check is deliberately conjunctive: the 30-minute rule only fires when both conditions hold for the whole window.
GPU idle — every GPU at ≤ 2% utilization, and
Silence — nothing has touched any activity signal: we track the mtime of the job's log file, the progress file (the JSON the training loop rewrites with step counters), and the checkpoint directory.
A long evaluation pass or a big checkpoint write keeps updating at least one of those, so the silence timer keeps resetting — a slow-but-healthy phase looks nothing like a wedged process. We deliberately don't parse step counts or loss values: mtimes only, so the supervisor never has to understand each framework's log format.
No false positives in our runs so far, and there are two more guardrails for the edge cases: the timeout is per-job configurable (stall_timeout_s, 30 min by default), and if the same stall reappears on a different host, we stop the job instead of migrating again — the same symptom on fresh hardware means it's your code or data, not the machine, and renting a third host would just burn money.
The same loop also catches the harder failure mode: if nvidia-smi answered before and then goes silent for 5 minutes, the GPU has fallen off the bus (a real thing on bargain hosts) — that host gets replaced immediately, without waiting out the 30 minutes.
The gap between the 3.5 minute and 13 minute recoveries jumped out at me. Was the 13 minute one mostly from pulling the base model and checkpoint onto a slower host, or waiting on a replacement machine to spin up?
For LoRA adapters the R2 checkpoint upload is tiny, so frequent checkpointing is pretty cheap. I'm curious how well that rule of thumb holds up if you're doing full fine-tuning where each checkpoint is several gigabytes and eating into host bandwidth.
Good catch — and honest answer up front: we didn't instrument that test well enough to prove the cause, so let me give you what we know and what we don't.
Recovery time splits into: detection → renting a replacement → boot + agent start → image/model pull → checkpoint restore → resume. For LoRA adapters the restore step is negligible (a few hundred MB). The two kills landed on different replacement hosts, and our later A/B runs on 4 Nov showed the spread (3.5–5 min vs 13–17 min to first step) did not reproduce consistently across images — so it looks host-side (provisioning + pull speed on that particular machine), not image-side. Since then the supervisor logs a per-stage breakdown on every start ("machine + agent" vs "pull + prep" separately — e.g. 208 s vs 30 s on a recent run), so future failovers will answer this properly instead of anecdotally.
On full fine-tuning — you're right, and the naive rule of thumb breaks there. The hidden constraint: the save interval is bounded below by sustained upload throughput, not by your courage. Our measured LoRA rate is ~500 MB to R2 in ~18 s (~28 MB/s). A full-FT 7B checkpoint is ~14 GB weights-only (3× that with optimizer state) — that's ~8 minutes of upload at the same rate, ~19 minutes at the 100 Mbps floor we filter hosts by. Two consequences:
If the upload takes as long as the save interval, your real RPO is "last completed upload", not "last save" — the watcher quietly falls behind.
The cost math inverts: losing a 20-minute interval of full-FT compute no longer beats one 5–8 minute cold start.
So for full fine-tuning I'd reframe the rule: save as often as checkpoint_size / sustained_upload_rate allows, then compare that interval against one restart. The practical levers: rent hosts with 300+ Mbps upload (cuts a 14 GB push to ~5 min), save weights-only and pay the optimizer-warmup cost on resume, and watch traffic pricing even harder — 14 GB per save at $0.04/GB is $0.56 per checkpoint. All arithmetic from our measured 28 MB/s, not a benchmark — we haven't run the full-FT variant yet, so if you have real numbers, I'd genuinely like to see them.
Appreciate the honest breakdown. Splitting machine + agent from pull + prep in the logs makes a lot of sense, and 208s vs 30s already points pretty clearly to provisioning being the real bottleneck rather than the pull.
The checkpoint_size / upload_rate framing for full fine-tuning nails it too. Once the upload takes longer than your save interval, your actual RPO is just the last finished upload, and paying egress on 14 GB+ every few minutes adds up fast. On rented hosts, dropping optimizer state and eating a brief warmup on resume usually feels like the cleaner trade-off than trying to push 40 GB over variable host bandwidth.
I've mostly stuck to LoRA and QLoRA on 7B-8B runs so I don't have real full-FT numbers to share yet, but if I end up running one I'll pass them along.