Preemptible compute is in public preview for Kubernetes and Slurm clusters. There is no minimum-lifetime guarantee for preemptible nodes during preview, so design workloads that can survive losing nodes at any time.
- Standard nodes (the default) are provisioned up front (synchronously) when you create or scale a cluster, and are never preempted.
- Preemptible nodes fill in over time (asynchronously). You set a target, and Together provisions toward it as spare capacity becomes available. The target is not guaranteed, and preemptible nodes can be preempted at any time.
num_gpus), and you cannot convert a node between standard and preemptible in place.
On Kubernetes clusters, preemptible nodes carry the label together.ai/compute-class=preemptible, and all other nodes carry together.ai/compute-class=non-preemptible. Node names encode the compute type: gpu-dp is standard, gpu-preemptible-dp is preemptible.
On Slurm clusters, preemptible nodes join the same partitions as standard nodes and have the same slinky feature, so Slurm can’t tell them apart. Any job can land on a preemptible node. If adding preemptible capacity to a Slurm cluster returns a 400 with preemptible compute is not supported for Slurm clusters, contact your account team to enable it for your organization.
How preemption works
When Together reclaims a preemptible node, it drains the node for at most five minutes before removing it. Together then provisions replacement preemptible nodes toward your target as capacity becomes available, so you don’t need to re-request capacity. Here’s how preemption works for each cluster type.Kubernetes
- T+0: The node is cordoned, a
TogetherPreemptionNotifiedKubernetes event (type: Warning) is emitted on the node, and pods on the node receive SIGTERM. - Pods that set
terminationGracePeriodSeconds(capped at 300 seconds) get up to the full window to checkpoint and exit. The node is reclaimed as soon as your pods exit, so checkpoint and exit promptly instead of sleeping through the window. - T+5:00: The node is removed, regardless of pod status. Five minutes is a hard maximum, not a guarantee that pods finish.
Slurm
- T+0: Slurm drains the node. No new jobs start on it, and jobs already running keep running.
- Jobs that finish within the window exit normally.
- T+5:00: The node is removed, and any jobs still running on it are killed. Slurm requeues the killed jobs that were submitted with
--requeue.
Request preemptible capacity
Set a preemptible GPU target alongside the standard GPU count when you create or update a cluster. The clusters API uses these fields for the target and its progress:- Console
- CLI
To add preemptible capacity when you create a cluster:
- In the Together AI console, select Create cluster.
- Choose a GPU type, then set the standard GPU count under Select GPU Count.
- Under Add preemptible compute, set Preemptible GPUs in multiples of 8 (whole nodes). The form caps the count at the number of preemptible GPUs currently available for that GPU type. If none are available, try a different GPU type.
- Finish the rest of the form, select Create Cluster, then select Confirm & Create.
Schedule workloads on preemptible nodes
On Kubernetes clusters, target preemptible nodes explicitly for interruptible workers, and keep coordinators and serving replicas on standard nodes. Slurm clusters can’t target them.Kubernetes
Slurm
Slurm can’t target preemptible nodes or keep a job off them, so any job on a cluster with preemptible capacity can lose a node. Add--requeue to jobs that resume from a checkpoint, so Slurm resubmits them if a node is reclaimed while they run:
Key directives
Detect preemption
Kubernetes
Preemption surfaces through three channels:-
In-pod (recommended): A SIGTERM handler or
preStophook reacts automatically, with no polling. -
Kubernetes events: Watch for
TogetherPreemptionNotifiedevents: -
Together API (no kubeconfig needed): Reading a cluster returns a
node_lifecycle_eventsarray (72-hour retention, deduplicated by node and reason). Filter forreason == "TogetherPreemptionNotified". Related reasons includeTogetherNodeAddedandTogetherScaledDown.
Slurm
On Slurm clusters,TogetherPreemptionNotified events appear in the cluster’s node_lifecycle_events array in the Together API and in the console’s Event timeline, the same as on Kubernetes.
Inside a job, check SLURM_RESTART_COUNT at startup. Slurm sets it when it requeues a job, so a value above 0 means the job is restarting, for example after its node was reclaimed, and should resume from its latest checkpoint.
Handle preemption
Kubernetes
Pod-level: checkpoint on SIGTERM. This pattern is per-workload and requires no extra infrastructure. Claim the full grace window withterminationGracePeriodSeconds and checkpoint when the signal arrives:
The
preStop hook runs first, then SIGTERM, and both count against the same grace period. Use one or the other as the checkpoint trigger, not both doing duplicate work. The preStop variant matters for containers whose main process can’t trap signals, or where PID 1 swallows them.TogetherPreemptionNotified events and reacts, for example by draining a job queue, triggering a coordinated checkpoint, or removing the node from a Ray or torchrun worker pool:
Slurm
A job still running when its node is removed loses everything since its last checkpoint. Write checkpoints to shared storage under/home at a regular interval, and resume from the latest one when Slurm requeues the job. Checkpoint often enough that losing one interval of work is acceptable.
The following job script resumes from the latest checkpoint whenever SLURM_RESTART_COUNT shows that Slurm requeued it. train.py stands in for your training script, which saves a checkpoint to --checkpoint-dir every --checkpoint-interval steps and loads the latest one when passed --resume-from-latest:
When to use preemptible
Use preemptible compute for:- Checkpointed training, fine-tuning, evals, distillation, batch inference, and hyperparameter sweeps. Ray Train and PyTorch Lightning restart from checkpoints out of the box.
- Bursty research: raise the target for a sweep and drop it after. The cluster stays up.
- The only copy of a multi-day run with no checkpoints.
- User-facing serving replicas with no fallback capacity.
- Workloads with strict SLOs.