Sailor: automating LLM training in the Cloud

PyTorch DeepSpeed GKE Docker Spot instances

The problem

Training large language models in the Cloud is expensive. The cheapest GPUs are spot (preemptible) instances, often 60–90% cheaper than on-demand ones, but the provider can reclaim them at any moment. Most training systems handle that badly: losing one node crashes the whole job, and recovery means restarting from a checkpoint in remote storage.

What Sailor does

Sailor automates ML training in the Cloud. Its core is an elastic, fault-tolerant runtime that keeps training going as nodes come and go: a master controller keeps track of every cluster, and when the set of nodes changes it pushes a new topology to each one.

My role

For my master's thesis I designed and built Sailor's elastic, fault-tolerant runtime: everything on this page, from in-memory checkpoints to recovering from a preemption. I also worked on Sailor's resource planner, which chooses a cost-effective cluster setup for a training job; this page focuses on the runtime.

Sailor architecture: a master controller in us-west1 sends topology updates to the cluster controllers of two GKE clusters (us-west1 and eu-west1) and receives heartbeats from them. Each cluster controller passes topology updates to its worker pods, and the worker pods in both clusters exchange gradients, activations and parameters through DeepSpeed. The master controller also talks to a GCP client. Master controller us-west1 gRPC endpoint GCP client Topology updates Heartbeat Topology updates Heartbeat GKE cluster · us-west1 Cluster controller K8s service Topology updates Worker pods replica set pod pod pod GKE cluster · eu-west1 Cluster controller K8s service Topology updates Worker pods replica set pod pod pod Gradients, activations, parameters DeepSpeed
One master controller coordinates training across GKE clusters in different regions

Recovering from a preemption

Checkpoints live in CPU memory instead of on disk or remote storage, with a full copy on a reliable on-demand node. When a spot node is preempted, a controller reconfigures the surviving nodes in place instead of restarting the job. The video walks through one recovery.

How Sailor recovers when a spot node disappears, followed by measured results (56 s, no sound)
  1. Catch the error. Instead of crashing, every surviving process catches the failure and pauses.
  2. Get the new config. The controller computes the new topology and tells every node its new rank and world size.
  3. Recover the checkpoint. Each node pulls its shard from the on-demand node's memory, not from remote storage.
  4. Clean up. Stale connections and error state from the old setup are cleared.
  5. Restart training. Training resumes on the remaining nodes from the recovered state.

For a 1.5B-parameter model on 8 nodes in one GCP region, training is running again 52 seconds after a preemption: 10 s to re-initialise the distributed group, 26 s to restart DeepSpeed and 16 s to recover the snapshot.

Results

Why it matters

Spot instances are only a bargain if training survives losing them. Making recovery fast and automatic turns that discount into real savings, so the same budget trains larger models.

Paper and code

Sailor was published at SOSP '25. The work is continued by the Efficient Architectures and Systems Lab (EASL) at ETH Zürich, and the code is open source.