Keep GPU jobs running: find the failure and test the recovery

Find the first failure, reproduce it on a small run and check that saved progress can be restored.

Scale up only after both the job and its recovery work.

Step 01 / 05

Reproduce the memory failure

Reducing the batch size helps only with the parts that depend on the batch.

  • An out-of-memory error means the job cannot get the memory it needs at that moment. Find the smallest input that still produces the error.
  • Record memory use around the failing operation. A full training step includes the model, data, intermediate results and information used to update the model.
  • Change one variable at a time, then repeat the same test. Check the complete training step, including the update, before declaring the problem fixed.
  • For our interrupted run, first establish whether memory caused the failure at minute 95. Saving more often would reduce repeated work, but it would not repair the memory problem.
Before moving on: have a reproducible failure and evidence that the chosen change fixes it.
Exhibit 2A smaller batch shrinks only the batch; the model and its update state may still not fitone training step against available memory
RunModel + update stateBatchFits?
Full batchunchangedfull✕
Smaller batchunchangedsmaller✕ may still exceed available memory
Source Illustration, not measured memory use; Lyceum
Step 02 / 05

Add GPUs gradually and read the first error

One worker’s failure can cause errors in all the others, so investigate the earliest relevant error first.

  • Distributed training splits work across several processes or machines. Keep a small working run as your reference before adding more GPUs.
  • Check that each worker receives the intended configuration, can access the data and can communicate with the others.
  • A restarted worker group is not proof of recovery. Your training code must load the intended saved state and continue from the correct point.
  • Increase the workload in stages. At each stage, compare the result, runtime and memory use with the reference run.
Before moving on: complete the larger run and explain any errors that appeared as you added workers.
Exhibit 3Sorted by time, worker 2’s error comes first; the errors after it may follow from itlogs → sorted by time
OrderWorkerError
01worker 2earliest relevant error
02worker 0error
03worker 1error
04worker 3error
Source Illustration, not a real run; Lyceum
Step 03 / 05

Record the environment and who restores what

The scheduler starts and places jobs; your training code is responsible for loading saved progress.

  • Keep a record for every run: container image version and dependencies, exact command and training configuration, dataset version and access requirements, names of required secrets (never their values in logs), and the output destination.
  • Our serverless training runs your Docker container on the GPU you choose. GPU VMs give you control over the machine’s environment.
  • Check storage before a long run. Docker runs mount the bucket at /mnt/s3 by default; VMs require you to configure access.
Before moving on: be able to recreate the environment and read a saved checkpoint from a fresh process.
Exhibit 4Restoring progress is your code’s job, and it needs storage that survives the machine
scheduler
  • Starts jobs
  • Places jobs
your training code
  • Loads saved progress
  • Produces the required outputs
storage
  • ✓ Storage bucket persists
  • ✕ VM disk is wiped on termination
Source Lyceum; storage documentation
Step 04 / 05

Keep training changes comparable

Fine-tuning and reinforcement learning can change quality and resource use even when the job completes successfully.

  • Fine-tuning trains a model further on your examples. Reinforcement learning trains it using a reward signal.
  • Test changes to memory handling, numerical precision and the training objective separately before combining them.
  • For recovery, model weights alone may not be enough. Save any other state your training code needs, too.
Before moving on: know whether each change improves the intended result and what resources it requires.
Exhibit 5Hold the evaluation fixed, record what each change costs and save more than the weights
fixedevaluation set · acceptance criteria
recordresult · memory use · elapsed time · cost
savemodel weights + optimiser state · training position
Source Lyceum
Step 05 / 05

Test recovery on a fresh machine

A checkpoint only counts once it has been restored: load it in a fresh process and continue the run.

  • Compare a resumed short run with an uninterrupted reference. Check the training position, outputs and evaluation behaviour. Investigate unexpected jumps or repeated work.
  • More frequent saves can reduce replay after a failure, but writing and validating them also takes time. Measure both costs before choosing a schedule.
  • Keep the previous valid checkpoint until the new one is complete and readable. Save to storage that survives the machine, and test access from the replacement environment.
  • When a service incident may be involved, compare the status page with your logs using matching timestamps.
Before scaling up: confirm that the job and its recovery both meet your acceptance criteria.
Exhibit 6A checkpoint is verified by resuming from it and comparing with an uninterrupted run
01 · checkpointsaved training state
02 · fresh processloading
03 · resumed short runcontinuing the run
04 · compareuninterrupted reference
Source Lyceum

Your next workload starts here