Skip to content

Spot vs on-demand GPUs: which should you use for training?

Spot GPUs cost up to 90% less but can vanish with 30 seconds of notice. When spot wins for training, the break-even math, and how Nodus makes it safe.

Use spot GPUs for training that checkpoints often, and on-demand for anything that cannot lose 30 seconds of work. Nodus puts a job on spot only when that is cheaper to finish, and on a reclaim notice it takes an urgent checkpoint and restarts the run on a new machine. Without that kind of recovery, a few reclaims can make spot cost more than on-demand.

Spot and on-demand are the same hardware, sold on different terms. Spot is sold at a deep discount (AWS and Azure advertise up to 90% off, Google Cloud up to 91%). In return, the cloud can take the machine back with 30 seconds to 2 minutes of warning. This post covers what fails on a reclaim, how much rework a discount can absorb, and a setup you can copy.

Is spot or on-demand better for model training?

Section titled “Is spot or on-demand better for model training?”

Spot is better for most training jobs, as long as the job saves its full state to durable storage and can resume from it. On-demand is better when a run cannot checkpoint, when a deadline leaves no slack for a queue, or when the discount is small.

On-demand Spot (interruptible)
Hourly price List price Discounted, often 60% to 90% below list
Runs until You stop it You stop it, or the cloud needs the capacity back
Warning before a reclaim None needed 30 seconds to 2 minutes
Capacity when you ask Usually there Can be empty for hours
Best for Real-time inference, jobs that cannot checkpoint Checkpointed training, batch inference, sweeps, evals

How much notice does each platform give before a reclaim?

Section titled “How much notice does each platform give before a reclaim?”

AWS gives 2 minutes. Google Cloud and Azure give up to 30 seconds by default, which is less time than many teams need to write a full checkpoint.

Platform Listed discount Notice before reclaim How your code finds out What happens to the machine
AWS Spot Instances Up to 90% 2 minutes spot/instance-action in instance metadata returns JSON (404 until then) Stopped, hibernated or terminated
GCP Spot VMs Up to 91% Up to 30 s shutdown, best effort; an optional 120 s notice period before it instance/preempted metadata flips to TRUE, then a soft-off triggers your shutdown script Stopped or deleted
Azure Spot VMs Up to 90% Up to 30 s, best effort A Preempt event in Scheduled Events Deallocated (disks kept and billed) or deleted with its disks
Modal n/a Grace period after an interrupt signal Your exit handler Functions are preemptible by default (GPU Functions cannot opt out); restarted on the same input
Nodus n/a Urgent checkpoint request on a reclaim notice checkpoint.request with urgent: true on the events socket New attempt on another machine with your state directory restored

Sources: AWS interruption notices, AWS Spot, GCP Spot VMs, Azure Spot VMs, Azure Spot discount, Modal preemption. Checked November 3, 2026.

Default notice before a reclaim: 120 seconds on AWS Spot Instances, up to 30 seconds on GCP Spot VMs and up to 30 seconds on Azure Spot VMs. On Google Cloud and Azure, a save that takes longer than 30 seconds will not finish after the notice.

What actually breaks when a spot GPU is reclaimed?

Section titled “What actually breaks when a spot GPU is reclaimed?”

Most spot guides stop at “use checkpoints”. These failures still bite teams who do.

What breaks What you see Fix
Work since the last save is lost Run resumes from an old step, or from step 0 Save on a cadence, and save again when the notice arrives
Half-written checkpoint torch.load fails or loads a corrupt file on resume Write to a temp file, then os.replace it; keep the last two
Checkpoint on the machine’s local disk Nothing to resume from; local SSDs and deleted VMs take the data with them Write to object storage or a volume that outlives the machine
Only the weights were saved Loss spikes or repeated samples after resume Also save optimizer, LR scheduler, AMP scaler, RNG states, epoch and sampler offset
One rank of a multi-node job is reclaimed Every other rank hangs in an NCCL collective until it times out Restart the whole gang from a sharded torch.distributed.checkpoint
Script exits 0 after its emergency save The scheduler marks the run finished, and it never resumes Exit non-zero after a notice-triggered save
Spot pool is empty on relaunch Job sits pending for hours Accept several GPU types or regions, or fall back to on-demand
A restart loop that never makes progress You pay for boots that crash before the first save Cap retries by progress, not by count

When does spot actually cost less than on-demand?

Section titled “When does spot actually cost less than on-demand?”

Spot costs less until lost work and restarts inflate your billed hours past a limit set by the discount. That one formula is the whole decision:

billed hours = useful hours x (1 + save overhead) + reclaims x (lost work + restart time)
spot wins while billed hours / useful hours < 1 / (1 - discount)

At 30% off, the limit is 1.43x, so restarts eat the discount fast. At 50% off it is 2.00x, at 60% off 2.50x, at 70% off 3.33x and at 90% off 10.00x.

Spot stays cheaper than on-demand until billed hours reach 1.43x useful hours at 30% off, 2.00x at 50% off, 2.50x at 60% off, 3.33x at 70% off and 10.00x at 90% off. A shallow discount leaves almost no room for rework; a deep one forgives a lot.

We worked one example with illustrative rates: 8 GPUs, 20 hours of useful training, $4.00 per GPU-hour on-demand and spot at 60% off ($1.60). The run gets 3 reclaims, each restart takes 15 minutes (new machine, image pull, checkpoint load), and a 1 minute save every 30 minutes adds 3.3% overhead.

Setup Billed hours per GPU Cost for 8 GPUs
On-demand, no reclaims 20.0 $640
Spot, save every 30 min (about 15 min lost per reclaim) 20.67 + 3 x 0.5 = 22.2 $284
Spot, save every 30 min and on notice 20.67 + 3 x 0.25 = 21.4 $274
Spot, no checkpoints (reclaimed after 7 h, 12 h and 5 h) 24 + 20 + 3 x 0.25 = 44.75 $573

Cost of a 20-hour, 8-GPU run: on-demand $640, spot with saves every 30 minutes $284, spot that also saves on the reclaim notice $274, spot with no checkpoints $573. Checkpoints, not the discount, decide whether spot saves you money.

Checkpointed spot saves about 56%. Spot without checkpoints saves 10% while gambling the whole run, and a fourth reclaim more than about 5 hours into an attempt would push it past on-demand. For real inputs, the Nodus pricing page lists an H100 SXM at $2.60/hr and a B200 at $5.50/hr (checked November 3, 2026). Interruption rates vary by GPU and region; our post on how often spot GPUs are interrupted collects what each cloud publishes.

Pick on-demand when the job cannot save and reload its full state. Also pick it when the run must finish by a fixed time and a few hours of empty spot pool would hurt more than the extra cost. And it wins when the discount on the GPU you need is under about 30%. There the break-even ratio is so close to 1x that one or two reclaims erase the savings.

Real-time inference belongs on on-demand too, with spot used only for overflow or batch work. Before you compare hourly rates at all, our post on the true cost per finished job shows how idle time and storage change the real price of a GPU hour.

How do you catch a spot notice on AWS, GCP and Azure?

Section titled “How do you catch a spot notice on AWS, GCP and Azure?”

Run a small watcher next to your training loop (replace train_step and save_checkpoint with your own). A background thread polls each cloud’s metadata endpoint and also catches SIGTERM, which Kubernetes and most schedulers send before killing a container.

import signal, sys, threading, time, urllib.request
stop = threading.Event()
def _get(url, headers=None, method="GET"):
try:
req = urllib.request.Request(url, headers=headers or {}, method=method)
with urllib.request.urlopen(req, timeout=1) as r:
return r.read().decode()
except Exception:
return None # no notice yet, or a different cloud
def notice_pending():
# AWS: IMDSv2 token, then instance-action exists only after a notice
token = _get("http://169.254.169.254/latest/api/token",
{"X-aws-ec2-metadata-token-ttl-seconds": "300"}, "PUT")
if token and _get("http://169.254.169.254/latest/meta-data/spot/instance-action",
{"X-aws-ec2-metadata-token": token}):
return True
# GCP: preempted flips to TRUE on reclaim
if _get("http://metadata.google.internal/computeMetadata/v1/instance/preempted",
{"Metadata-Flavor": "Google"}) == "TRUE":
return True
# Azure: a Preempt entry in Scheduled Events
events = _get("http://169.254.169.254/metadata/scheduledevents?api-version=2020-07-01",
{"Metadata": "true"})
return bool(events) and '"Preempt"' in events
def watch(every=5):
while not stop.is_set():
if notice_pending():
stop.set()
time.sleep(every)
def on_sigterm(*_):
stop.set()
signal.signal(signal.SIGTERM, on_sigterm)
threading.Thread(target=watch, daemon=True).start()
for step in range(start_step, total_steps):
train_step()
if step % save_every == 0 or stop.is_set():
save_checkpoint(step) # atomic write to durable storage
if stop.is_set():
sys.exit(143) # non-zero: interrupted, not finished

Two limits. A full save must fit inside the notice (30 seconds on GCP and Azure by default), so keep regular saves frequent enough that a missed emergency save costs little. Inside Docker on AWS, the IMDSv2 token has a hop limit of 1 by default; raise it to 2 (aws ec2 modify-instance-metadata-options --http-put-response-hop-limit 2) or the watcher never sees the notice. The checkpointing walkthrough covers the save and resume code itself.

Nodus is an AI compute platform that runs each job on the cheapest capacity that will finish it, with checkpoints and recovery built in. Interruptible capacity is opt-in per job:

Terminal window
pip install nodus-compute
nodus login
nodus get gpus --interruptible -o wide # interruptible offerings, startup time, interruption rate
nodus run --gpu H100 --interruptible=allow --checkpoint /nodus/state --max-cost 25 --dry-run -- python train.py
nodus run --gpu H100 --interruptible=allow --checkpoint /nodus/state --max-cost 25 -d -- python train.py
nodus get attempts -l nodus.dev/job=<name> # one row per machine, with reasons such as Preempted

--dry-run prints the expected cost and start time without launching. allow uses interruptible capacity only when it is cheaper to finish, prefer (the bare --interruptible) favors it, and never keeps the job off it.

On a reclaim notice, Nodus asks your program for an urgent checkpoint over the events socket and prepares a replacement machine in parallel. The replacement starts only once the old machine is provably gone, with /nodus/state restored. A program that hangs cannot block the save: Nodus waits for the acknowledgement as long as the shutdown allows, then checkpoints anyway.

Two guards keep spot from running away. A run whose last two attempts made no progress stops with NoProgress instead of looping, and a preemption after real progress never counts toward that. --max-cost checkpoints the job and suspends it at the cap.

Your code still decides what goes into the state directory and loads it on start; the checkpoints guide has a complete example. Multi-node training is in Beta, and a lost rank restarts the whole gang from the latest checkpoint. New external accounts need prepaid credit or an approved offer to fund work.

How much notice do I get before a spot GPU is reclaimed? Two minutes on AWS, up to 30 seconds by default on GCP (with an optional 120 second notice period) and up to 30 seconds on Azure, as of November 3, 2026.

How often do spot GPUs get interrupted? It varies by GPU, region and week. AWS publishes monthly interruption bands per instance pool, Azure shows hourly eviction rates in its portal, and on Nodus nodus get gpus -o wide shows an interruption rate per interruptible offering.

Can I serve inference on spot GPUs? Batch and offline inference, yes. For real-time traffic, keep an on-demand floor and use spot only for overflow.

Is spot cheaper than reserved capacity? For bursty, checkpointed work, usually. If GPUs stay busy most hours for months, a reservation can beat spot with no reclaim risk; Nodus offers Reserved Compute in Beta.

What is the difference between spot and preemptible VMs on GCP? Preemptible VMs are the older model with a 24 hour maximum runtime. Spot VMs have no maximum runtime unless you set one.

More from the blog