Black Friday: 10% off every GPU you launch, no code needed. Until 30 Nov. Rent a GPU

Arrakis / Blog / Train and fine-tune

Spot GPU Training: Checkpoint to a Volume, Resume Anywhere

Spot GPU training is the cheapest way to train, as long as losing the machine costs you minutes instead of days. The rule fits in one line: checkpoint to a volume, never only to the machine's disk, and make the script resume from the latest checkpoint on any machine. Do that and an eviction is a restart, not a disaster.

The deal with spot

Every machine in search has a tier. On-demand is yours until you stop it or its removal time comes. Spot is the cheapest tier, and its host can take it back at any time, with no notice.

What you get in exchange for that risk:

  • You pay only for the hours it ran. Every hour that began after a host took the machine back is given back.
  • You see the host before you rent. Search shows each host's record: launches, launch success, uptime and renter ratings. By default it also leaves out machines whose host is taking them back within two hours.
  • The price is locked when you rent, whatever the market does after.

Our own agent docs put the rule plainly: on-demand for runs over an hour or two, spot only for short work or work that saves checkpoints off the machine. This post is about the second kind.

What the discount buys

At the time of writing (November 2026), Arrakis listed twelve 8x B300 spot machines. The same month, getdeploying.com put the median on-demand B300 price across providers at about $9.50 per GPU-hour. Different tiers, so not a like-for-like quote, but spot sat well under the on-demand median.

Now price an eviction. The hour the machine was in is already paid, the work since your last checkpoint is gone, and the next machine needs a few minutes to start. With 30-minute checkpoints, the worst case is roughly an hour and a half of the machine, plus the restart. On a 10-hour run, the gap above pays for several of those before on-demand would have been cheaper. Without checkpoints, one eviction late in the run erases the savings and the run with them. That is the whole argument.

Where checkpoints live

A rented machine has two kinds of storage, and only one survives an eviction:

Machine disk Volume
Where /workspace /mnt
Kept Deleted with the machine Until you delete it
Cost Part of the GPU price Billed per GB-month of data held, charged daily
Speed Local disk, the fastest Network storage: fine for saving and loading, slower for many small reads

So split the work. Read the dataset from local disk, write checkpoints to the volume. Copy the dataset over once per machine:

Shell
cp -r /mnt/datasets /workspace/

That also keeps the bill flat. Reads are included each month up to the data the volume holds; reads well beyond that may be charged per GB, and we tell you before we do. An empty volume costs nothing. Details: Volumes.

Set it up once

1. Make a volume. In the console, pick New volume under Volume in the Rent sheet, or make one on Volumes first.

2. Find spot machines that can mount it. Machines marked No volume cannot, and a machine keeps the volume it was rented with, so filter up front:

Shell
curl -H "Authorization: Bearer $ARRAKIS_TOKEN" \
  "https://arrakis.goodailabs.com/v1/gpus?gpu_type=H100&tier=spot&volumes=true&sort=price"

3. Rent with the volume mounted. volume_id on POST /v1/instances mounts it at /mnt:

Shell
curl -X POST https://arrakis.goodailabs.com/v1/instances \
  -H "Authorization: Bearer $ARRAKIS_TOKEN" -H "Content-Type: application/json" \
  -d '{"node_id": "<node>", "name": "run-7-try-1", "ssh_public_key": "ssh-ed25519 AAAA...",
       "termination_hours": 12, "volume_id": "<volume id>", "idempotency_key": "run-7-try-1"}'

The removal time still matters on spot. If the run ends early or your script hangs, the machine goes at hour 12 instead of billing until you notice.

Make the script resumable

Three rules. Write checkpoints atomically, so a machine taken back mid-write never leaves a half file that looks finished. Keep the last two. On start, load the newest one if it exists.

Python
import glob, os, torch

CKPT = "/mnt/ckpt/run-7"
os.makedirs(CKPT, exist_ok=True)

def save(step, model, opt):
    tmp = f"{CKPT}/step-{step:08d}.pt.tmp"
    torch.save({"step": step, "model": model.state_dict(), "opt": opt.state_dict()}, tmp)
    os.replace(tmp, tmp[:-4])                       # only finished files end in .pt
    for old in sorted(glob.glob(f"{CKPT}/step-*.pt"))[:-2]:
        os.remove(old)                              # keep the last two

def resume(model, opt):
    done = sorted(glob.glob(f"{CKPT}/step-*.pt"))
    if not done:
        return 0
    state = torch.load(done[-1], map_location="cuda")
    model.load_state_dict(state["model"])
    opt.load_state_dict(state["opt"])
    return state["step"] + 1

Call resume before the loop and save every N steps. Add the learning-rate scheduler and the data position to the saved dict if your run needs an exact restart.

How often to save

Your checkpoint interval is the most work one eviction can cost you. Save every 30 minutes and the worst loss is 30 minutes of compute plus the restart: a new machine is usually ready to connect within 1 to 3 minutes, then your data copy and model load.

Saving is not free either. Each save writes the model and optimizer state to network storage while the GPU waits, so do not save every minute. Time one save on your first machine, then pick an interval where saving is a small slice of the run.

When the host takes it back

You will hear about it without polling a dead SSH session:

  • GET /v1/events (and get_events over MCP) lists machine.ended with the reason evicted when a host took the machine back.
  • Every MCP tool result carries the last day's alerts, so an agent sees the eviction whatever it asked.
  • A webhook under Notifications in the console pushes each event as it happens, signed with Arrakis-Signature.

Then rent the next machine with the same volume_id and a new name and idempotency_key (run-7-try-2). The script finds the newest checkpoint and carries on. One volume can be mounted on several machines at once and the last write wins, so give each run its own checkpoint folder.

When spot is the wrong call

  • The run cannot checkpoint, or a restart costs more than the savings.
  • Several machines train together and one eviction stalls them all.
  • There is a deadline. Rent on-demand, or for steady months of work look at reserved GPUs.

Switching tiers doesn't cost you the run. The volume outlives every machine, whatever its tier: rent an on-demand machine that takes a volume, attach the same volume_id, and the script resumes from the newest checkpoint. When the run is done, stop the machine. The checkpoints wait on the volume, billed per GB-month, while no GPU bills, and the next experiment starts from them. Keep public base weights off the volume: pull them from Hugging Face to /workspace on each machine, so the volume holds only what you made. The full on-demand pattern is in persistent storage for cloud GPUs.

For which GPU to train on, compare memory per dollar on the H100, H200 and B300 pages; right now an H100 starts at the live price per GPU-hour and a B300 at the live price. B300 supply comes in waves, which we tracked hour by hour in B300 availability. For serving rather than training, see spot vs on-demand for inference.

Train on spot, keep your progress

Make a volume, add twenty lines of resume logic, and pay spot prices without betting the run. Find spot GPUs that take a volume.

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Rent the GPUs in this post

New here? Use code FIRST25 for $25 off your first deposit of $50 or more, until 31 December 2026.

Lowest price now, per GPU-hour. Billed per started hour; stop any time.

Questions

Is spot GPU training worth it?
Yes, when the run saves checkpoints off the machine. A spot host can take the machine back at any time, so you lose only the work since the last checkpoint, and you pay only for the hours it ran.
Where should checkpoints go on a spot machine?
On a volume, mounted at /mnt. It outlives the machine, is billed per GB-month of data held, and the next machine you rent mounts the same volume.
How do I know my spot machine was taken back?
GET /v1/events shows machine.ended with the reason evicted, every MCP tool result carries the alert, and a webhook set under Notifications pushes it as it happens.
Am I charged after a host takes my machine back?
No. You pay for the hours it ran, and every hour that began after the host took the machine back is given back.

More from the blog

Every postRSS feed