✅ BenefitsCloudIntermediate✨ AI-assisted

Benefits of Spot Instances for Batch AI Jobs

WittyTech··2 min read
#spot#finops#batch

A lot of AI compute doesn't need to run at a precise moment: re-embedding a document collection, running a nightly evaluation suite, fine-tuning a model or processing a backlog of transcripts. Spot instances, called spot or preemptible VMs on other clouds, sell spare capacity at a large discount. The catch is that the cloud provider can reclaim them at short notice.

Benefit 1: Much lower compute costs

Spot prices are often a fraction of on-demand prices, and the savings are largest on expensive GPU instances. For jobs that run for hours, that can decide whether a project is affordable at all.

Benefit 2: Access to more capacity

When on-demand GPUs are hard to get, spot capacity in other instance types or zones may still be available, especially if your job can run on several instance families.

Benefit 3: A natural fit for batch work

AI batch jobs usually process items independently or can save their progress. That's exactly the kind of work that survives an interruption without losing much.

Benefit 4: More resilient jobs everywhere

Designing for interruption, with checkpoints and idempotent steps, also makes jobs more reliable on ordinary instances, which fail sometimes too.

How to make jobs spot-friendly

  1. Checkpoint regularly. Save progress to object storage every few minutes, such as the last processed document ID or a training checkpoint.
  2. Handle the warning. AWS gives a two-minute interruption notice. Catch it and write a final checkpoint.
  3. Make steps idempotent. Reprocessing an item after an interruption shouldn't create duplicates.
  4. Diversify. Allow several instance types and zones, so one reclaimed type doesn't stop the whole job.
  5. Use managed orchestration. Karpenter on Kubernetes, AWS Batch or managed training services with spot support replace lost capacity automatically.

When spot isn't worth it

  • Latency-sensitive inference. Interruptions mean dropped or delayed user requests.
  • Short jobs. If a job takes ten minutes, making it interruption-safe may cost more than it saves.
  • Jobs that can't checkpoint. Repeatedly losing hours of work wipes out the discount.
  • Tight deadlines. When a job must finish by a fixed time, keep on-demand capacity as a fallback.

Pick your longest-running batch job, add checkpointing and run it once on spot capacity. Compare the cost and the number of interruptions with the previous run.

← More in Cloud