The idea. A synchronous training job is one program spread over hundreds or thousands of GPUs that moves only when every piece is present. So the infrastructure around it does four things: give the whole job its machines at once, start and connect one process per GPU, restart all of them from a checkpoint when any one fails, and meter what the GPU-hours bought. Slurm, Kubernetes and Ray split those duties differently; the duties stay the same.
Fig. 1 is the page: the life of one training job on this topic's own Slurm lab cluster, each part lit where it acts, with the section here and the child page whose own figure teaches it. Kubernetes and Ray do the same duties under other names, given in each step.
sbatch to slurmctld. Kubernetes: a JobSet in a Kueue queue. Ray: a job on a running Ray cluster. Owners: Slurm from zero, whose hero follows one job through this same lab cluster from its log and whose backfill figure steps the main loop and the backfill loop; Kubernetes for ML, whose control loop follows one Job object. Tool: Scheduling lab.gpu:2 each, while c3 stays free. Slurm gives one allocation from slurmctld; Kubernetes needs Kueue to admit a JobSet whole; Ray reserves a placement group. Without it, Kubernetes placed half of each of three jobs and held 12 of 12 GPUs with no step run (section 2). Owner: Kubernetes for ML, whose all-or-none figure replays that deadlock and its fix; Ray's Fig. 4 shows the placement group behind Ray Train.srun then torchrun, meeting at rank 0's store on c1:29500. Kubernetes: a pod per node, pod 0's DNS name. Ray: Ray Train sets it all. Submit to the first finished step, medians of 5: 7.5 s on Slurm, 5.8 s on Kubernetes, 10.0 s on Ray measured (section 4). Owner: Launching distributed training, whose Fig. 1 times every link of this launch and Fig. 3 finds the one stuck rank in a hang. Tool: Launch lab.A map, not a mechanism: each step lights the part one child page owns. Below, each section ends at the child page that owns its subject, and the lab tabs run the same job through all three systems. The cluster drawn is the lab's; the queue's other jobs, the meter and the tracker are illustrative, the numbers are measured or derived as labelled.
You need: what data parallelism is and why every rank must join each gradient all-reduce (Distributed Training). Nothing on the cluster side is assumed.
srun, Ray Train)The running example. one small PyTorch training job: a character-level GPT (2 layers, 2 heads, width 64, 112,577 parameters) on TinyShakespeare, trained with DDP over gloo (the CPU stand-in for NCCL) as 4 ranks on 2 "nodes" of 2, for 200 deterministic steps, checkpointing every 50 steps (1.4 MB each) and resuming exactly from the last one. It is packaged once as a container image and submitted the way each system expects: sbatch on a Slurm cluster in containers, a JobSet admitted by Kueue on a kind Kubernetes cluster, and Ray Train on a Ray cluster in containers (definitions in the root's src/data/). Every lab tab submits that one job, so its queueing, launch, failures, checkpoints and cost compare across the three systems. The clusters are real Slurm, Kubernetes and Ray software in containers on an Apple M1 Pro: what the systems do (which job runs where and when, what a failure does, the logs, the environment) is real; how fast is laptop speed, not data-centre speed.
Labels: measured here in October 2026; published by an operator about its own cluster or run; vendor a company about what it sells; independent no stake; derived with the formula shown; simulated by a small model of the mechanism; unconfirmed no primary source found.
A node is one server: typically 8 GPUs, two CPUs, local NVMe disks and one network card per GPU (Meta trained Llama 3 405B on servers of eight GPUs and two CPUs, up to 16K H100s in all, Llama 3 §3.3.1 published). A cluster is many nodes plus four things that make them one machine:
slurmctld, Kubernetes' API server and scheduler, Ray's head node). What each runs, and how one job lands on the machines step by step, is Cluster anatomy, section 3 (its job stepper).Two units recur everywhere: the GPU-hour (cost and quota) and the rank (one process, normally one per GPU; a job on 128 nodes of 8 GPUs has 1,024 ranks).
There are more jobs than GPUs, and a distributed job is useless until it holds all its GPUs at once. A scheduler (also workload manager or batch system) keeps a queue of requests (8 nodes of 8 GPUs for 12 hours) and a policy that decides which starts next and where. Every system in this topic combines the same seven ideas; section 3 shows how each expresses them.
--time). EASY backfill protects only the first waiting job's reserved start; conservative backfill protects every waiting job.Gang scheduling, measured. On the topic's kind cluster (12 fake GPUs on three workers), three JobSets of 2 pods × 4 fake GPUs went to the default Kubernetes scheduler, which places pods one at a time: it placed the first pod of each job and left a1, b1 and c1 Pending ("3 Insufficient example.com/gpu"). Each running pod waits at its rendezvous for a partner that cannot be placed: 12 of 12 GPUs held for 246 s with no training step, until the lab gave up. Through Kueue, which admits a job only when all of it fits, the same three ran one after another; the waiting ones held nothing and showed a policy message instead of a deadlock: "insufficient unused quota for example.com/gpu in flavor default-flavor, 4 more needed". The cost is that 8-GPU jobs fill at most 67% of a 12-GPU quota measured, 16 October 2026. OpenAI hit the same deadlock at scale: "Kubernetes might schedule only half of each experiment's pods, leading to a deadlock where neither experiment can make progress", fixed with a gang-scheduling plugin (OpenAI, Jan 2021) published. The run is replayed event by event in the Scheduling lab, section 5; the same input with Kubernetes' native PodGroup is Kubernetes for ML's all-or-none figure (its section 7).
Backfill on real Slurm. The Scheduling lab ran one eight-job queue on the topic's Slurm cluster with backfill off and on: the queue drained at 16:48 against 14:48, utilisation of the 8 GPUs rose from 71% to 80%, and the mean wait fell from 8:09 to 3:06 (minutes:seconds) measured. The price is honest time limits: a job that asks for three times what it needs looks too long for any gap and is never backfilled. How Slurm's main loop and backfill loop decide, step by step, is Slurm from zero, section 6 (its backfill figure).
Three systems hand out machines for training, from three worlds. Slurm comes from supercomputing: you ask for an allocation (whole nodes, for a time limit) with sbatch, a central slurmctld runs the queue with priorities, backfill and fairshare built in, and srun starts your processes on every node through a slurmd on each. Kubernetes comes from running web services: everything is a container in a pod, controllers keep declared YAML true, and kube-scheduler places pods one at a time on nodes that advertise GPUs through a device plugin (nvidia.com/gpu: 8); batch behaviour comes from add-ons (Kueue for queues, quotas and whole-job admission, JobSet for a group of pods as one job, Volcano, the Kubeflow Trainer). Ray comes from distributed Python: a runtime, not a cluster scheduler, with a head node holding cluster state (the GCS), a raylet per node scheduling tasks and actors, a shared-memory object store, and Ray Train to start a worker group; it usually runs on Kubernetes through KubeRay and leaves team quotas to the layer below (Kueue can admit Ray jobs: Kueue docs).
| Slurm | Kubernetes (+ Kueue, JobSet) | Ray | |
|---|---|---|---|
| Unit you submit | a batch script asking for nodes and a time limit | a YAML object (Job, JobSet, TrainJob) with a container image | a Python script (a Ray job) on a running Ray cluster |
| Gang scheduling | built in (an allocation) | not in the default scheduler (1.37: native PodGroups behind a beta gate, off); Kueue or Volcano add it | placement groups reserve all bundles at once |
| Queues, fairshare, quotas | built in (partitions, accounts, QOS, multifactor priority) | Kueue: ClusterQueues, cohorts that lend and borrow, preemption | none across teams; from the layer below |
| Environment | the node's software, or containers via an add-on | always containers | a Python environment per job (runtime env), often in containers |
| When a node dies | job killed; requeue if asked; node set to DRAIN or DOWN | pods fail; JobSet or Job restarts per its policy; node cordoned or tainted | Ray Train restarts the worker group from the last checkpoint (if configured) |
| Strongest at | big synchronous jobs on fixed bare-metal clusters, many users, simple mental model | one platform for training, serving and pipelines; cloud elasticity; ecosystem | jobs that are many programs at once: RL with rollouts, data pipelines, hyperparameter search |
| Weakest at | services, elasticity, container-native workflows | batch semantics need several add-ons; more moving parts to debug | cluster-wide fairness and quotas; another runtime to operate |
How each system expresses each scheduling idea of section 2 (backfill, fairshare, preemption, gang, quotas, placement) is one table in the Scheduling lab, section 8.
The training code is identical in all three, and so is the result: the global loss agreed bit for bit at all 21 logged steps on Slurm, Kubernetes and Ray (step 200: 2.2638769149780273) measured (src/data/runs/compare.json). Only who starts the processes and how they learn each other's address changed: c1 from Slurm's node list, a pod DNS name from JobSet, an IP chosen by Ray. That difference is section 4.
#!/bin/bash
# The running example on Slurm: 2 nodes x 2 ranks. One torchrun per node (srun starts them), c10d rendezvous
# on the first node of the allocation. Submit as a lab user: su alice -c "sbatch /shared/jobs/train.sbatch"
# Extra arguments go to train.py, e.g. sbatch train.sbatch --steps 400 --step-sleep-ms 50. RUN names the output dirs.
#SBATCH --job-name=mi-train
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=2
#SBATCH --gres=gpu:2
#SBATCH --time=00:10:00
#SBATCH --output=/shared/out/%x-%j.out
#SBATCH --requeue
set -euo pipefail
export MASTER_ADDR=$(scontrol show hostnames "$SLURM_JOB_NODELIST" | head -n1)
export MASTER_PORT=29500
RUN=${RUN:-slurm-$SLURM_JOB_ID}
echo "job $SLURM_JOB_ID nodes $SLURM_JOB_NODELIST master $MASTER_ADDR:$MASTER_PORT restart ${SLURM_RESTART_COUNT:-0}"
srun --kill-on-bad-exit=1 torchrun --nnodes="$SLURM_NNODES" --nproc-per-node=2 \
--rdzv-backend=c10d --rdzv-endpoint="$MASTER_ADDR:$MASTER_PORT" --rdzv-id="$SLURM_JOB_ID" \
/opt/mi/train.py --ckpt-dir "/shared/ckpt/$RUN" --log-dir "/shared/logs/$RUN" "$@"job 1 nodes c[1-2] master c1:29500 restart 0
$ sacct (one line per job)
JobID|JobName|User|Account|Partition|State|ExitCode|Submit|Eligible|Start|End|Elapsed|NodeList|AllocTRES|TotalCPU|MaxRSS|
1|mi-train|alice|teama|batch|COMPLETED|0:0|2026-10-16T01:10:20|2026-10-16T01:10:20|2026-10-16T01:10:21|2026-10-16T01:10:31|00:00:10|c[1-2]|billing=5,cpu=4,gres/gpu=4,node=2|00:31.938||
rank 0 at start: host c1, world 4, local_rank 0
env {
"master_addr": "c1",
"master_port": "35789",
"group_rank": "0",
"local_world_size": "2",
"torchelastic_restart_count": "0",
"slurm_job_id": "1",
"slurm_procid": "0",
"slurm_nodeid": "0"
}
rank 0 at the end: step 200, global loss 2.2638769149780273src/data/slurm/train.sbatch, submitted with sbatch on Slurm 24.11.5 (the Debian 13 package; upstream is at 26.05.5) in containers (3 nodes, fake GPUs counted but not used). Output: the script's first line, sacct's record, and what rank 0 logged. torchrun's c10d rendezvous met at port 29500, then gave the workers a fresh store port, hence master_port 35789.
# The running example on Kubernetes: a JobSet with one replicated Job of 2 pods (Indexed), each pod one
# "node" running torchrun with 2 ranks. Kueue admits the whole JobSet at once (gang) from LocalQueue mi-lq.
# Rendezvous is static: pod index 0 hosts the c10d TCPStore; the others reach it through the headless
# Service JobSet creates (DNS name <jobset>-<replicatedJob>-<job index>-<pod index>.<jobset>).
# Submit: kubectl create -f train-jobset.yaml (RUN names the output folders under /shared)
apiVersion: jobset.x-k8s.io/v1alpha2
kind: JobSet
metadata:
name: mi-train
namespace: mi
labels:
kueue.x-k8s.io/queue-name: mi-lq
spec:
failurePolicy:
maxRestarts: 0
replicatedJobs:
- name: node
replicas: 1
template:
spec:
parallelism: 2
completions: 2
completionMode: Indexed
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: trainer
image: mi-train:1
imagePullPolicy: Never
env:
- {name: RUN, value: ex-k8s}
command: ["sh", "-c"]
args:
- >-
exec torchrun --nnodes=2 --nproc-per-node=2 --node-rank=$JOB_COMPLETION_INDEX
--master-addr=mi-train-node-0-0.mi-train --master-port=29500
/opt/mi/train.py --ckpt-dir=/shared/ckpt/$RUN --log-dir=/shared/logs/$RUN
resources:
requests: {cpu: "1", memory: 900Mi, example.com/gpu: "2"}
limits: {cpu: "2", memory: 900Mi, example.com/gpu: "2"}
volumeMounts:
- {name: shared, mountPath: /shared}
volumes:
- name: shared
hostPath: {path: /shared, type: Directory}$ kubectl get events (selected)
TIME KIND NAME REASON MSG
2026-10-16T01:48:22Z Pod mi-train-node-0-0-lvn7w Scheduled Successfully assigned mi/mi-train-node-0-0-lvn7w to mi-kind-worker3
2026-10-16T01:48:22Z JobSet mi-train Started Admitted by clusterQueue mi-cq
2026-10-16T01:48:22Z Pod mi-train-node-0-1-fp58v Scheduled Successfully assigned mi/mi-train-node-0-1-fp58v to mi-kind-worker2
2026-10-16T01:48:22Z Workload jobset-mi-train-63335 QuotaReserved Quota reserved in ClusterQueue mi-cq, wait time since queued was 0s
2026-10-16T01:48:22Z Workload jobset-mi-train-63335 Admitted Admitted by ClusterQueue mi-cq, wait time since reservation was 0s
2026-10-16T01:48:40Z JobSet mi-train AllJobsCompleted jobset completed successfully
rank 0 at start: host mi-train-node-0-0, world 4, local_rank 0
env {
"master_addr": "mi-train-node-0-0.mi-train",
"master_port": "29500",
"group_rank": "0",
"local_world_size": "2",
"torchelastic_restart_count": "0",
"job_completion_index": "0"
}
rank 0 at the end: step 200, global loss 2.2638769149780273src/data/k8s/train-jobset.yaml, created with kubectl create -f on kind (Kubernetes v1.37.0) with JobSet v0.13.0 and Kueue v0.20.2. Kueue reserved quota and admitted the whole JobSet before any pod was scheduled; rank 0's master_addr is pod 0's DNS name through the headless service.
# src/data/ray/ray_train.py, lines 44-55 of 60 (the rest parses arguments and calls train.py's train())
ray.init(address=args.address, log_to_driver=True)
trainer = TorchTrainer(
loop,
train_loop_config={"argv": argv, "train_dir": TRAIN_DIR},
torch_config=TorchConfig(backend="gloo"),
scaling_config=ScalingConfig(num_workers=args.workers, use_gpu=False,
resources_per_worker={"CPU": 1, "fake_gpu": 1},
placement_strategy=args.placement),
run_config=RunConfig(name=args.name, storage_path=args.storage,
failure_config=FailureConfig(max_failures=args.max_failures)),
)
result = trainer.fit()driver output (selected)
(TrainController pid=656) Requesting resources: {'CPU': 1, 'fake_gpu': 1} * 4
(RayTrainWorker pid=129, ip=<ip-2>) Setting up process group for: env:// [rank=0, world_size=4]
(TrainController pid=656) - (ip=<ip-2>, pid=129) world_rank=0, local_rank=0, node_rank=0
(TrainController pid=656) - (ip=<ip-2>, pid=128) world_rank=1, local_rank=1, node_rank=0
(TrainController pid=656) - (ip=<ip-3>, pid=129) world_rank=2, local_rank=0, node_rank=1
(TrainController pid=656) - (ip=<ip-3>, pid=128) world_rank=3, local_rank=1, node_rank=1
rank 0 at start: host raynode0, world 4, local_rank 0
env {
"master_addr": "<ip-1>",
"master_port": "42129",
"local_world_size": "2"
}
rank 0 at the end: step 200, global loss 2.2638769149780273Run with python ray_train.py on a Ray 2.59.0 cluster of three containers (head plus 2 workers). Ray Train placed 4 worker actors, set the environment itself and initialised the gloo process group (env://) before calling the training function.
There is no census of training clusters; the honest evidence is what operators say about their own runs. The largest labs mostly run their own schedulers or heavily extended Kubernetes; Slurm dominates supercomputers and the GPU clouds that rent clusters for training; Ray sits on top as a runtime, notably for reinforcement learning.
| Who | What they run | Source |
|---|---|---|
| Meta (Llama 3) | MAST, Meta's own global training scheduler, which also decides which data centre a job runs in | published Llama 3, Jul 2024; MAST, OSDI 2024 |
| Google (Gemini) | TPU SuperPods driven by JAX and Pathways, "a single Python process to orchestrate the entire training run" | published Gemini report §3, Dec 2023 |
| OpenAI | Kubernetes clusters of up to 7,500 nodes, one pod per node, MPI inside the job, a gang-scheduling plugin; and Ray, "to train our largest models" | published OpenAI, Jan 2021; Ray quote from a 2022 talk as reported by Anyscale, which sells Ray vendor (Anyscale) |
| DeepSeek | HAI Platform, its own time-sharing scheduler that interrupts jobs and resumes them from checkpoints | published Fire-Flyer AI-HPC, Aug 2024 |
| Ai2 (OLMo 2) | Beaker, "a custom workload management system", containerised, across its own and Google Cloud clusters | published OLMo 2 §6, Dec 2024 |
| Supercomputers | Slurm on "more than half" of the top 10 and top 100 TOP500 systems; NVIDIA bought Slurm's developer SchedMD in December 2025 and says Slurm stays open source | vendor NVIDIA, Dec 2025 |
| GPU clouds | rated on both managed Slurm and managed Kubernetes, with separate checklists for each, including Slurm running on Kubernetes (Slinky) | independent SemiAnalysis ClusterMAX 2.0, Nov 2025 |
| RL frameworks | OpenRLHF: "the first RLHF framework built on Ray + vLLM"; verl is the open version of HybridFlow, whose "centralized single controller is built on top of Ray" | project's own (OpenRLHF README; HybridFlow paper, EuroSys 2025; verl) |
The scheduler hands over nodes; the training script needs one process per GPU, each knowing who it is and how to reach the others. Four numbers say who a process is: its rank (0 to W−1), the world size W, its local rank (its index on its node, which picks its GPU) and its node's index. A launcher starts the processes and hands them those numbers as environment variables (RANK, WORLD_SIZE, LOCAL_RANK): torchrun runs once per node and starts and restarts its workers; Slurm's srun starts tasks on every node and sets SLURM_PROCID and the node list; a Kubernetes indexed Job or JobSet gives each pod an index and, through a headless service, a stable DNS name; Ray Train starts worker actors and sets everything itself.
Rendezvous is how they meet: everyone is told one address, MASTER_ADDR:MASTER_PORT, where PyTorch's TCPStore (the "c10d store") collects each rank's details, and nobody proceeds until all W have arrived. Then init_process_group builds the process group that collectives run on: gloo on CPUs (this page's running example), NCCL on NVIDIA GPUs, which shares a unique id through the same store and then builds its own rings and trees. A launch that goes wrong almost always hangs rather than crashes, because the ranks that arrived wait for the ones that did not; how long they wait is set by timeouts, not by the fault.
| Slurm | Kubernetes (JobSet) | Ray Train | |
|---|---|---|---|
| Who starts the processes | srun starts one torchrun per node | one pod per node, each running torchrun | Ray Train's controller starts worker actors |
| How they find rank 0 | first host of $SLURM_JOB_NODELIST; torchrun's dynamic (c10d) rendezvous | pod 0's DNS name through the headless service; static rendezvous | Ray picks rank 0's IP and a free port, then env:// |
| Submit to first finished step (median of 5) | 7.5 s | 5.8 s | 10.0 s |
| One node never arrives | silence, then at 602 s a bare RendezvousTimeoutError | at 903 s: DistStoreError: Timed out after 901 seconds waiting for clients. 1/2 clients joined. | never fails: "worker group startup timed out after 60.0 seconds", retried every 60 s (13 attempts in about 12 minutes, stopped by hand) |
| Timeout that decides it | c10d rendezvous, 600 s | static rendezvous, 900 s as torchrun fills it in | worker-group start, 60 s, with retries |
The running example, 2 nodes × 2 ranks, the image already on every node measured on Apple M1 Pro, Docker Desktop VM, shared machine, 16 October 2026. Every waiting process held its CPUs (and fake GPUs) the whole time. On a real cluster, pulling a multi-gigabyte image to every node is often the longest stage, and at thousands of GPUs the whole chain is paid again on every restart (section 5). Defaults in torch 2.14.1: 30 minutes for a gloo process group and 10 for NCCL (ProcessGroupNCCL.hpp line 159).
By stage (medians, which need not add up to the median total): Slurm 0.7 s from sbatch to the batch script, 1.3 s for torchrun to import, 1.1 s of c10d rendezvous (the dynamic backend polls once a second), 2.5 s to spawn the workers and import torch, 0.01 s for init_process_group, 2.0 s for data, model and the DDP wrapper; Kubernetes 0.9 s for Kueue admission, scheduling and container start, 1.9 s of torchrun imports, 0.03 s of static rendezvous, 1.1 s of worker start, 1.3 s of data, model and DDP; Ray 1.6 s for the driver to import Ray, then 4.4 s for Ray Train's controller, placement group and worker processes, 0.9 s until the worker actors were ready, 0.3 s for the process group and 2.0 s for data, model and DDP. Pulling the image is not in these numbers; on a real cluster a multi-gigabyte image pulled to every node is often the longest stage, which is why images are cached on nodes.
Each system's timeline stage by stage, the real environment each one hands a process, and every broken launch with its real symptom are the Launch lab. The mechanisms behind them belong to one child: torchrun's agent and its exit codes, the rendezvous state machine, NCCL's start-up, every timeout on one axis, and how to find the one rank that is different in a hang.
A synchronous job is a chain as strong as its weakest GPU: when one GPU, cable, switch, host or process fails, every rank stops at the next collective. Parts fail rarely, but a big job holds many of them. Meta's Llama 3 405B pre-training had 419 unexpected interruptions in 54 days on up to 16,384 H100s, about 78% of them confirmed or suspected hardware, and still kept "higher than 90% effective training time" (Llama 3 §3.3.4, Table 5) published: one stop every 3.1 hours derived: 54 × 24 / 419. If each GPU (with its share of host and network) fails independently, a job's mean time between failures (MTBF) falls as 1/N:
Checkpoint and restart is the base defence: every so often all ranks save model, optimiser, data-loader and random-number state (a checkpoint); after a failure the job restarts from the last one, losing the work since then plus the restart time, and paying for every write even when nothing fails. How often to write is a trade-off with a classic answer (Young's interval, about √(2 · C · MTBF) for a write time C), derived with its exact form and a simulator on Power, cooling, reliability, section 6. Each other defence removes one part of the lost time:
derived: MTBF = 3.1 h × 16,384 / N, Llama 3's rate scaled with GPU count (roughly but not exactly true: some causes are per job or per switch). Bars on a linear scale. Meta's 2026 report on a recurring job of about 32K GPUs counts 678 interruptions with GPU HBM3 memory now the largest cause, 2.3 interruptions per 1,000 servers per day and 95 to 97% effective training time (arXiv 2602.00277) published; Fault tolerance at scale, section 1, sets the two tables side by side and checks the paper's own "every 18 minutes at 100K GPUs" against its rate.
| Slurm | Kubernetes (JobSet) | Ray Train | |
|---|---|---|---|
| A rank crashes (exit code 13) | job FAILED; --requeue does not cover a program error. torchrun --max-restarts retries inside the job, but failed twice with default settings; with TORCH_DISABLE_SHARE_RDZV_TCP_STORE=1 it resumed in 3.4 s | fails unless failurePolicy.maxRestarts > 0; with retries every pod was recreated and the run resumed in 10.3 s | fails unless FailureConfig(max_failures) > 0; with retries a new worker group resumed in 10.2 s |
| A machine is lost | node DOWN after 32.1 s of missed heartbeats, job requeued and restarted on the spare node: resumed after 166 s, no person involved | a silent node blocked the restart: the pod on it never finished terminating, and the default 300 s eviction did not help; an operator's out-of-service taint freed it at 445 s | node declared dead after 30 s; the worker group needs four slots and only two existed, so it waited until the node came back |
The running example, checkpointing every 50 steps and failing after step 120: every resumed run restarted from step 100 and redid 20 steps measured, 16 October 2026. All twelve runs, replayable step by step from their logs, are the Failure lab, with the words each system uses for detection, retries and health checks.
The tiers, fastest and smallest first: GPU memory; the node's RAM; its local NVMe disks (fast, but gone with the node); a parallel file system shared by all nodes (Lustre, IBM Storage Scale, WEKA, VAST, DeepSeek's 3FS), which spreads each file over many servers so thousands of clients can read and write at once; and object storage (S3, Google Cloud Storage, or an S3-compatible store on premises), cheapest and nearly limitless but slower per request and with no in-place edits. NFS is fine for home directories and code and a common bottleneck for anything else. The tiers of one scalable unit are drawn in Cluster anatomy's Fig. 4.
Training does two very different kinds of I/O. Reading data is a steady stream of large reads, easy to hide behind compute with prefetching (formats, shards and streaming loaders are Storage and loading at scale's). Writing a checkpoint is a burst: every rank writes at the same moment while the GPUs wait. With mixed-precision Adam a checkpoint holds about 14 bytes per parameter, so a 70B model's is about 0.98 TB and writing it in a minute needs about 16 GB/s of aggregate write bandwidth derived. Three habits follow: shard (every rank writes its own piece, as PyTorch's Distributed Checkpoint does), stage (copy to host RAM or local NVMe in seconds and upload in the background) and keep files big (millions of small files overload the metadata servers long before the bandwidth runs out).
A 304 MB checkpoint written with fsync, medians of 4 to 5 measured on Apple M1 Pro, Docker Desktop VM and native, shared machine. On the slow folder, asynchronous checkpointing cut the time training stood still per checkpoint from 1.81 s to 78 ms. The running example's own 1.39 MB checkpoint (1,386,049 bytes: fp32 weights plus AdamW's two moments) took a median 4.3 ms on a Docker volume (Slurm) and 155 ms on the host folder kind shares into the VM: 36 times slower, same file. Every tier, with the calculator from this laptop to 16,384 GPUs, is the Storage lab.
A 405B model's checkpoint at the same 14 bytes per parameter is about 5.7 TB, about 94 GB/s to write in one minute derived. What operators built:
All published by the operators about their own systems. The 14 bytes are an assumption (bf16 weights 2, fp32 master weights 4, Adam's two moments 4 and 4); layouts vary.
A run is paid in GPU-hours whatever happens inside them. Follow one paid GPU-hour down to useful arithmetic and every section of this page reappears as a loss, each measured by a different meter:
Scheduling efficiency on the three local clusters failed three different ways measured: Slurm's eight-job queue kept 71% of its 8 GPUs' time allocated under FIFO and 80% with backfill; Kubernetes without gang admission held all 12 GPUs for 246 s with no step run, while Kueue fixed that and could fill at most 67% of the quota with 8-GPU jobs (section 2); Ray's placement groups waited holding nothing. The Cost lab turns those losses, failures and checkpoints into money with a run-cost calculator whose every assumption is sourced; the cost of a GPU-hour and of a training token by purchase model is Observability and cost, section 10 (its chart).
derived: 0.9 × 0.4 = 0.36, round numbers near Llama 3's published goodput and MFU, assuming every paid hour was allocated. Each meter reads only its own loss: nvidia-smi's "utilisation" counts any kernel running, so a GPU spinning inside a collective, waiting for a slow peer, reads busy; what each GPU counter really counts is Observability and cost, section 2.
A scheduler runs one job; a team runs thousands and must know which code, data and settings produced which checkpoint, which checkpoint became which model, and how to rerun any of it. Three kinds of tool do this, usually on top of Slurm or Kubernetes rather than instead of them: experiment tracking (every run's configuration, metrics and artefacts in one searchable place: MLflow, Weights & Biases), workflow or pipeline engines (a graph of steps such as prepare, train, evaluate, register, with retries and caching: Airflow, Kubeflow Pipelines, Flyte, Metaflow, Prefect, Dagster) and model registries (named, versioned models with lineage and an alias such as "champion"). A training team's minimum is a tracker and a registry; a pipeline engine pays off once the same multi-step process runs often enough that doing it by hand causes mistakes. Managed clouds bundle all three with the cluster.
The scheduler matters less than people argue: every large operator extends whatever it chose with health checks, fast restarts and storage sized for checkpoints (section 3's dated evidence). Choose by what else the cluster must do and who will use it.
| Your situation | Start with | Why |
|---|---|---|
| A fixed bare-metal GPU cluster, mostly big training runs, researchers used to HPC | Slurm (managed by the provider, or Slurm on Kubernetes) | queues, backfill, fairshare and gang allocation out of the box; one script per job; the least to debug |
| A platform team already running Kubernetes for serving and pipelines, or elastic cloud capacity | Kubernetes with Kueue and JobSet (and the Kubeflow Trainer) | one control plane for every workload; quotas and borrowing across teams; containers everywhere |
| A job made of many cooperating programs: RL with rollout workers and inference engines, data processing, hyperparameter search | Ray, on Kubernetes through KubeRay | tasks, actors and an object store make the program itself distributed; Kubernetes and Kueue still handle teams and quotas |
| A few nodes, one team | torchrun over SSH, or Slurm on the nodes | a scheduler pays off once people queue for the same GPUs |
Whatever the choice, the same five things decide whether 1,000 GPUs do useful work: gang admission (no partial jobs), health checks with automatic draining, checkpoints that are sharded and asynchronous, storage sized for the checkpoint burst, and meters for goodput and MFU, not just utilisation.
Watchdog caught collective operation timeout: ... ran for ... milliseconds before timing out. means a collective exceeded its timeout (a peer is missing or stuck); ProcessGroupNCCL's watchdog got stuck for ... seconds without making progress in monitoring enqueued collectives. means the watchdog thread itself hung (often a stuck CUDA or NCCL call), after 480 s by default (TORCH_NCCL_HEARTBEAT_TIMEOUT_SEC).The other classic mistakes are taught where they happen: a time limit that blocks backfill (Slurm from zero, section 6), multi-pod training on plain Kubernetes (section 2 here and Kubernetes for ML, section 7), a rendezvous address that works on one node only (Launching distributed training, section 9), a restart onto the same broken node (Fault tolerance at scale, section 3), and reading 100% utilisation as efficiency (section 7 here).
Shape: 125 nodes of 8 GPUs, NVLink inside, one 400 Gb/s NIC per GPU on a rail-optimised fabric, a separate front-end network. Scheduler: Slurm with fairshare and QOS if most work is large training by researchers; Kubernetes with Kueue (team ClusterQueues in a cohort, borrowing, preemption) and JobSet if the lab also serves models and runs pipelines; either way gang admission and topology-aware placement, and a low-priority preemptible queue that soaks up idle GPUs. Failures: at Llama 3's rate a 1,000-GPU job stops about every 51 hours; with a 1-minute blocking checkpoint, Young gives about 78 minutes between checkpoints and about 3% loss with 10-minute restarts derived. Add asynchronous checkpoints, preflight and periodic health checks with automatic drain, a few spare nodes, and automatic requeue. Storage: a parallel file system sized for the checkpoint burst (a 70B model is about 1 TB, so about 16 GB/s to write it in a minute), object storage for datasets and old checkpoints, local NVMe for staging. Cost: per-team quotas, dashboards of allocated against idle GPUs, goodput and MFU per job, alerts on step time and on GPUs allocated but idle.
Slurm gives batch semantics (queue, backfill, fairshare, all-or-nothing allocations) for free and is simplest for big synchronous jobs on a fixed cluster. Kubernetes gives one platform for everything and an ecosystem, but needs Kueue or Volcano and JobSet to behave like a batch system. The deciding question is what else must run on the cluster and who operates it. Both are used at frontier scale (section 3).
Synchronous training cannot start until all ranks exist; a partly started job holds GPUs and does nothing. Two partly started jobs can each wait forever for GPUs the other holds: a deadlock (section 2's figure). All-or-nothing admission prevents both.
Estimate the job's MTBF (Llama 3: about 3.1 hours on 16,384 GPUs) and the blocking write time C; Young's √(2CM) gives about 19 minutes for C = 1 minute. Then make C smaller (asynchronous, in-memory copies) because the loss falls with √C, and make restarts faster because each one costs the restart time on top. The exact interval and where Young breaks are Power, cooling, reliability, section 6.
Goodput is the share of paid time spent making progress (lost to queues, launches, failures, checkpoints); MFU is how much of the chip's peak the progress uses while it runs. Cost per useful FLOP is the product of both: 90% goodput at 40% MFU uses 36% of what you paid for (section 7).
The rehearsal for one subject sits on its child: a job stuck at init (Launching distributed training, section 11), a job pending for hours (Slurm's Why pending? tab), one slow GPU (Fault tolerance at scale, section 8).
Each owns one subject in depth, built around the same running example. Times are each page's Reading tab as its header states it on 12 November 2026.
A cluster is a pool of GPUs and a queue of jobs that want them. A scheduler decides which waiting job starts next and on which machines. This lab sends the same small workloads through three real schedulers running on one laptop and records what each one did, from its own logs and accounting.
| System | Version | Machines | Fake GPUs |
|---|---|---|---|
| Slurm | 24.11.5 (Debian 13 package), sched/backfill, multifactor priority with fairshare, partition preemption | 1 controller + 3 compute containers (c1 to c3) | 4 per node, 12 in all |
| Kubernetes | v1.37.0 on kind v0.33.0, with Kueue v0.20.2 and JobSet v0.13.0 | 1 control plane + 3 worker containers | 4 per worker (example.com/gpu), 12 in all |
| Ray | 2.59.0 | 1 head (no tasks) + 2 worker containers | 2 per worker (fake_gpu), 4 in all |
The GPUs are fake: counted resources the schedulers track and hand out, with nothing behind them. The jobs are either sleep (holding GPUs is all a scheduling experiment needs) or the topic's running example, a tiny GPT trained with DDP over gloo on CPU (the Reading tab introduces it). measured marks what the clusters did: which job started when and where, in which order, with which message. These are outcomes of each scheduler's rules and repeat exactly; the few timings in seconds were measured on an Apple M1 Pro in Docker Desktop's VM, on a shared machine, and are rough. simulated marks the page's own simulator; source quotes are from Slurm at tag slurm-24-11-5-1 (the version that runs here; upstream is at 26.05.5) and Kueue at v0.20.2.
A unit of work that asks for resources: 8 GPUs on 1 node for 2 hours. It holds them from start to end, even while it does nothing with them.
The longest a job may run (--time in Slurm). The scheduler plans with it, because it cannot know the real runtime; the job is killed when it is reached.
Pending jobs in the order the scheduler will consider them. Priority is the number that sets that order: submit time, user, fairshare, partition.
Utilisation: GPU-time used by jobs divided by GPU-time available. Wait: start minus submit. Makespan: first submit to last end.
Rows are the 8 fake GPUs, grouped by node; each bar is a job holding GPUs from its start to its end as Slurm recorded them (the GPU indices come from scontrol -d show job polled every 5 s). Time is minutes since submission.
The problem. Jobs ask for different amounts. Take them strictly in order (FIFO, first in first out) and a big job at the head of the queue that does not fit yet blocks every job behind it, even small ones that would fit in the GPUs sitting idle. Backfill lets a later job jump ahead into those idle GPUs if doing so does not delay the jobs ahead of it. To know that, the scheduler builds a plan of the future from every running job's time limit: when each will end at the latest, and so when each waiting job could start.
Two flavours differ in whose start is protected. EASY backfill (from the Extensible Argonne Scheduling sYstem) reserves a start time only for the first waiting job; a later job may jump ahead if it does not delay that one. Conservative backfill reserves a start for every waiting job and lets a job jump only if it delays none of them. Slurm's own header calls its plugin conservative, and the code reserves for every job it tests (below).
The experiment. An eight-job queue, run for real: 8 fake GPUs (nodes c1 and c2, 4 each), jobs A to H submitted together by one user in that order, each asking for N GPUs as N tasks of 1 GPU and 1 CPU, with a time limit of R minutes and a real runtime of R minutes minus 5 seconds (Slurm time limits are whole minutes, so one simulated time unit is one real minute). Run once with Slurm's FIFO plugin (SchedulerType=sched/builtin) and once with the cluster's normal sched/backfill; the start and end times come from sacct.
What happened. Without backfill the queue drained at ?; with backfill at ?. Utilisation of the 8 GPUs rose from ? to ? and the mean wait fell from ? to ?. Under FIFO, four GPUs sat idle for the first six minutes because B (6 GPUs) was first in line and did not fit beside A. Under backfill, C, D and G started at once in that hole and H slipped in at minute 3, all finishing before B's reserved start, so B started at the same minute under both: backfill took nothing from the job it jumped.
One job did not do what the simple model says. F (2 GPUs, 7 minutes) started at ?, together with B, not at minute 2 as a pool-of-8-GPUs model predicts (the pooled simulator below is that model). The source explains it: Slurm's reservation for B blocks both nodes from minute 6 to 10, although B leaves 2 GPUs of c2 unused, so a 7-minute job starting at minute 2 would overlap the reservation on every node. A node-level simulator that copies this rule reproduces Slurm's schedule exactly. The general point: backfill packs GPUs only as finely as the scheduler's plan resolves them, and Slurm's plan resolves nodes.
Two versions of the page's simulator, both planning with the time limits in whole minutes: the pooled one treats the 8 GPUs as one pool (it is the one section 2 runs on bigger clusters); the node-level one keeps GPUs on their nodes and, like Slurm, lets a reservation block whole nodes. Starts in minutes after submission; Slurm's in minutes:seconds, green when within 30 s of the model it is compared with.
FIFO: ? of 8 starts differ from the model. Backfill: the pooled model misses ? (and finishes at minute ?); the node-level model misses ?. Slurm jobs end 5 s before their limit, so its clock runs a few seconds ahead of the models by the end.
4 * If a partition does not have root only access and nodes are not shared 5 * then raise the priority of pending jobs if doing so does not adversely 6 * effect the expected initiation of any higher priority job. We do not alter 7 * a job's required or excluded node list, so this is a conservative 8 * algorithm.
Every pass walks pending jobs in priority order (at most bf_max_job_test, default 500, line 121) and asks the node selector for the earliest time each could start. A job whose earliest start is now is started (lines 3156 to 3171); for any other job the time window it would occupy, from that start to start plus its time limit, is booked into the plan so later jobs cannot take those resources (lines 3392 to 3393 and 3557):
3156 } else if ((job_ptr->het_job_id == 0) &&
3157 (job_ptr->start_time <= now)) { /* Can start now */
...
3171 rc = _start_job(job_ptr, resv_bitmap);
...
3392 end_reserve = job_ptr->start_time + boot_time +
3393 (time_limit * 60);
...
3527 bit_not(avail_bitmap);
...
3557 _add_reservation(start_time, end_reserve, avail_bitmap,
3558 job_ptr, node_space, &node_space_recs);
The plan (node_space) is a list of time slices, each with a bitmap of available nodes; _add_reservation removes the reserved job's nodes from every slice it overlaps (line 3909: bit_and(node_space[j].avail_bitmap, res_bitmap)). So a future reservation blocks whole nodes for its window, even if the reserved job will use only some of their GPUs. The defaults the lab changed: bf_interval 30 s, bf_resolution 60 s, bf_window one day (lines 107 to 109); here 2 s, 1 s and 60 minutes.
Without backfill, Slurm's main scheduler stops at the first job that cannot start: src/slurmctld/job_scheduler.c
2143 if (fail_by_part) {
2144 /*
2145 * Do not schedule more jobs in this partition or on
2146 * nodes in this partition
2147 */
2148 job_ptr->part_ptr->flags |= PART_FLAG_SCHED_FAILED;
The first version of this experiment asked for GPUs with sbatch --gpus=6 --cpus-per-gpu=1. Slurm placed job B as one task per node and gave it all 8 CPUs of c1 and c2, not 6, so the 2 GPUs left free on c2 had no CPU to go with them. Job C (2 GPUs) then sat in (Resources) while sinfo showed GPUs free:
NumNodes=2 NumCPUs=8 NumTasks=2 CPUs/Task=1
ReqTRES=cpu=6,mem=4000M,node=1,billing=7,gres/gpu=6
AllocTRES=cpu=8,node=2,billing=8,gres/gpu=6
Nodes=c1 CPU_IDs=0-3 Mem=0 GRES=gpu:4(IDX:0-3)
Nodes=c2 CPU_IDs=0-3 Mem=0 GRES=gpu:2(IDX:0-1)
NODELIST CPUS(A/I/O/T) GRES GRES_USED
c2 4/0/0/4 gpu:4 gpu:2
scontrol -d show job and sinfo -N -O NodeList,CPUsState,Gres,GresUsed, Slurm 24.11.5, 16 Oct 2026. Asking for tasks instead (--ntasks=6 --gpus-per-task=1 --cpus-per-task=1) gave exactly 6 CPUs, and the runs above use that form.
The lesson carries to real clusters: a GPU is schedulable only with the CPUs and memory that must come with it. A node whose CPUs or memory are fully allocated has stranded GPUs; check AllocTRES against the request, not only the GPU count.
Eight jobs show the mechanism; a real cluster has hundreds of jobs of very different sizes arriving all day. The simulator that predicted the Slurm runs above (checked against them, and its Python and JavaScript versions checked against each other by src/sched/scripts/check_sim.mjs) runs here on a synthetic workload: 300 jobs from 1 GPU up to a quarter of the cluster, runtimes from 10 minutes to a day, arriving at random so that the work offered is a chosen fraction of the cluster's capacity (the offered load). Each job's time limit is its runtime times a random factor up to the "limit padding" you choose, the way users round limits up.
What to look for. FIFO leaves visible troughs in the busy-GPU line: each is a big job at the head of the queue waiting for room while small jobs that would fit sit behind it. Both backfills fill them, which cuts the mean wait by a large factor at loads near 1. EASY usually beats conservative on mean wait because it protects only one reservation, at the price of predictability: under EASY a job's promised start can slip, while under conservative backfill every waiting job keeps the start it was given (Slurm reports it in squeue --start). Raise the limit padding and the plan gets worse in a specific way: jobs that will end early look as if they will run long, so the scheduler leaves gaps it could have filled, or fills gaps with jobs that free up sooner than planned. The big-job column is where policies part ways: backfill helps small jobs most, and a big job's wait depends on reservations being honoured.
Illustrative workload, not a trace of any real cluster. The faint orange line is FIFO for comparison. Utilisation is measured from the first to the last submission, so the empty tail after the last job does not count.
The problem. Order by submit time and a team that queues 500 jobs on Monday owns the cluster until Wednesday. Fairshare orders by how much each user or team has used recently against how much they are entitled to.
How it works in Slurm. Each account (a team) and each user in it has shares, its entitled fraction. Every running job adds usage: its billed resources times seconds (here a fake GPU bills 1 and a CPU 0.25, TRESBillingWeights). Usage decays exponentially with a half-life (default 7 days; 10 minutes on this lab cluster so that it moves while you watch). From shares and usage Slurm computes a fairshare factor between 0 and 1, and the job's priority is a weighted sum of factors (the multifactor plugin): here 10,000 times fairshare plus 1,000 times age, with the other weights zero.
That is Fair Tree, Slurm's default: the flag is set unless PriorityFlags turns it off (src/common/read_config.c:4843: conf->priority_flags = PRIORITY_FLAGS_FAIR_TREE;). Its point is that a team's total usage is compared first: a user in a heavy team ranks below every user of a light team, however little that user ran personally. The older formula, still available with PriorityFlags=NO_FAIR_TREE, is 2^(−U/S) (priority_multifactor.c:1951). Decay is applied every PriorityCalcPeriod as usage × decay_factorseconds, with decay_factor = 1 − 0.693 / half-life (priority_multifactor.c:1649).
All 12 fake GPUs. alice (teama) first runs a 12-GPU job for 3 minutes. While it runs, alice queues four 4-GPU, 2-minute jobs (a1 to a4), and two seconds later bob (teamb) queues four identical ones (b1 to b4). By submit time alice's jobs are first. The bars are what sacct recorded.
alice (teama)bob (teamb)
What happened. When the history job ended, the three 4-GPU slots went to bob's b1, b2 and b3, although alice's jobs were submitted three seconds earlier. Two minutes later the second wave was b4, a1 and a2; then a3 and a4. Slurm's own numbers 93 s after submission, while the history job still ran:
$ sprio
JOBID PARTITION USER ACCOUNT PRIORITY AGE FAIRSHARE
31 batch alice teama 2570 70 2500
35 batch bob teamb 10065 65 10000
$ sshare -a -l
Account User RawShares NormShares RawUsage EffectvUsage FairShare LevelFS
root root 1 0.333333 0 0.000000 1.000000 inf
teama 1 0.333333 5408 1.000000 0.333333
teama alice 1 0.500000 5408 1.000000 0.250000 0.500000
teama carol 1 0.500000 0 0.000000 0.500000 inf
teamb 1 0.333333 0 0.000000 inf
teamb bob 1 1.000000 0 0.000000 1.000000 inf
sprio -l and sshare -a -l at 02:38:13 UTC, columns trimmed (one job per user shown; the other three of each had the same factors). Full output in src/sched/runs/slurm/w2.snap.
Read it with the formula: teama has used everything (U = 1, S = 1/3, level_fs 0.33), teamb nothing (level_fs infinity), so bob ranks with the root user at the top (rank 4 of 4, factor 1.0) and alice, the heavy user in the heavy team, at the bottom (1 of 4, 0.25). carol, who ran nothing, still sits below bob (0.5) because her team is heavy. Ninety seconds later bob had used 74 units and his factor fell to 0.75 (rank 3: below the root user's infinite level_fs), still far above alice's 0.25, which is why b4 beat a1 in the second wave. Age (up to 1,000 here) never came close to the fairshare gap.
181 U = assoc->usage->usage_efctv; 182 S = assoc->usage->shares_norm; ... 202 if (S == 0L) 203 assoc->usage->level_fs = 0L; 204 else 205 assoc->usage->level_fs = S / U; ... 372 assoc->usage->fs_factor = 373 *rank / (double) g_user_assoc_count;
When it matters. Fairshare only reorders the queue; it never stops a running job (preemption, next, does that), and a heavy team still runs whenever nobody else is waiting. The half-life is the policy knob: short means "fair this afternoon", long (the 7-day default) means "fair this week", and a big run burns its team's priority for weeks afterwards. Check it with sshare -a -l (shares, usage, LevelFS, FairShare per association) and sprio -l (each pending job's priority split into factors).
The lab's account tree: root, with the root user, teama (alice, carol) and teamb (bob). Usage is Slurm's RawUsage (billed units times seconds, decayed), as sshare prints it. The defaults are the measured values at 02:38:13 in the run above (alice 5408, carol and bob 0), and the calculator gives the factors Slurm printed then: alice 0.25, carol 0.5, bob 1.0. Set bob to 74, the value 90 s later, and bob drops to 0.75 while staying first, as sshare showed.
The calculator reimplements _calc_tree_fs (sort siblings by level_fs, users before accounts on ties, depth first, tied users share a rank). Try: give carol some usage and watch alice and carol swap; give bob more usage than teama and teamb drops below both; set teamb's shares to 0 and bob ranks last whatever his usage.
The problem. An urgent job (a deadline, a production evaluation, a quota owner returning) should not wait hours for a long training job to finish. Preemption stops a running job to free its resources. What happens to the victim is the preempt mode: CANCEL (killed), REQUEUE (killed and put back in the queue to start over, from its last checkpoint if it wrote one), SUSPEND (paused in memory; useless for GPUs whose memory stays full).
The lab config. PreemptType=preempt/partition_prio with PreemptMode=REQUEUE: jobs in partition urgent (PriorityTier=10) may requeue jobs in batch (tier 1) on the same nodes. bob runs a 12-GPU job in batch; 40 seconds later alice submits a 4-GPU job to urgent.
The cost. Everything the victim computed since its last checkpoint is lost, plus its restart time, and it waits again in the queue. Preemption is therefore only as cheap as the victim's checkpoint interval: a training job that may be preempted should checkpoint often and resume automatically (#SBATCH --requeue, and a script that loads the latest checkpoint, as the running example does). The Failure lab measures the resume.
bob, batchalice, urgentred dashed line: alice submits
[2026-10-16T02:45:29.001] sched: Allocate JobId=39 NodeList=c[1-3] #CPUs=12 Partition=batch [2026-10-16T02:46:08.891] _slurm_rpc_submit_batch_job: JobId=40 InitPrio=2500 usec=2553 [2026-10-16T02:46:09.001] preempted JobId=39 has been requeued to reclaim resources for JobId=40 [2026-10-16T02:46:09.045] Requeuing JobId=39 [2026-10-16T02:46:09.502] sched: Allocate JobId=40 NodeList=c1 #CPUs=4 Partition=urgent [2026-10-16T02:46:59.551] _job_complete: JobId=40 done [2026-10-16T02:48:17.569] sched/backfill: _start_job: Started JobId=39 in batch on c[1-3]
slurmctld.log, Slurm 24.11.5 (lines for jobs 39 and 40). sacct -D keeps both runs of job 39: the first PREEMPTED after 41 s, the second COMPLETED.
What happened. alice's urgent job started 1 s after submission: Slurm requeued all 12 GPUs of bob's job to get the 4 it needed. Then two things a newcomer does not expect. First, the other 8 GPUs sat idle: bob's job needs all 12, so it could not restart beside the urgent job. Second, bob's job did not restart when the urgent job ended at 02:46:59; it waited until 02:48:17 with reason (BeginTime). A requeued job gets a begin time of now plus the credential lifetime plus one second (src/slurmctld/job_mgr.c:16389, begin_time = now + cred_lifetime + 1;), so that the old run's credentials and I/O are gone before the new run starts: 121 s here (requeued at 02:46:09, eligible at 02:48:10; the next backfill pass started it). To run a 4-GPU job for 50 s, preemption cost bob 41 s of lost work, a 2-minute hold and 8 idle GPUs for 50 s.
Three JobSets, sc-a, sc-b and sc-c, each the running example (2 pods, 2 ranks per pod) with each pod asking for a whole worker's 4 fake GPUs. Three workers, so the cluster holds exactly one and a half jobs. Without Kueue, each pod was created behind a scheduling gate and the gates were removed in the order a0, b0, c0, a1, b1, c1, one second apart: the order in which the default scheduler would see them if three job controllers created pods at the same moment. With Kueue, the same three JobSets were created together with a queue label and nothing else.
The problem. A distributed training job is useless until every rank is running: rank 0 waits at the rendezvous for the others (the Launch lab shows it), and every GPU it holds meanwhile does nothing. A scheduler that places a job's pieces one by one can give a job part of what it needs. With two or more such jobs in a full cluster, each holds part and waits for the rest, which only the others could free: a deadlock. Gang scheduling starts all of a job's pieces together or none of them.
Who has it. In Slurm a job's allocation is one object: it gets all its nodes at once or stays pending, so gangs come free. Kubernetes' default scheduler places pods, one scheduling cycle per pod, and knows nothing of the job they belong to. Upstream is adding a native path (KEP-4671, "Gang Scheduling using Workload Object": alpha in v1.35, its GenericWorkload feature gate beta in v1.37), but the gate is off by default: the v1.37.0 kube-scheduler --help here lists GenericWorkload=true|false (BETA - default=false). Until then gangs come from an add-on: Kueue (admits a whole workload against quota, then lets the pods be created), Volcano (its own scheduler, with a PodGroup and minMember), or the coscheduling plugin of scheduler-plugins. In Ray, a placement group reserves all its bundles atomically (section 7).
Without gang scheduling the default scheduler did exactly its job, one pod at a time: a0, b0 and c0 each found a free worker and were bound; a1, b1 and c1 found none. Every job held half of what it needed. Four minutes later nothing had moved:
POD JOBSET IDX PHASE NODE sc-a-node-0-0-r6w4d sc-a 0 Running mi-kind-worker sc-a-node-0-1-m4dw7 sc-a 1 Pending <none> sc-b-node-0-0-zt5rp sc-b 0 Running mi-kind-worker3 sc-b-node-0-1-gbk7d sc-b 1 Pending <none> sc-c-node-0-0-clkfd sc-c 0 Running mi-kind-worker2 sc-c-node-0-1-6n8mc sc-c 1 Pending <none> Warning FailedScheduling default-scheduler 0/4 nodes are available: 1 node(s) had untolerated taint(s), 3 Insufficient example.com/gpu. preemption: 0/4 nodes are available: 1 Preemption is not helpful for scheduling, 3 No preemption victims found for incoming pod. [c10d] The IPv6 network addresses of (sc-c-node-0-0.sc-c, 29500) cannot be retrieved (gai error: -2 - Name or service not known).
kubectl get pods (columns trimmed), a pending pod's event, and the only log line any running pod printed (a warning from torchrun's store lookup), 16 Oct 2026. The three Running pods printed nothing else: torchrun waits silently for its second node. The untolerated taint node is the control plane.
Nothing in this picture says "deadlock". The pods are Running, the scheduler reports ordinary insufficient resources, and preemption declines to help because all pods have the same priority. On a real cluster this shows up as GPUs allocated at 100% and utilisation near zero (the Cost lab measures that gap), and it lasts until a rendezvous timeout kills the waiting pods or someone deletes a job.
With Kueue the same three JobSets never touched a GPU until they could have all of it. Kueue's webhook created them suspended; it admitted sc-a (8 of the 12 GPUs of quota) in its first scheduling cycle and kept sc-b and sc-c in its queue with the message that tells you exactly why:
Workload jobset-sc-b-105c3 WaitingForQuota couldn't assign flavors to pod set node: insufficient unused quota
for example.com/gpu in flavor default-flavor, 4 more needed
Workload jobset-sc-b-105c3 QuotaReserved Quota reserved in ClusterQueue mi-cq, wait time since queued was 243s
Workload jobset-sc-c-fa6c7 QuotaReserved Quota reserved in ClusterQueue mi-cq, wait time since queued was 544s
kubectl get events -n sc, 16 Oct 2026 (lines wrapped). "4 more needed": 12 of quota minus sc-a's 8 leaves 4, and sc-b wants 8.
The jobs ran one after the other and each trained to the same final global loss as the running example on Slurm and Ray, 2.2638769149780273. The waits are long because the machine was heavily loaded by other work during this run (load average above 30 at times): each job's torchrun took about 30 to 37 s to rendezvous and initialise, trained for about 43 s, and the JobSet's completion was recorded about two minutes after the last step. Treat those seconds as rough; the order, and the absence of any half-allocated job, are the result.
The cost of gang admission. Kueue held 4 GPUs idle for the whole run: after sc-a took 8, nothing in the queue fit in the remaining 4. That is the price of all-or-nothing, and it is what backfill-style admission (a smaller workload behind, which BestEffortFIFO allows) and good job sizing recover.
332 // 1. Get the heads from the queues, including their desired clusterQueue. ... 342 // 2. Take a snapshot of the cache. ... 357 // 3. Calculate requirements (resource flavors, borrowing) for admitting workloads. 358 phaseStartTime = s.clock.Now() 359 entries, inadmissibleEntries := s.nominate(ctx, heads, snapshot) ... 365 // 5. Admit entries, ensuring that no more than one workload gets 366 // admitted by a cohort (if borrowing).
A Workload is Kueue's record of a job: every pod set with its count and requests. The flavor assigner checks the whole workload's requests against the ClusterQueue's unused quota; if any resource falls short the answer is NoFit with the message the lab saw (pkg/scheduler/flavorassigner/flavorassigner.go:1000):
1000 status.appendf("insufficient unused quota for %s in flavor %s, %s more needed",
Only an admitted workload is unsuspended, so its pods are created only when all of them are covered. Note what this checks: quota, not which node each pod will land on. If the quota says 12 GPUs but a node is broken or fragmented, an admitted job can still end up with some pods Pending. Kueue's waitForPodsReady setting closes that gap: a workload whose pods are not all ready within a timeout is evicted and requeued, releasing what it held.
kubectl get pods show for the three pods that did get a node?ClusterQueues sc-cq-a and sc-cq-b, 6 fake GPUs of quota each, in cohort sc-cohort, both with reclaimWithinCohort: Any. Team A submits three single-pod jobs of 4 GPUs (12 in all: its 6 plus 6 borrowed from B); 15 s later team B submits one job of 4 GPUs.
The problem. Two teams each own half of a cluster. If team B is idle, should team A be allowed to use B's half? Yes, or the cluster sits half empty; but when B comes back, B must get its half quickly. Quota is a team's guaranteed amount; borrowing lets a team use another's unused quota; reclaiming takes it back by preempting the borrower.
In Kueue. A ClusterQueue holds a team's nominalQuota per resource; ClusterQueues in the same cohort lend unused quota to each other (up to an optional borrowingLimit); preemption.reclaimWithinCohort lets a queue preempt workloads of cohort members that are borrowing. Namespaces submit to a LocalQueue that points at a ClusterQueue. In Slurm the same ideas are QOS and association limits (GrpTRES) plus partition preemption; Slurm has no lending between limits, so idle capacity is used through a low-priority preemptible partition or QOS instead.
What happened. Kueue admitted all three of team A's jobs within 4 s, the second and third by borrowing (Flavors considered: main: default-flavor(Fit;borrow=1)). Eight seconds after team B's job was created its pod was running: Kueue evicted team A's newest borrowing workload (EvictedDueToPreempted ... due to reclamation within the cohort), waited for its pod to stop (WaitingForPreemptedWorkloads), then admitted team B (QuotaReserved ... wait time since queued was 6s). When team B's job finished, team A's evicted job was readmitted by borrowing again, 54 s after it was queued. Borrowing kept every GPU busy, and reclaim gave B its share within seconds; the price was one evicted job, which a training job pays in work since its last checkpoint.
Workload job-sc-a3-b09ed EvictedDueToPreempted Preempted to accommodate a workload (UID: 5d1fcdf5-...) due to
reclamation within the cohort; preemptor path: /sc-cohort/sc-cq-b; preemptee path: /sc-cohort/sc-cq-a
Workload job-sc-b1-1d26c WaitingForPreemptedWorkloads couldn't assign flavors to pod set main: insufficient unused
quota for example.com/gpu in flavor default-flavor, 4 more needed. Pending the preemption of 1 workload(s)
Workload job-sc-b1-1d26c QuotaReserved Quota reserved in ClusterQueue sc-cq-b, wait time since queued was 6s
kubectl get events -n sc, Kueue v0.20.2 on Kubernetes v1.37.0, 16 Oct 2026 (UIDs shortened, lines wrapped). The first attempt at this run failed for an instructive reason: with the control plane at its 1.27 GB memory cap, the API server restarted mid-run and every request failed (TLS handshake timeout, then failed calling webhook "mjob.kb.io" because Kueue's admission webhook could not be reached). Raising the control-plane container to 1.6 GB fixed it: a scheduler is only as available as the API server it writes to. Kueue's webhooks are fail-closed (failurePolicy: Fail): its pod webhook mpod.kb.io covers every namespace except kube-system and kueue-system, so an API server restart that takes Kueue down with it blocks all pod creation in those namespaces until Kueue serves again (the Kubernetes for ML child page measured it: failed calling webhook "mpod.kb.io" ... connection refused).
537 if cq.HasParent() && cq.Preemption.ReclaimWithinCohort != kueue.PreemptionPolicyNever {
538 for _, cohortCQ := range cq.Parent().Root().SubtreeClusterQueues() {
539 if cq == cohortCQ || !cqIsBorrowing(cohortCQ, frsNeedPreemption) {
540 // Can't reclaim quota from itself or ClusterQueues that are not borrowing.
541 continue
542 }The problem. Which machines a job gets matters as much as how many. The gradient all-reduce of every step crosses the network between nodes; a job spread across distant switches pays more for each collective than one packed under one switch, and a job split across many partly used nodes leaves fragments nobody else can use. Topology-aware placement keeps a job's nodes close; packing fills nodes before opening new ones; spreading does the opposite (for fault tolerance, or memory bandwidth).
Ray placement groups, measured on the lab's Ray cluster (two workers of 2 CPUs and 2 fake GPUs, bundles of 1 CPU + 1 fake GPU, Ray 2.59.0): PACK and SPREAD both placed four bundles over the two nodes; STRICT_PACK and STRICT_SPREAD stayed PENDING, with the autoscaler's No available node types can fulfill resource request as the only message; and a gang of 3 bundles waited holding nothing, then got all three at once 0.68 s after the first group was removed measured (run by src/sched/ray/ray_pg.py). The figure of those placements and how placement groups work (the two-phase commit in the GCS, Ray Train's PACK default) are Ray, section "Scheduling: resources, policies and placement groups".
| Need | Slurm | Kubernetes | Ray |
|---|---|---|---|
| Keep a job under few switches | TopologyPlugin=topology/tree with topology.conf listing switches; sbatch --switches=1@00:30:00 waits up to 30 minutes for a single-switch placement. 24.11 also has topology/block for NVL72-style blocks | Kueue Topology Aware Scheduling: a Topology object naming node labels (block, rack, host) and the annotation kueue.x-k8s.io/podset-required-topology or -preferred-topology on the pod template | STRICT_PACK puts all bundles on one node; across nodes Ray knows nothing of switches (custom resources or node labels can stand in) |
| Fill nodes before using new ones | select/cons_tres best-fit; whole-node jobs with --exclusive | a scheduler profile with NodeResourcesFit scoring MostAllocated and the GPU resource listed in it: the default LeastAllocated scores CPU and memory only, so out of the box GPUs are filtered on but never scored (neither packed nor spread) | PACK (best effort) or STRICT_PACK |
| One piece per node | --ntasks-per-node=1, --nodes=N | pod anti-affinity, topology spread constraints; JobSet's exclusive placement annotation | SPREAD (best effort) or STRICT_SPREAD |
Topology placement was not run here: the lab clusters have no switches to respect (the kind workers carry block labels b1, b2 for a later child page). The table is from each project's documentation: Slurm topology guide, Kueue TAS, Ray placement groups.
| Idea | Slurm | Kubernetes (default scheduler, then add-ons) | Ray |
|---|---|---|---|
| Queue | one queue per partition, ordered by priority; squeue | none: pods are retried until they fit. Kueue adds LocalQueue and ClusterQueue (StrictFIFO or BestEffortFIFO); Volcano adds Queue | pending tasks, actors and placement groups wait on the raylets and GCS; no multi-user queue |
| Backfill | sched/backfill, conservative, from time limits (section 1) | no time limits, so no backfill in the Slurm sense; BestEffortFIFO lets a smaller workload be admitted past one that does not fit | no |
| Fairshare | multifactor priority with Fair Tree (section 3) | Kueue fair sharing across a cohort (weights, and admission fair sharing on recent usage); Volcano DRF and proportion plugins | no |
| Preemption | partition priority tiers or QOS; CANCEL, REQUEUE, SUSPEND (section 4) | pod PriorityClass preemption by the scheduler; Kueue preempts whole workloads (within a queue by priority, across a cohort to reclaim) | no scheduler preemption; the memory monitor kills tasks under memory pressure |
| Gang | built in: one allocation | not by default (v1.37: GenericWorkload beta, off); Kueue admission, Volcano PodGroup, coscheduling plugin (section 5) | placement groups are atomic |
| Quotas and borrowing | GrpTRES limits on accounts and QOS; no lending | ResourceQuota (namespace caps, no queueing); Kueue nominal quota, cohorts, borrowing and reclaim (section 6) | no (KubeRay jobs can be admitted by Kueue) |
| Placement | topology/tree and topology/block, --switches | affinity, spread constraints; Kueue TAS; JobSet exclusive placement | PACK, SPREAD, STRICT_PACK, STRICT_SPREAD (section 7) |
| Why pending? | squeue reason, squeue --start, sprio, scontrol show job | pod event FailedScheduling; Kueue Workload condition QuotaReserved=False with its message | ray status (pending and infeasible demands), ray list placement-groups |
The pattern: Slurm was built for batch jobs that hold machines for a time limit, so queueing, backfill, fairshare and gangs are one integrated plugin chain. Kubernetes was built for services that run forever, so its scheduler places pods and everything job-shaped is an add-on; Kueue is the add-on that turns it into a batch system without replacing the scheduler. Ray schedules inside one application and leaves multi-user policy to whatever runs Ray.
Every message below was produced by the lab clusters. Learn to read the reason before changing anything.
JOBID NAME USER ST TIME NODES TRES_PER_NODE NODELIST(REASON)
26 sc-backfil alice PD 0:00 1 N/A (Priority)
27 sc-backfil alice PD 0:00 1 N/A (Priority)
23 sc-backfil alice PD 0:00 2 N/A (Resources)
29 sc-backfil alice PD 0:00 1 N/A (Priority)
28 sc-backfil alice R 0:13 1 N/A c2
24 sc-backfil alice R 0:15 1 N/A c2
25 sc-backfil alice R 0:15 1 N/A c2
22 sc-backfil alice R 0:16 1 N/A c1
$ squeue --start
JOBID NAME USER ST START_TIME NODELIST(REASON)
29 sc-backfil alice PD 2026-10-16T02:24:51 (Priority)
23 sc-backfil alice PD 2026-10-16T02:27:50 (Resources)
26 sc-backfil alice PD 2026-10-16T02:31:50 (Priority)
27 sc-backfil alice PD 2026-10-16T02:31:50 (Priority)
The backfill run of section 1, 15 s after submission (job names cut to 10 characters by the default format; 23 is B, 26 E, 27 F, 29 H).
(Resources): the job is next in line and waiting for resources to free up. (Priority): a job ahead of it is waiting. squeue --start prints the backfill plan's start for each job, from time limits: B was planned at 02:27:50 and started at 02:27:47 (A ended 5 s early). F was planned after B at 02:31:50 but started at 02:27:47 with B: once B was running on real GPUs, the 2 GPUs it left on c2 were no longer covered by a whole-node reservation. Plans are recomputed every bf_interval; treat a planned start as an estimate that usually moves earlier. Other reasons you will meet: AssocGrpGRES or QOSMaxGRESPerUser (a limit, not a lack of GPUs; Slurm enforces association and QOS limits only when AccountingStorageEnforce includes limits or qos, and on this lab's cluster it is none), ReqNodeNotAvail (a requested node is down or drained), BeginTime, Dependency, PartitionTimeLimit (the time limit is above the partition's maximum: the job will never start).
Four more, produced on the same cluster by the Slurm from zero child page (its Why pending? tab has each one's job and command):
102_2 sl-arr PD JobArrayTaskLimit 110 sl-report PD DependencyNeverSatisfied afterok:108(failed) 118 sl-r-long PD (ReqNodeNotAvail, Reserved for maintenance) 91 sl-g-low PD (Nodes required for job are DOWN, DRAINED or reserved for jobs in higher priority partitions)
squeue lines (columns trimmed; the dependency in full from scontrol show job), Slurm 24.11.5, 16 Oct 2026.
JobArrayTaskLimit: an array's %N throttle (here %2) is holding the other tasks; nothing is wrong. DependencyNeverSatisfied: the job it depends on with afterok failed, so it will pend forever until you cancel it (or set kill_invalid_depend in SchedulerParameters). ReqNodeNotAvail, Reserved for maintenance: a MAINT reservation starts before the job's time limit would end, so it waits for the reservation to pass (a shorter --time would fit before it). The last one misleads: it appeared with every node healthy, for a job in a lower-priority partition that overlaps a busy one; when a job in a partition cannot start, the main loop removes that partition's nodes from consideration for the rest of the pass (job_scheduler.c lines 2141-2148, the "Do not schedule more jobs in this partition or on nodes in this partition" block quoted in section 1), and a pending job in another partition that shares those nodes gets this text. Check sinfo before you go looking for broken nodes.
A pod that is Pending has either not been admitted (Kueue holds its job suspended, so the pod may not even exist) or been admitted and not placed. Look at the Workload first, then the pod:
$ kubectl get workloads -n sc
NAME QUEUE RESERVED IN ADMITTED FINISHED AGE
jobset-sc-a-0ea54 sc-lq mi-cq True 6s
jobset-sc-b-105c3 sc-lq False 6s
$ kubectl get events -n sc (Workload jobset-sc-b-105c3)
WaitingForQuota couldn't assign flavors to pod set node: insufficient unused quota for example.com/gpu
in flavor default-flavor, 4 more needed
$ kubectl describe pod sc-a-node-0-1-m4dw7 (no Kueue: section 5's deadlock)
Warning FailedScheduling default-scheduler 0/4 nodes are available: 1 node(s) had untolerated taint(s),
3 Insufficient example.com/gpu. preemption: 0/4 nodes are available: 1 Preemption is not helpful for
scheduling, 3 No preemption victims found for incoming pod.
From the lab's runs, 16 Oct 2026 (columns trimmed, lines wrapped).
insufficient unused quota is a policy answer (your queue's quota is in use: wait, borrow, or ask for quota). Insufficient example.com/gpu is a capacity answer (no node has room: fragmentation, a cordoned node, or a job that should not have been admitted). untolerated taint(s) lists nodes excluded by taints (here the control plane; on a GPU cluster often a node marked unhealthy).
ray status lists pending and infeasible resource demands; a placement group that can never be satisfied stays PENDING forever, with the autoscaler's No available node types can fulfill resource request (section 7) as the only clue. ray list placement-groups shows each group's state.
(Priority) as "something is broken"squeue --start, sprio); your job moves when it does, or when backfill finds a hole that fits your limit.--cpus-per-gpu, --mem-per-gpu, or tasks with --gpus-per-task) and check AllocTRES.waitForPodsReady so a job that cannot fully start gives its pods back.reclaimWithinCohort is Never, a team that lent its quota waits until the borrower's jobs end, which for training can be days. Allow reclaim, and make borrowers' jobs checkpoint and resume.Backfill starts a lower-priority job ahead of its turn when it fits in idle resources and will finish (by its time limit) before the reserved start of higher-priority jobs, or uses resources they will not need. The scheduler cannot know real runtimes, so it plans with limits; over-asked limits make jobs look too long to fit in any hole.
EASY reserves only for the first waiting job: more jobs can jump, so usually lower mean wait, but later jobs' predicted starts can slip. Conservative reserves for every waiting job: predictable starts, slightly less packing. Slurm is conservative within bf_max_job_test and bf_window; its reservations block whole nodes.
The reason (squeue): Priority means it is behind a waiting job, Resources that it does not fit now. Its time limit against the hole before the next reservation (squeue --start for the jobs ahead). Whether the free GPUs come with free CPUs and memory (scontrol show node: AllocTRES). Limits on its account or QOS (reasons such as AssocGrpGRES). Its fairshare (sprio, sshare).
All ranks must run at once; a partial allocation holds GPUs that do nothing, and several partial jobs can deadlock the cluster (section 5 reproduced it). On Kubernetes: Kueue (admit the whole workload against quota, with waitForPodsReady), Volcano (PodGroup minMember), the coscheduling plugin, or, from v1.35 onward, the upstream Workload API behind the GenericWorkload gate.
Gang allocation of whole nodes for training; a quota per team equal to its budget, with borrowing of idle quota and reclaim by preemption (Kueue cohorts, or Slurm accounts with a preemptible scavenger QOS); fairshare with a half-life of days so heavy weeks are paid back; time limits enforced and backfill on, with a short-job partition for debugging and evaluation; topology-aware placement for jobs above one switch's worth of nodes; every preemptible job checkpointing and requeueing automatically; dashboards of queue wait per team and of allocated-but-idle GPUs (the Cost lab).
Usage (billed resources times seconds) decays with a half-life; Fair Tree compares, level by level in the account tree, shares over usage (S/U), ranks users depth first, and gives each user rank / number of users; priority adds weighted factors (fairshare, age, size, partition, QOS). A user in a team that used a lot ranks below every user of a team that used less.
Recorded runs, scripts and configs: src/sched/ in the repository (raw logs scrubbed of host names and paths). Built 16 October 2026.
A scheduler hands your job some machines. Nothing has trained yet: one process per GPU must start on every machine, learn who it is, find all the others and build a communicator with them. This lab starts the same small training job on three real systems running on one laptop (Slurm, Kubernetes and Ray), times every stage from submit to the first training step, dumps the environment each system hands the processes, and breaks the start-up on purpose to record the real error messages and how long each one takes to appear.
The running example of this page: a tiny GPT (112,577 parameters) trained on TinyShakespeare with DDP over gloo (PyTorch's CPU communication backend, standing in for NCCL), 2 "nodes" × 2 processes = 4 ranks, the same image (torch 2.14.1+cpu) everywhere. The nodes are containers on one Docker Desktop VM (5 CPUs, 9.7 GiB) on an Apple M1 Pro shared with other jobs, so every measured time is rough: it is labelled, repeated, and shown as a median with its range. The order of events, the environment variables, the error messages and the timeouts do not depend on the machine.
| System | How the job is submitted | Who starts the 4 processes | Rendezvous |
|---|---|---|---|
| Slurm 24.11.5 | sbatch (2 nodes, 1 task per node) | srun starts one torchrun per node; each torchrun starts 2 workers | torchrun c10d (dynamic) at the first node of the allocation, port 29500 |
| Kubernetes v1.37.0 (kind) + JobSet v0.13.0 + Kueue v0.20.2 | kubectl create a JobSet; Kueue admits it as one workload | the kubelet starts 2 pods (an Indexed Job); each runs one torchrun with 2 workers | torchrun static at pod 0, reached by its DNS name through JobSet's headless Service |
| Ray 2.59.0, Ray Train | a Python driver calls TorchTrainer.fit() | Ray Train's controller reserves a placement group and starts 4 worker actors | Ray Train picks rank 0's address and a free port, then every worker calls init_process_group(env://) |
Setup and the job itself: the root's src/data/README.md. The launch scripts below are the ones that ran (src/launch/scripts/); outputs are pasted from the runs with host names, paths and container addresses scrubbed.
Data-parallel training runs one copy of the training script per GPU. Each copy is an ordinary operating-system process. To cooperate, every process needs four numbers:
cuda:LOCAL_RANK);GROUP_RANK): which machine it is on.And one address: where to meet. That address, MASTER_ADDR:MASTER_PORT, is where a small key-value server will run so the processes can exchange what they need to connect to each other. The picture is the running example as it ran on Kubernetes:
Real values from the probe in every process (Kubernetes run 1 below): the environment variables torchrun set and the host each rank ran on.
A launcher is whatever starts those processes and hands them their numbers. Every system has one, and they stack: the scheduler starts something on each node, which starts the training processes.
| Launcher | Runs where | Starts | Sets | On failure |
|---|---|---|---|---|
| torchrun (PyTorch's elastic agent) | once per node | --nproc-per-node worker processes | RANK, LOCAL_RANK, WORLD_SIZE, GROUP_RANK, MASTER_ADDR/PORT, TORCHELASTIC_* (section 5) | stops all its workers; restarts the whole group up to --max-restarts times (default 0), re-running the rendezvous each time |
| srun (Slurm) | inside an allocation | --ntasks tasks spread over the allocated nodes | SLURM_PROCID (global task id), SLURM_LOCALID, SLURM_NTASKS, SLURM_NODEID, SLURM_JOB_NODELIST | --kill-on-bad-exit=1 kills the other tasks when one exits non-zero; --requeue puts the job back in the queue |
| mpirun (Open MPI and others) | once, on the first node; starts remote daemons (ssh or the scheduler's API) | -np processes | OMPI_COMM_WORLD_RANK, OMPI_COMM_WORLD_SIZE, OMPI_COMM_WORLD_LOCAL_RANK | aborts the whole job |
| Kubernetes Indexed Job / JobSet | the kubelet on each node | one container per pod | JOB_COMPLETION_INDEX (the pod's index), a stable host name and, with JobSet, a DNS name per pod | backoffLimit (pod retries) and JobSet's failurePolicy.maxRestarts (recreate every Job) |
| Ray Train | a controller actor on the head; worker actors on worker nodes | num_workers actors in one placement group | RANK, LOCAL_RANK, WORLD_SIZE, LOCAL_WORLD_SIZE, NODE_RANK, MASTER_ADDR/PORT, and calls init_process_group itself | FailureConfig(max_failures): restart the worker group from the last reported checkpoint |
The common pattern on Slurm and Kubernetes is two layers: the scheduler starts one torchrun per node, torchrun starts one worker per GPU. torchrun earns its place by doing the rendezvous between nodes and by restarting workers; a script launched directly by srun has to map SLURM_PROCID to RANK itself (section 7 does exactly that, and gets it wrong on purpose).
la.sbatch, the running example's batch script with the timing probes.la-jobset.yaml.Start-up is a chain, and every link is paid again on every restart. Each run below was timed by small probes that only record the clock: around sbatch or kubectl create, at the start of each node's task, around torchrun's import and rendezvous, around each worker's import torch and init_process_group, and at the first training step (src/launch/scripts/la_probe.py, la_torchrun.py; on Ray a worker_process_setup_hook does the same). All containers share one clock (the Docker VM's), so differences between them are meaningful. Each boundary is the moment the last node or rank got there, because the job moves at the pace of its slowest member.
The processes start at different moments on different machines and know only one thing in common: the meeting address. Rendezvous is the protocol that turns "some processes, somewhere" into "W processes that know each other's addresses and agree on their ranks". PyTorch builds it on the TCPStore, also called the c10d store: one small key-value server (a TCP socket with set, get, add and wait on keys) that every process connects to as a client.
With torchrun there are two meetings, one per layer:
--rdzv-backend=c10d (the Slurm script), every agent connects to a store at --rdzv-endpoint; the agent whose host name matches the endpoint hosts it. Each agent adds itself to a shared participant list; when the list reaches --nnodes the round is complete and each node gets its node rank. With the static backend (torchrun's default, used on Kubernetes here) there is no negotiation: --node-rank is given, node 0 hosts the store, and the others connect and wait.init_process_group. Its store is the agent's (torchrun tells it so with TORCHELASTIC_USE_AGENT_STORE=True), so it only connects as a client; then the communication backend (gloo here, NCCL on GPUs) uses the store to exchange the addresses it needs and connects every pair of ranks.Almost everything a training process learns about the job arrives as environment variables. Below are the real ones, dumped by the probe inside each rank (only the variables that concern launching; host names, addresses and paths scrubbed). Pick a system and a rank; rows that differ between ranks of the same run are highlighted.
--rdzv-endpoint=c1:29500 to torchrun. Which MASTER_PORT do the training processes see?c10d) backend, port 29500 belongs to the agents' rendezvous store. After the agents meet, the agent that became node rank 0 starts a second TCPStore on a free port (port 0, so the operating system picks one) and publishes its address and port through the rendezvous store; every agent passes them to its workers as MASTER_ADDR and MASTER_PORT. On Kubernetes, with the static backend, the workers see 29500 itself, because there the agents' store is the workers' store. A firewall rule that opens only 29500 therefore breaks the Slurm-style launch and not the static one.if self._bootstrap_store_info is None or (
rank == 0 and self._shared_tcp_store_server is None
):
server_port = 0
if rank == 0:
self._shared_tcp_store_server = self._create_tcp_store_server(
self._this_node.addr, server_port
)
server_port = self._shared_tcp_store_server.port
MASTER_ADDR/MASTER_PORT by RendezvousStoreInfo.build, api.py lines 89-106 and handed to each worker in local_elastic_agent.py lines 424-441. Setting TORCH_DISABLE_SHARE_RDZV_TCP_STORE=1 turns the sharing off.init_process_group creates the process group: the object collectives such as all_reduce run on. It needs a store (from the rendezvous) and a backend, the library that moves the bytes:
ncclGetUniqueId, which contains the address of a bootstrap socket), PyTorch passes it to every rank through the store, and each rank calls ncclCommInitRank. NCCL then runs its own bootstrap over sockets: ranks exchange their addresses and topology, detect NVLink, PCIe and network cards (InfiniBand or RoCE through verbs, or TCP sockets), and build rings and trees for each collective. Most "NCCL hangs at init" are this bootstrap choosing a network interface the other nodes cannot reach.The NCCL variables worth knowing for start-up (NCCL_DEBUG=INFO first on any hang, NCCL_SOCKET_IFNAME the classic fix for an init hang on machines with several interfaces, NCCL_IB_HCA, NCCL_IB_DISABLE, NCCL_P2P_DISABLE, NCCL_TOPO_DUMP_FILE) and PyTorch's own watchdog switches are one table, quoted from the NCCL user guide and the PyTorch source, on Launching distributed training, section 6, with NCCL's start-up as a stepper.
A multi-node launch rarely crashes. The processes that did start wait, politely, for the ones that did not, until some timeout fires. Which timeout fires first decides both how long you wait and what the error says, and they differ per layer: the agents' rendezvous (600 s with c10d, 900 s with static as torchrun starts it: torchrun's launcher writes timeout=900 into the rendezvous config (torch/distributed/launcher/api.py lines 126-130), but only the static backend reads that key (static_tcp_rendezvous.py line 122); c10d reads join_timeout instead (dynamic_rendezvous.py line 1385), default 600 s (line 144), which is why the missing-node cases below fail at 602 s on c10d and 903 s on static), the store client's connect (60 s with c10d), the process group (30 minutes by default; 120 s in the running example), Ray Train's worker-group start (60 s). Each case below was broken on purpose on the real clusters; the time is from the first process starting to the first error line, and the text is the real log, trimmed.
One rank of the running example was made to stall in the middle of training (--slow-rank 3 --slow-ms 600000: it sleeps for ten minutes after a step) while the other three entered the next all-reduce and waited. Three tools, each answering a different question:
Each excerpt is a real log from the runs above. Pick the cause before revealing it.
Rendezvous needs one thing from the network: every process can open a TCP connection to every other process, by a name that means the same machine everywhere. Containers make that harder, because a container usually gets its own network namespace (its own interfaces and addresses; the namespace mechanism itself is on Containers and isolation).
| Setup | How a rank reaches rank 0 | Trade-off |
|---|---|---|
Host network (bare-metal Slurm; containers with --network host; pods with hostNetwork: true) | the node's own host name and address; NCCL sees the real NICs, including InfiniBand | fastest and simplest; ports are shared with everything else on the node, so two jobs on one node can collide on 29500 |
| Pod network (Kubernetes default) | each pod has its own address on an overlay or routed network (the CNI plugin); names come from cluster DNS | isolation and no port collisions; the pod address changes when a pod is recreated, so ranks need a stable name; RDMA needs extra plumbing (SR-IOV or host networking) |
| Headless Service (what JobSet creates) | a Service with no virtual IP whose DNS returns the pod's own address; with the pod's subdomain set, each pod gets <pod hostname>.<service> | a stable, predictable name for pod 0 before it even exists: the job spec can name its own rendezvous host |
| Bridge network (the Slurm and Ray containers here) | container names on a Docker network, resolved by Docker's DNS (the Slurm containers also get fixed addresses) | fine for a lab; on real clusters Slurm nodes are machines on the host network |
MASTER_ADDR=localhost (or a short host name) in a multi-node scriptscontrol show hostnames $SLURM_JOB_NODELIST | head -n1) and pod 0's DNS name through the headless Service on Kubernetes.GLOO_SOCKET_IFNAME, NCCL_SOCKET_IFNAME).WORLD_SIZE instead of reading it from the launcher--ntasks), the processes wait for ranks that will never exist. Read it from the launcher (WORLD_SIZE under torchrun, SLURM_NTASKS under srun).--rdzv-id and one endpoint join the same rendezvous. Use the scheduler's job id ($SLURM_JOB_ID), as the script here does.srun python train.py does not?--max-restarts, tears them all down and restarts the group after a failure, re-running the rendezvous. With plain srun you map SLURM_PROCID to RANK yourself and Slurm's own options handle failures.init_process_group being called and the first all-reduce.MASTER_ADDR:MASTER_PORT (retrying until the timeout if nobody listens yet), the backend registers this rank's address in the store and reads everyone else's, then connects to the other ranks (gloo: a full mesh of TCP connections; NCCL: a bootstrap ring, then topology detection and rings and trees over NVLink and the network). DDP then broadcasts rank 0's parameters to everyone, and the first backward pass all-reduces gradients bucket by bucket.MASTER_ADDR:MASTER_PORT, and does the name resolve the same everywhere. (3) Do all ranks agree on world size and rendezvous id. (4) If all arrived and it hangs in init_process_group or the first collective: NCCL_DEBUG=INFO (interface choice, transport errors), py-spy dump on a few ranks, the flight recorder to find the rank out of step, then that node's health. Drain the bad node and resubmit.--nnodes=min:max, spot instances): the agents negotiate ranks each round and can re-run the rendezvous after a failure.<jobset>-<replicatedJob>-<job index>-<pod index>, sets each pod's hostname and subdomain, and creates a headless Service named after the JobSet that publishes pods even before they are ready. So mi-train-node-0-0.mi-train can be written into the spec, and resolves to pod 0's address once it is scheduled.sbatch to the first rank in the controller's own log), Kubernetes for ML (JobSet and the Kubeflow Trainer's TrainJob, with the environment it sets) and Ray: tasks, actors, the object store and Ray Train (Ray Train's worker group and its start-up timeout). What happens when a rank dies after start-up, and how runs survive it, is the Failure lab.A training job on many machines is only as alive as its least healthy part. This lab broke the running example on purpose on all three local clusters and recorded what each scheduler did: who noticed, how fast, what it decided, and where the run resumed. That comparison is the root's subject; why things fail at scale, every recovery design and how to account for the time lost are the child page Fault tolerance at scale's.
Every timing on this tab is measured on an Apple M1 Pro, Docker Desktop VM, shared machine, with the tiny 4-rank running example (a real cluster takes minutes where this takes seconds to start). Orders of events, error messages, which checkpoint a run resumed from and the losses are exact. Published figures are marked published, arithmetic on them calculation.
In synchronous data-parallel training every rank (one process, usually one GPU) computes gradients on its share of the batch, then all ranks sum them in an all-reduce before anyone takes the next step, so one failed GPU, host, cable or process stops all the others at the next collective. A job on N GPUs fails about N times as often as one GPU: Llama 3 405B, on up to 16,384 H100s, had 419 unexpected interruptions in 54 days, one every 3.1 hours (Llama 3, section 3.3.4) published, about one per GPU every 5.8 years calculation. Its Table 5, row by row with its misprint, is on Fault tolerance at scale's Failure taxonomies tab.
| Term | What it means here | Depth |
|---|---|---|
| Fail-stop | A rank exits with an error; its sockets close and its peers error at once. | Fault tolerance, section 2 |
| Lost machine | Every process on a host vanishes; if the host is frozen rather than off, its sockets stay open and only heartbeats reveal it. | Fault tolerance, sections 2 and 3 |
| Hang | Every rank waits in a collective that never completes; only a collective timeout ends it (PyTorch 2.14: 30 minutes for gloo, 10 for NCCL). | Fault tolerance, section 3; Launching distributed training, sections 7 and 8 |
| Straggler | A rank that keeps working, slowly; every synchronous step runs at its pace and nothing fails. | Fault tolerance, section 8 |
| Heartbeat timeout | How long a scheduler waits before declaring a machine dead: Slurm's SlurmdTimeout (300 s by default, 30 s here), Kubernetes' node-monitor grace period (50 s), Ray's health checks (30 s measured). | Fault tolerance, section 3 |
| Retry policy | Whether a failed job restarts by itself: Slurm's --requeue (node failure and preemption only), torchrun's --max-restarts, JobSet's failurePolicy.maxRestarts, Ray Train's FailureConfig(max_failures). | Slurm, Kubernetes for ML, Ray |
| Drain, cordon, taint | "Schedule nothing new here": Slurm drains a node; Kubernetes cordons it or taints it (a NoExecute taint also evicts running pods). A health check is the program that decides. | Fault tolerance, section 3 |
| Checkpoint and goodput | Everything needed to continue as if nothing happened (weights, optimiser state, step, data position); goodput is the share of wall-clock time that became kept progress. | Fault tolerance, sections 4, 6 and 9; the Storage lab |
measured: times in seconds after the failure was injected, from log lines (each step in the list names its file under src/fail/runs/). The time axis is compressed (square root) so that 0.15 s and 450 s fit on one line. "Rank crashes" is train.py --crash-rank 3 --crash-step 120 (exit code 13 after step 120); a node is a container killed with docker kill (its processes die, so peers see closed sockets) or frozen with docker pause (silent, like a hung host).
Who can notice a failure, and how. Three layers watch a training job, each with its own clock:
SlurmdTimeout (30 s in this cluster, 300 s by default), Kubernetes marks a node NotReady after node-monitor-grace-period (50 s by default in v1.37), and Ray's GCS declares a node dead after its health checks fail (30 s measured).What happens next is policy, and the three systems ship different defaults. The matrix below holds every run; click a cell to replay it step by step from its own logs, each event explained in the list below.
What the twelve runs show.
--requeue covers node failure and preemption, not a program that exited with an error. A JobSet fails unless failurePolicy.maxRestarts is above 0, and Ray Train unless FailureConfig(max_failures) is; the running example sets both to 0 (as is common in templates), so all three systems stopped. With retries allowed, JobSet recreated every pod and resumed in 10.3 s, Ray Train started a new worker group and resumed in 10.2 s.torchrun --max-restarts=2. With PyTorch 2.14.1's defaults on two machines the restart failed twice in a row, in two separate jobs (Gloo connectFullMesh failed ... Connection refused): the restarted ranks dialled addresses from the previous attempt. Setting TORCH_DISABLE_SHARE_RDZV_TCP_STORE=1 gives each restart a fresh store, and the same crash then resumed in 3.4 s. The Launching distributed training child page isolates the trap in the source.out-of-service taint (section 3) at 445 s.--requeue, a spare node is idle. How long before the job runs again, here with SlurmdTimeout=30?SlurmdTimeout=300 the first part alone would be 5 minutes.Each experiment below was run on the same clusters; the result is kept here in one line because the child pages cite it, and the page named in the last column teaches the subject in depth. Raw logs are in src/fail/runs/.
| Experiment | Result measured | Taught on |
|---|---|---|
| The same crash with and without checkpoints (Slurm, 200 steps) | Wall-clock = work + steps redone × step time + recovery predicted the three runs within 3.5%, 5.1% and 1.2% (crash with checkpoints every 50 steps: 20 steps redone; without: 120; node killed and requeued: recovery 166 s) | Fault tolerance, section 9 (goodput accounting) |
| Did the loss come back bit for bit? | Seven resumed 4-rank runs on three schedulers agreed with each other exactly, and with the uninterrupted run at 8 of 10 logged steps; at 2 they differed by one float32 rounding step (2.4e-7). Cause: DDP rebuilds its gradient buckets after a process's first step, changing the summation order; with the rebuild off the resume is exact | Fault tolerance, section 6 (restore traps) |
| A frozen rank (SIGSTOP, gloo timeout 30 s) | The three healthy ranks errored after 30.8 s and the job failed; torchrun's "Root Cause (first observed failure)" named a healthy rank that timed out first, not the frozen one | Fault tolerance, section 3; Launching distributed training (hang drills) |
| One slow rank (rank 3 sleeping 0, 50 or 200 ms per step) | Every rank reported the same step time (22.1, 70.5 and 221.8 ms); the slow rank waited least in backward (12.2 ms against 62.6 ms for the others), so ranking ranks by collective time names the victims | Fault tolerance, section 8 (the measured replay) |
| Keeping bad nodes out | A drained Slurm node was skipped (a 3-node job waited with "Nodes required for job are DOWN, DRAINED ..."); a cordoned kind node got no new pods; a HealthCheckProgram that drains its own node (Slurm ignores the exit code) drained it 1.4 to 7.3 s after the fault; a frozen kubelet left its pod Terminating until the node.kubernetes.io/out-of-service taint, after which the JobSet restarted in 2 s | Fault tolerance, section 3; Slurm; Kubernetes for ML |
Elastic torchrun (--nnodes=1:2) and a hot spare | Losing one of two agents: running again at world size 2 after 44 s (keep-alive 5 s × 3, then a 30 s last call); with a spare agent waiting, full size again after 18.1 s. Killing the agent that hosts the c10d store killed the whole job. The shrunk run differed in the last bits at 7 of 15 logged steps | Fault tolerance, section 5; Launching distributed training |
| Goodput against the checkpoint interval | At Llama 3's rate a 16,384-GPU job fails every 3.1 hours; with a 1-minute blocking checkpoint and 10 minutes to recover, the best interval is about 19 minutes of work and goodput about 85%; cutting recovery to 1 minute gives about 89% calculation | Fault tolerance, sections 5 and 9 (the same model for one failure under each design and goodput against job size); Power, cooling, reliability, section 6 (the interval) |
src/fail/; the charts and logs behind the table above (checkpoints, bit for bit, the hang, stragglers, drains, elastic runs, the goodput model) are drawn on Fault tolerance at scale since 2026-10-19.A training job touches storage in two very different ways. It reads its data as a steady stream, which is easy to hide behind compute. And every so often it writes a checkpoint: every rank at the same moment, while the GPUs wait. This lab measured both with the running example on this Mac; at root depth it keeps the tiers compared, the measured results in one table, and one calculator that scales the arithmetic up to real model sizes. How parallel file systems and object stores work inside, and how to size one, is the child page Storage and data movement. The question it keeps returning to: how long does training stand still to save itself, and what does it take to make that short?
Labels: measured here, on an Apple M1 Pro with Docker Desktop's Linux VM, on a shared machine, so timings are rough (medians of repeated runs, ranges shown); published by an operator about its own system; vendor specification or documentation; derived by calculation, formula shown. Formats, shards and data loaders are not repeated here: they live on Storage and loading at scale.
Storage is a ladder: the closer to the GPU, the faster, smaller and more fragile. Five rungs matter for training:
| Tier | Speed | Latency | Price (AWS, us-east-1) | Shared by all nodes | Survives a node failure |
|---|---|---|---|---|---|
| Host RAM | DGX B200: 2 TB per node vendor (NVIDIA); PCIe Gen5 x16 is about 63 GB/s per direction derived (32 GT/s x 16 lanes x 128/130 / 8) | microseconds | part of the node | no | no, unless copied to other nodes (Gemini keeps redundant in-memory copies: goodput 85% to 97%, Gemini 1.0 report) |
| Local NVMe | one PCIe Gen5 drive: 14 GB/s read, 10 GB/s write (Micron 9550) vendor (Micron); DGX B200: 8 x 3.84 TB in RAID 0 as a data cache | tens of microseconds | part of the node | no | no |
| Parallel file system | FSx for Lustre: 125 to 1,000 MB/s per TiB provisioned; up to 100 Gb/s per client, 700 Gb/s with EFA vendor (AWS). Meta's Tectonic for Llama 3: 2 TB/s sustained, 7 TB/s peak published (Llama 3 §3.3.1). Ai2's WEKA: 761 Gb/s with 64 clients published (OLMo 2 §6) | sub-millisecond per file operation (FSx) | $0.145 per GB-month (PERSISTENT-125); scratch $0.140 | yes | yes |
| NFS | one server: at most its link, e.g. 12.5 GB/s on 100 GbE derived | about a millisecond per operation | varies | yes | yes |
| Object storage | scales with parallel requests: 3,500 PUT and 5,500 GET per second per key prefix; GCS "up to 1 GB/s per VM" at Ai2 vendor published (AWS, OLMo 2) | "tens of milliseconds" median for small requests; S3 Express One Zone single-digit ms | S3 Standard $0.023 per GB-month, $0.005 per 1,000 PUTs, $0.0004 per 1,000 GETs; Express One Zone $0.11 per GB-month | yes | yes (replicated) |
Prices: AWS Price List API for S3 (published 2026-10-15) and the FSx for Lustre pricing page's worked examples, read 2026-10-16; other regions and providers differ. Vendor speeds are specification sheets, not measurements.
All rows measured with the running example or the same GPT made wider (3.2M and 25.3M parameters), 4 ranks with gloo, medians of repeated runs; raw records in src/io/out/. Each row names the page that teaches the subject in depth.
| Question | Result | Taught on |
|---|---|---|
| What is in a checkpoint? | The running example's 1,386,049-byte torch.save file: 32.5% fp32 weights, 65.0% AdamW moments, the rest pickle and zip headers: 12.31 bytes per parameter. Mixed precision adds the bf16 copy (about 14 bytes per parameter, so about 5.7 TB for 405B derived) | Storage and data movement, section 8 (formats as files and byte ranges) |
| Does the tier matter? | A 304 MB checkpoint: 0.39 s to a Docker volume, 2.6 s to an S3-compatible store (SeaweedFS) in a container, 7.3 s to a host folder shared into the VM. The same shared folder made kind's checkpoints 36 times slower than Slurm's | Storage and data movement, section 6 (the six stand-ins, charted) |
| Who writes what at a checkpoint (3.2M parameters, slow shared folder) | Rank 0 alone 0.98 s; every rank writing the full state 2.95 s for 4 times the bytes; FSDP gathered to rank 0 then one file 1.51 s (0.43 s of it gathering); FSDP with PyTorch DCP, one shard per rank, 1.67 s. On one shared pipe sharding is not faster; on a cluster each node brings its own link | Storage and data movement, section 8; Distributed PyTorch (DCP) |
| Asynchronous checkpointing | Time training stood still per checkpoint: 1.81 s synchronous against 78 ms with dcp.async_save on the slow folder. The first attempt hung (and a rerun crashed with op.nread == op.preamble.nbytes) until the background save got its own process group | Storage and data movement, section 7 (the measured animation and the trap); Fault tolerance at scale, section 4 (checkpointing strategies) |
| Small files | The same 64 MiB as 16,384 files of 4 KiB read at 26 MB/s from a Docker volume against 1,774 MB/s as 16 files of 4 MiB, and at 2.9 MB/s from the S3 store: each file or object pays a fixed cost | Storage and data movement, section 4 (the metadata storms) |
| Prefetch | A loop needing one 4 MiB shard per 100 ms step stalled 147 ms in all on the S3 store fetching on demand, and 8 ms with two shards in flight | Storage and data movement, section 4; Storage and loading at scale |
| Restore | A 4-rank DCP checkpoint loaded into 2 ranks, 3 ranks and one process, tensor for tensor identical. A truncated torch.save file fails with "PytorchStreamReader failed reading zip archive"; a missing DCP shard with CheckpointException; a changed model with "size mismatch" | Storage and data movement, section 8; Fault tolerance at scale, section 6 (restore traps) |
At scale the measurement turns into arithmetic. Three numbers decide how long a checkpoint stops training: its size, the slowest pipe it must squeeze through (one node's link for a consolidated write; all the nodes' links or the storage system's aggregate bandwidth, whichever is smaller, for a sharded one), and, for asynchronous checkpointing, the copy of each GPU's shard to host memory. Everything below is derived from the inputs; each tier's number says where it comes from.
Defaults check: 405B at 14 bytes on 16,384 GPUs gives 5.67 TB, 346 MB per GPU (inside Llama 3's stated 1 MB to 4 GB per GPU) and 2.8 s at Tectonic's 2 TB/s sustained. Simplifications, said plainly: no metadata or file-creation cost, no gather time for the consolidated write, perfect parallelism, and a store that sustains its rated bandwidth under a burst (Meta built Tectonic's 7 TB/s peak for exactly this). The formulas are recomputed in src/io/recompute.py.
src/io/; the charts behind section 2 (tiers, checkpoint anatomy, write layouts, async checkpointing, small files and prefetch, restore errors) are drawn on Storage and data movement since 2026-10-19.A training run is paid for in GPU-hours: GPUs held, times hours held, whether they compute or not. This lab follows one paid GPU-hour down to the useful arithmetic it buys, measured on the topic's three small clusters (where the GPUs are fake and only counted), then priced at real scale from published numbers. The question it keeps returning to: of every hour you pay for, how much trains the model, and where does the rest go?
Labels: measured on the Mac, published by someone else (dated), derived by arithmetic shown, assumption you should change. Timings here are measured on Apple M1 Pro, Docker Desktop VM, shared machine: rough. Event orders, counts and states are exact.
sacct's AllocTRES times Elapsed) all count this, not work done. 1,024 GPUs for a day is 24,576 GPU-hours.The running example (a 112,577-parameter GPT, 2 nodes x 2 ranks, 4 fake GPUs) was given 4 GPUs by each system's own accounting: Slurm's sacct Start to End, Kueue's Workload Admitted to Finished. Its rank 0 log says what happened inside that window: when the process started, when step 1 ended, each checkpoint, the last step. Pick a run; the bar is the allocation drawn to scale, coloured by what it was spent on.
Three things to read off it. Startup is a fixed cost: a few seconds of container start, imports, rendezvous and process-group init, whether the job then trains for 6 seconds or 6 days. The end is not free either: Kubernetes keeps the allocation until the Job controller sees both pods finish and Kueue marks the Workload finished, about after the last step here. Checkpoints show up as a storage choice: the same 1.39 MB checkpoint took per write on Slurm's Docker volume and on kind's host folder, the 36x the Storage lab measured.
Slurm also records CPU time: TotalCPU of CPU-seconds allocated, a "CPU efficiency" of (what seff prints), while only of the allocation was training steps. Imports and spin-waiting burn CPU too: busy is not the same as useful, which is the whole lesson of the GPU utilisation drill below.
The same JobSet through Kueue, run back to back on 2026-10-16. Step through the allocation as it is spent; the counters tie the picture to the shares quoted above.
Before and after, phase by phase. The same JobSet through Kueue, run back to back with 200 and 2,000 steps; each step of the replay spends one phase of the allocation:
Ray: the setup's Ray Train run kept no allocation record (Ray's state API, ray list actors --detail, would give each training actor's start and end); the bar uses the driver's "Connected" log line to rank 0's end, so its tail is missing. What it does show: between the driver connecting and the first training process starting (Ray Train's controller, the placement group, four worker actors), against on Slurm.
One job's allocation is the inner loss. The outer one is the cluster: how many of its GPU-seconds were given to any job at all. These are the Scheduling lab's recorded runs, read through the cost lens (that lab explains the policies; here only the accounting).
Read as money, the three systems fail in three different ways. Slurm without backfill leaves GPUs idle behind a big job at the head of the queue: the same eight jobs used of 8 GPUs' time under FIFO and with backfill, and the mean wait fell from to . Kubernetes without gang scheduling can allocate every GPU and run nothing: half of each of three jobs held all 12 GPUs for ( GPU-seconds), every one of them idle at a rendezvous, until the lab gave up. Kueue's all-or-nothing admission removed the deadlock but not every loss: with 8-GPU jobs and a 12-GPU quota, 4 GPUs stayed free the whole time because no waiting job fit in them (fragmentation: at most of the quota can ever be busy). Ray refuses rather than wastes: a 4-bundle STRICT_PACK group stays PENDING forever on nodes of 2 fake GPUs each, holding nothing, and a second gang waits with one GPU free rather than taking a partial set.
The Failure lab broke the running example on Slurm on purpose: it explains what each failure does and how runs survive it. Here each run is reduced to the one number a bill sees, the GPU-seconds held (4 fake GPUs times the time each job held them, from sacct), against the clean run. The first five runs train the same 200 steps to the same final loss, except the hang, which never finishes; the three straggler runs train 100 steps and are compared with each other.
The pattern scales. A crash costs the work since the last checkpoint plus the restart, so the checkpoint interval is a cost knob (Power, cooling, reliability, section 6, finds its optimum). A lost node costs detection plus requeue delay: here Slurm noticed after (SlurmdTimeout=30) and then waited before starting the requeued job (a requeued job's earliest start is pushed back by the credential lifetime, the Scheduling lab found in job_mgr.c). A hang is the worst kind: it holds every GPU until a timeout fires ( here, because the lab set a short one; PyTorch's default process-group timeout is 30 minutes, NCCL's 10) and produces nothing. And one slow rank makes all ranks slow: synchronous training runs at the pace of the slowest, so a straggler multiplies cost by the number of GPUs waiting for it.
Select a bar for its story.
Three kinds of price, and they are not interchangeable. On-demand list: pay per hour, stop any time, no promise of capacity. Reserved (commitments, capacity blocks, cluster contracts): a lower or fixed rate for a term, paid whether the GPUs work or not, which is why every loss in this lab becomes real money on a reservation. Spot: spare capacity at a discount that the provider can take back with short notice, usable only by jobs that checkpoint and restart well. All prices per GPU-hour, US East, read on 2026-10-16 from each provider's own pages or price data; an 8-GPU instance price is divided by 8.
| Provider | GPU | Kind | $ / GPU-hour | What it is |
|---|
website.spot.ec2.aws.a2z.com/spot.js) was last modified on 2024-05-13 and lists p5.48xlarge above its current on-demand price, so it is stale and not used. Google Cloud's GPU price tables load in the browser and could not be read as text; not included.From a model and a token budget to days and dollars, with every assumption visible. The compute side (6 FLOPs per parameter per token, peak FLOPs, MFU) is the Performance math page's, with the same peak values, so the two pages agree; its Run and serving planner tab sizes a cluster for a deadline. What this calculator adds is the infrastructure: failures, checkpoints, restarts, idle reservation, and the price kind.
Formulas: training FLOPs = 6 × parameters × tokens; ideal GPU-hours = FLOPs / (peak × MFU) / 3,600; job MTBF = 1 / (interruption rate per GPU × GPUs), so a job twice as big fails twice as often; goodput = 1 − stall/interval − (interval/2 + restart)/MTBF (first-order: on average half an interval is redone per failure); wall days = ideal GPU-hours / GPUs / goodput / 24; paid GPU-hours = GPUs × wall hours / (1 − idle share). Capacity planning solves for the GPU count that meets the deadline, with goodput recomputed at each count. Checked against src/cost/recompute.py.
Every loss on this tab in one picture: each bar is the share of paid GPU-hours still doing useful work after one more kind of loss. Toggle before and after to watch the biggest infrastructure loss being fixed on the same input.
nvidia-smi's utilisation, and DCGM_FI_DEV_GPU_UTIL that dashboards plot from it, is the "Percent of time over the past sample period during which one or more kernels was executing on the GPU" (nvidia-smi documentation): one kernel on one SM counts the same as a kernel filling all of them, and a collective kernel spinning while it waits for a hung peer counts as busy, so a hung job reads 100% while nothing is computed. What each counter really counts (utilisation, SM activity, tensor activity, DRAM activity) on seven situations of a simulated 132-SM H100, and a hung job seen on all three meters, are Observability and cost, sections 1 and 2. For cost, the rule is the next table: the bill, the counters and the training log answer different questions.
Three sources, and each answers a different question. The scheduler's accounting says who held what and for how long (the bill). The GPU's counters say what the hardware did. The training log says what the model got. Only the three together say what you paid for useful work.
| Signal | Where it comes from | What it answers | What it cannot tell you |
|---|---|---|---|
| GPU-hours by job, user, team | sacct (AllocTRES x Elapsed), Kueue Workload admission and finish times (Kueue's per-ClusterQueue usage and quota gauges, kueue_cluster_queue_resource_usage and _nominal_quota, appear only with enableClusterQueueResources: true, which is commented out in Kueue v0.20's shipped config), Ray's state API | The bill, chargeback, quota use, scheduling efficiency | Whether anything ran |
DCGM_FI_DEV_GPU_UTIL | dcgm-exporter, on by default; the same as nvidia-smi | Is any kernel running? (0% for long means a stalled or idle job) | How much of the chip works; a hang reads 100% |
DCGM_FI_PROF_SM_ACTIVE (DCGM 4.6.1: DCGM_FI_PROF_SM_UTIL_RATIO) | DCGM profiling field 1002, renamed in DCGM 4.6.1 with the old name kept as an alias (dcgm_fields.h lines 3821-3825); commented out in dcgm-exporter's default counters list | How much of the chip has work; "0.8 or greater is necessary, but not sufficient, for effective use" (DCGM docs) | Whether the warps compute or wait on memory |
DCGM_FI_PROF_PIPE_TENSOR_ACTIVE, DCGM_FI_PROF_DRAM_ACTIVE | Profiling fields 1004 and 1005, on by default | Are the tensor cores busy (the FLOPs MFU counts), or is the job memory-bound? | Whether the work is useful (recompute, padding, a wrong batch) |
DCGM_FI_DEV_XID_ERRORS, ECC, NVLink error counters | dcgm-exporter (XID on; most NVLink and ECC counters commented out by default) | Hardware faults: the input to node health checks and draining (Failure lab) | Cost directly; they predict the next interruption |
| Tokens per second, MFU, step time per rank | The training loop's own log | Useful work; stragglers (one rank's step time) | Why it is slow |
Field names, IDs and defaults from dcgm-exporter's etc/default-counters.csv (commit fafd151, 2026-09-18; saved in src/cost/inputs/) and the DCGM documentation above. dcgm-exporter 4.8.4 and DCGM 4.6.1 were current on 2026-10-16 (Tool map); DCGM 4.6.1 renamed the profiling fields (1004 is now DCGM_FI_PROF_TENSOR_UTIL_RATIO, and so on) and keeps the old names as aliases, so dashboards built on either name work.
sacct and billing on Slurm from zero.Which infrastructure tools are alive, which have stopped, who owns them now, and which to pick for a job. Every open-source tool below has its latest release and last commit read live from PyPI and GitHub on 16 October 2026; ownership changes and shutdowns are dated and linked. Verdicts are judgements and are labelled judgement.
This atlas dates and judges each tool; the mechanisms live on the child pages: Slurm on Kubernetes (Slinky, SUNK) in Slurm from zero's closed depth on containers (section 12); trackers, registries and managed platforms, including SageMaker training jobs against a HyperPod cluster, in ML platforms and workflows, sections 5, 6 and 10; Kueue, JobSet and the Kubeflow Trainer in Kubernetes for ML, sections 8 to 10; KubeRay in Ray.
Twelve jobs an ML infrastructure engineer does, and the tool you would have reached for in October 2023. The changes play in date order, each explained in the list below; each is backed by a release, an owner's notice or an acquisition announcement linked in the tool's entry below. Click a slot to open its tool.
Click a column header to sort, a row for details. Latest release is the newest stable version on PyPI, else the newest stable GitHub release (alphas, release candidates, nightlies and provider packages skipped); last commit is the newest commit on the default branch (GitHub Atom feed). Commercial products have no public repository, so no dates. A recent commit is not a sign of health on its own: read the owner's notice first (MinIO and Neptune had commits or releases months before they ended).
Pick a job and where you run. The stack is listed in the order you would meet it; tools to steer away from are listed with the reason. judgement built from the entries above.
Each bar runs from a tool's start (first PyPI release, repository creation or launch, named in its details) to today, or to its last activity if it stopped; colour is its status today. Arrows mark a hand-over: solid when the owners documented it, dashed when it is our reading of what users did (no notice names a successor). Diamonds mark a change of owner. Click a bar for details.
The Scheduling, Launch, Failure and Storage labs run real Slurm, Kubernetes (kind) and Ray. This table compares what those labs ran with the latest releases above, so you know how far the lab is from today's release.
Ask who uses it and what else runs on it. Mostly researchers running long multi-node jobs, with a small ops team: Slurm (gang allocation, fairshare, backfill and topology placement built in, little to operate). A company that already runs Kubernetes and wants training, inference and pipelines on one pool: Kubernetes plus Kueue (or KAI) and JobSet or TrainJob. Wanting both is common enough that SchedMD (Slinky) and CoreWeave (SUNK) sell Slurm running on Kubernetes. Ray goes inside either for Python-level orchestration.
It places one pod at a time and has no queue or quota between teams. A 16-pod job can get 10 pods placed and wait forever for the rest while holding the GPUs (two such jobs deadlock). You add all-or-nothing admission and queues: Kueue keeps the default scheduler and admits whole jobs against quotas; Volcano and KAI replace the scheduler with gang scheduling built in. The Scheduling lab shows the deadlock and its fix.
Training Operator v1 is in maintenance on its release-1.9 branch, and Kueue calls its integration legacy and deprecated. New work should use Kubeflow Trainer v2's TrainJob (run as a JobSet) or a JobSet directly. Note Trainer v2 still calls itself alpha, and Kueue 0.20 also stopped serving its own v1beta1 API, so check both upgrades together.
Owner's notice first (README banners, shutdown pages), then the archived flag, then the date of the last release, and only then commit activity. Then who owns it and how it makes money: the 2024 to 2026 record has a tracker shut down three months after its acquisition (Neptune), an open-source object store archived in favour of a commercial edition (MinIO), and a vendor platform with no release since March 2025 (Determined). Prefer projects under a foundation (Kubernetes, Kueue, Ray in the PyTorch Foundation, Airflow) and keep data exportable.
Ray is not a cluster scheduler between teams; it schedules tasks and actors inside one Ray cluster that Slurm or Kubernetes (KubeRay) gave it. Use it when the job itself is many cooperating Python processes (RL with generation, reward and training workers; data pipelines feeding GPUs); plain DDP pretraining does not need it.
Sources: PyPI JSON API, GitHub REST API and Atom feeds (read 2026-10-16), the owners' READMEs, release notes and announcements linked in each entry. Scripts: src/map/ (fetch_meta.py, atlas_tools.py, atlas_more.py, gen_data.py, check_versions.py).
Times: for knowledge-base pages, the Reading tab as its header states it (pages without such a header carry no time); for outside resources, an estimate for the part worth reading. Labels: operator an organisation describing its own cluster or run (authors: a system described by its designers); vendor a company describing what it sells; independent no stake in the product; docs the project's reference documentation. Links checked 2026-10-16.
One workload through real Slurm (FIFO, backfill, fairshare), Kubernetes (default scheduler against Kueue, the gang deadlock) and Ray placement groups; a simulator for bigger clusters.
Submit to first step on each system, stage by stage; rendezvous with real arrival times; the environment each one sets; every common broken launch, induced, with its real symptom.
Killing ranks, containers and pods mid-run on Slurm, Kubernetes and Ray, replayed from the logs; every other measured result in one table.
The storage tiers compared; measured checkpoint, async and data-reading results in one table; the checkpoint-time calculator.
One allocation priced second by second, scheduling efficiency on the three systems, failures priced, GPU-hour prices, the run-cost calculator and the utilisation waterfall.
Every scheduler, launcher, storage system and platform with status, dates, licence and a verdict.
One GPU node part by part, scale-up racks, the four networks, the control nodes and a job's path, placement, nine published cluster designs.
A job's life in slurmctld's log, both scheduler loops, multifactor priority reproduced exactly, preemption and requeue, the Why pending? decoder.
Scheduler scoring, device plugins, the GPU Operator and DRA, RDMA in a pod, gangs, Kueue, JobSet, Trainer v2, serving objects.
Ownership and lineage, placement groups, node loss, Ray Data, Ray Train's restore from an older checkpoint, Ray Serve.
Launchers, torchrun's agent, static and dynamic rendezvous, NCCL's start-up, every timeout, hang debugging.
Failure tables compared, detection timers, checkpointing strategies, recovery designs, silent data corruption, stragglers, goodput.
Striping and metadata storms measured, object storage semantics, caches, data movement, checkpoints as byte ranges, sizing.
What each GPU counter counts, a recorded dashboard of a hang, goodput metering, cost per GPU-hour and per token, capacity planning.
Tracking, registries, pipelines and lineage on a real MLflow server and Metaflow flow; feature stores; managed platforms.
The training side: the stages a cluster runs, and in its "Running the job" section the stack of a big run bottom to top, the 2026 frameworks and a checklist.
Data, tensor, pipeline and expert parallelism: what the ranks launched here actually do.
c10d, DDP, FSDP2, DTensor, distributed checkpoints, torchrun from PyTorch's side.
NVLink, InfiniBand and RoCE, fabrics and rails, why the network picks your parallelism.
Llama 3's interruptions by hardware part, Young and Daly derived with the exact interval and a simulator (section 6).
FLOPs, MFU, tokens per second and costing a run.
Namespaces and cgroups: what a pod or an Enroot container really is.
Page cache, fsync and journaling: why a checkpoint "written" may not be on disk.
Data formats, shards and streaming loaders for training data.
Timeouts, retries, SLOs and incidents, in general.
Logs, metrics, traces and alerting, in general.
Consensus and coordination behind etcd, the Kubernetes API server and Ray's GCS.
Keys, jump hosts and tunnels for getting onto a login node.
The paper page, with its infrastructure section checked.
The cluster, MAST, Tectonic, 4D parallelism and the 54-day interruption table.
How Meta schedules training across data centres.
The successor to Llama 3's table: 678 interruptions of a 32K-GPU job, HBM3 now the top cause. Its "every 18 minutes at 100K GPUs" does not follow from its own rate (about 50 minutes).
Failure statistics from two research clusters, and what they mean for job sizes.
Training on more than 10,000 GPUs: diagnosis, fault tolerance, stragglers.
10,000 A100s, the HAI Platform scheduler, 3FS, checkpoints every 5 minutes, failure statistics.
Two clusters, Beaker, health checks and cordoning, in plain words.
SuperPods, hot standbys, in-memory redundant state, goodput 85% to 97%.
One pod per node, gang scheduling, preflight health checks, the limits they hit.
The ancestor of Kubernetes: cells, priorities, quotas, preemption.
Tasks, actors, the GCS and the bottom-up scheduler, by Ray's authors.
The original design of slurmctld, slurmd and allocations.
The checkpoint-interval formulas used in section 5.
Practitioner chapters on Slurm, fault tolerance, storage, network debugging and hangs.
Parallelism on GPU clusters, from experiments on up to 512 GPUs.
How GPU clouds are rated, including what good managed Slurm and Kubernetes look like.
Commands, daemons and job submission.
Queues, quotas and all-or-nothing admission; groups of jobs as one.
TrainJob and training runtimes, the successor of PyTorchJob.
Worker groups, checkpoints and fault tolerance in Ray.
Rendezvous, restarts, environment variables; sharded and asynchronous checkpoints.
What SM activity and tensor activity measure, and what they do not.