Last updated: 30 November 2026
We should use today’s downtime to train ML systems because quiet hours, idle hardware and slower business periods are chances to do work that urgent projects usually push aside. A cluster that sits unused overnight can retrain a model, test a new feature set or run an evaluation backlog.
The case has limits. Downtime pays off only when the job has a purpose, can survive interruption, and must pass a quality check before release. Otherwise you simply turn spare capacity into extra bills and unreviewed models.
What “downtime” means for ML teams
The word covers several different situations, and each calls for a different plan.
- Idle compute: GPUs or CPUs you already pay for are underused at night, at weekends or between projects.
- Spare cloud capacity: Providers sell unused machines at a discount and can take them back.
- A business lull: Demand slows, so analysts and domain experts have time to define problems, label data and review results.
- Planned system downtime: An application is offline for maintenance. Training can run then only if its data and hardware are not part of that maintenance.
The business-lull argument drew attention in 2020, when the COVID-19 pandemic slowed many organizations. That period also exposed a catch. In May 2020, MIT Technology Review reported that sudden changes in shopping and other behavior were disrupting some machine learning models, and some needed human correction.
The lesson still applies: spare time is useful for building ML capability, but data from an unusual period may not describe what comes next.
Why use downtime to train ML systems
Capacity that would otherwise expire
An unused hour on owned or reserved hardware cannot be saved for later. Filling it with useful work raises the return on that spend, although power, storage and support still cost money.
Cheaper interruptible machines
If you rent compute, spare-capacity offers can lower the price. Google Cloud, for example, advertises Spot VM discounts of up to 91% against on-demand pricing for many machine types and accelerators. Actual prices vary, availability is not guaranteed, and Spot VMs carry no service level agreement.
Room for deferred work
Good candidates include retraining on newer data, hyperparameter searches, fine-tuning experiments, backtesting, and tests on important data subgroups. Teams can also repair data pipelines and document how a model should be judged. None of this needs a GPU, yet it often decides whether training is worthwhile.
Time for people to take part
A model needs a clear decision to support. A slower period can let business and technical staff choose a low-risk use case, agree on a success measure and build a small proof of concept.
How opportunistic training works
The pattern is simple. A training job waits for free capacity, runs at low priority, saves its state often, and gives way when more important work arrives. Later it resumes from the last checkpoint. A finished model goes to evaluation, not straight to production.

Interruption is the normal case
Cloud providers give little warning, and the details differ. These figures reflect provider documentation at the time of writing.
| Platform | Warning before reclaiming capacity | What to plan for |
|---|---|---|
| Amazon EC2 Spot | Two minutes for stop or terminate, delivered on a best-effort basis. Hibernation begins immediately. | Watch EventBridge or instance metadata. AWS suggests checking every 5 seconds. |
| Google Cloud Spot VMs | Selectable notice of 120 seconds or 0 seconds (the default), then a best-effort shutdown period of up to 30 seconds. | Set the notice when creating the VM and handle shutdown in your workload or a script. |
| Azure Spot VMs | 30 seconds. In-VM Scheduled Events are opt-in and best effort. | Choose deallocate or delete. Delete also removes the underlying disks. |
Because warnings can be short or best effort, save checkpoints regularly. Treat the notice as a bonus chance to save, not your only one.
Choosing where to run the work
| Approach | Best fit | Main trade-off |
|---|---|---|
| Timed off-hours jobs | Small teams with predictable quiet periods | Jobs may overrun into busy hours |
| Kubernetes priority classes | Shared clusters running services and batch work | Priorities need access controls and quotas |
| Kueue quota borrowing | Several teams sharing Kubernetes resources | Borrowed capacity can be reclaimed, depending on preemption policy |
| Slurm preemption | HPC-style clusters | Requeue, grace time and signals must be configured and handled |
| Cloud spot capacity | Fault-tolerant training without owned hardware | No guarantee of availability or runtime |
Practical example: a resumable training job
The following PyTorch script uses toy data. It restores the model and optimizer, saves periodically, and saves again when it receives SIGTERM. It has not been tested here.
import os
import signal
import sys
import torch
CKPT = "/mnt/durable/ckpt.tar" # must outlive the machine
TOTAL_STEPS = 10000
stop = False
def request_stop(signum, frame):
global stop
stop = True
signal.signal(signal.SIGTERM, request_stop)
model = torch.nn.Linear(10, 1)
optimizer = torch.optim.Adam(model.parameters())
step = 0
if os.path.exists(CKPT):
state = torch.load(CKPT, weights_only=True)
model.load_state_dict(state["model_state_dict"])
optimizer.load_state_dict(state["optimizer_state_dict"])
step = state["step"]
def save():
tmp = CKPT + ".tmp"
torch.save({
"step": step,
"model_state_dict": model.state_dict(),
"optimizer_state_dict": optimizer.state_dict(),
}, tmp)
os.replace(tmp, CKPT) # swap in the completed file
model.train()
while step < TOTAL_STEPS and not stop:
x = torch.randn(32, 10)
y = x.sum(dim=1, keepdim=True)
loss = torch.nn.functional.mse_loss(model(x), y)
optimizer.zero_grad()
loss.backward()
optimizer.step()
step += 1
if step % 500 == 0:
save()
save()
if step < TOTAL_STEPS:
sys.exit(143) # report unfinished work, not success
A real job usually needs more state, such as the learning-rate scheduler, data loader position and random number generator states. Check that your storage supports the safe file replacement shown here.
A cloud interruption notice may not reach your process as SIGTERM in time. Add a watcher for your provider’s notice that signals the trainer. Also confirm that your launcher or container passes signals through.
Give the job a low priority
In Kubernetes, a PriorityClass can mark training as background work. This untested example ranks it below pods with the usual default of zero, assuming your cluster has no different global default. It also stops these pods from preempting others.
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: idle-training
value: -5
preemptionPolicy: Never
globalDefault: false
description: "Background training that yields to other work"
Reference it with priorityClassName: idle-training in the pod template. Make sure a controller will recreate evicted pods.
On Slurm, requeue preemption needs a requeueable job. Its default grace time is zero, so ask your administrator to set enough time for a checkpoint.
Protect model quality
Question the data first
Records collected during a shutdown, holiday or demand slump may be unrepresentative. Label such periods in your dataset. Compare models trained with them, without them, and with reduced weight, using test data that reflects the conditions you expect to serve.
Set a release gate
Compare each candidate with the current production model on the same held-out data. Check key slices as well as the overall score, because a strong average can hide a weak group. Roll out gradually and keep a way to return to the previous version.
Monitor after release
Google’s machine learning guidance recommends checking for differences between training and serving data, tracking model age, validating data schemas, and testing for numerical problems such as NaN values. Retrain when evidence or a defined schedule calls for it, not merely because a machine is free.
Best practices
- Keep a ranked backlog of training jobs, each with an owner, goal and stopping rule.
- Set spending, runtime and retry limits before automating anything.
- Version code, data, configuration and checkpoints together.
- Measure how long a checkpoint takes to save and restore.
- Keep durable copies away from disposable machines, and delete old ones on a schedule.
- Apply the same privacy and access rules to night-time jobs as to any other.
- If emissions matter, consider carbon-aware scheduling. Tools such as the Green Software Foundation’s Carbon Aware SDK provide carbon data that can help shift flexible work. Idle hours are not automatically low-carbon hours.
Common mistakes and troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| Job restarts from zero | Checkpoint is on temporary disk or is never loaded | Use durable storage and test a restore |
| Checkpoint is missing or old | Saving takes longer than the warning allows | Save periodically and shorten save time |
| Little progress overnight | Frequent preemption or slow startup | Track useful steps per hour and change capacity type or timing |
| Interrupted job shows as complete | Script exits successfully after SIGTERM | Return a nonzero status for unfinished work and verify retry behavior |
| New model performs worse live | Unrepresentative data or training-serving differences | Roll back, compare data and strengthen the release gate |
A hypothetical example: if saving takes 50 seconds and your platform gives 30 seconds’ warning, an emergency save will not finish. Your periodic interval then determines how much work you can lose.
Hands-on exercise: rehearse an interruption
- Run the script above on a test machine, changing the checkpoint path to a writable folder. Increase the total steps if it finishes too quickly.
- Find its process ID and run
kill -TERM PID, replacing PID with that number. - Check the exit status and load the checkpoint to read the saved step.
- Restart the script and confirm it continues. Add a print statement to make this visible.
- Repeat with
kill -KILL PID. No final save can run, so measure the work lost since the last periodic checkpoint. - Write down an acceptable loss window and set the save interval to match.
FAQ
Is training during downtime free?
No. Owned hardware still uses power, and cloud jobs incur charges for compute, storage and sometimes data movement. Staff time for review counts too.
Should every model be retrained whenever capacity is available?
No. Retrain when there is new relevant data, declining performance, a meaningful data change or an agreed schedule. Every candidate should pass evaluation.
Can large model fine-tuning use interruptible capacity?
It can, if the framework restores all required state reliably. Large checkpoints and multi-machine jobs make saving and restarting harder, so rehearse at realistic scale.
What if we have no spare GPUs?
Use the quiet period on data quality, labels, baselines, evaluation sets and monitoring. Many smaller models can also be trained on CPUs.
Where to start
Pick one low-risk model and one predictable idle window. Add checkpoints, assign low priority, cap the budget and define the score a candidate must beat. Rehearse an interruption before relying on the schedule.
After a few runs, compare cost, completed work and model quality. If downtime produces something you can trust and use, expand it. If not, switch the capacity off or give it a better job.