AI Infra Interviews logo
Kubernetes, Slurm & GPU Scheduling / 03
medium★ EssentialNewCoreWeaveCrusoeNebius

Slurm or Kubernetes for a 2,000-GPU training cluster? Make the case, and tell me what you lose either way.

Slurm gives you gang scheduling, topology and MPI launch for free and nothing for services; Kubernetes gives you services, elasticity and the ecosystem and makes you bolt on the batch semantics. The hybrid that most large clusters land on, with the numbers that push them there.

Updated Sep 2026 · Grounded in real AI infrastructure interview loops and written to a senior-engineer editorial bar, with every number worked and every diagram hand-built.

TL;DR: For a cluster whose work is multi-node synchronous training, Slurm wins out of the box: gang scheduling, topology-aware placement, backfill, fair share, MPI and container launch through Pyxis are native, and the failure modes are twenty years old. Kubernetes wins where the same fleet also serves models, runs pipelines and notebooks, and needs autoscaling, RBAC and the operator ecosystem, but it needs Kueue or Volcano for gang semantics, a topology model, and an operator for the GPU stack before a training job runs well. Large fleets increasingly run both: Slurm partitions for the big runs, Kubernetes for everything else, or Slurm on Kubernetes (Slinky, Soperator) to get one control plane.

How to approach it

Ask what fraction of the GPU-hours are multi-node training versus serving, notebooks and pipelines, and who the users are (researchers who write sbatch, or product teams who write Helm charts). Then list what each scheduler has natively and what has to be added, in the order a training job needs it: admission, placement, launch, fairness, recovery. Give a decision tied to the workload mix, with the mix ratio that flips it, and name the hybrid as the thing large clusters actually run.

A strong answer

A typical situation: a lab buys 250 nodes of 8 H100s, the research team has run Slurm for years, and the new platform team wants Kubernetes because the serving stack, the observability and the CI already live there. Both sides are right about their own workload.

What a training job needs, and who provides it:

NeedSlurmKubernetes
all-or-nothing admission for N nodesnative (--nodes=32)Kueue, Volcano or KAI on top of the default scheduler
placement within one rail leaf or blocktopology plugin, --switchesKueue topology-aware scheduling, or labels and affinity by hand
launch of one process per GPU with rank envsrun sets rank, world size, hostlist; MPI and NCCL just worka training operator (Kubeflow, JobSet) creates pods and injects the env
containersPyxis and Enroot pull and run imagesnative
backfill, fair share, accountingnative, with decades of tuningKueue cohorts and quotas; accounting through metrics
services, autoscaling, ingress, RBACnonenative
elasticity (grow a job by nodes)awkwardnatural for services; for training needs an elastic framework

The Slurm for AI Clusters page covers the native path in detail; Slurm vs Kubernetes carries the ecosystem comparison. The answer that earns the round is the arithmetic of what the gap costs.

Without gang scheduling, the default Kubernetes scheduler places pods one at a time, and two large jobs can each hold half the cluster forever. The cost of a missing feature is not slowness, it is an idle fleet that reads as full:

cluster: 2,000 GPUs = 250 nodes × 8
two jobs of 1,200 GPUs each, submitted minutes apart, no gang scheduling
  the scheduler interleaves: job A gets 1,000, job B gets 1,000, cluster full
  both block at the first NCCL collective waiting for ranks that will never come
  useful work: 0 of 2,000 GPUs, at $2.50 per GPU-hour ≈ $5,000 per hour of nothing
with gang admission: A runs on 1,200 (800 free for smaller jobs), B waits holding nothing
sanity: the failure is a live-lock visible only as "every GPU allocated, 0% SM active";
        Slurm has never had it; Kubernetes has it until Kueue or Volcano is installed

Topology is the second gap, and it costs throughput rather than deadlock. A 64-GPU job that Slurm places on 8 whole nodes under one leaf runs its tensor-parallel groups on NVLink; the same job placed as scattered pods runs some TP groups across the NIC and can lose more than half its step time (Topology-Aware Scheduling works this to a 2.5x step-time gap). Kubernetes reaches parity with a topology model and Kueue's TAS, but someone has to build and maintain the labels.

What Kubernetes gives that Slurm cannot is everything that is not a batch job. Serving needs replicas, readiness, rolling upgrades and autoscaling on custom metrics; pipelines need CRDs and operators; notebooks need per-user isolation and idle reclaim; all of it needs RBAC and network policy. Slurm has no answer to a Deployment, and a lab whose GPU-hours are 40% serving cannot run serving through sbatch.

So the decision follows the mix:

GPU-hours by workload, illustrative
  ≥ 80% multi-node training, users write sbatch:      Slurm, with Pyxis for containers
  ≥ 50% serving, pipelines, notebooks:                Kubernetes, with Kueue and a training operator
  mixed, one fleet, one team owning it:               hybrid: Slurm partitions for large runs
                                                      (or Slurm-on-Kubernetes), Kubernetes for the rest
sanity: the cost of the wrong choice is asymmetric; a Slurm cluster with a serving need is a
        second cluster; a Kubernetes cluster with a big-training need is three add-ons and a
        year of scheduler tickets

For the 250-node lab, the hybrid: a Slurm partition of 200 nodes for the big runs, where gang, topology and fair share are native, and 50 nodes under Kubernetes for serving, evaluation and notebooks, with a quota policy that moves nodes between them monthly. Slinky and Soperator, which run the Slurm control plane and nodes as Kubernetes workloads, give one control plane and one node pool with Slurm's batch semantics, and by 2026 that is what several GPU clouds offer as their default training environment.

The condition that reverses the hybrid toward pure Kubernetes is a fleet where the biggest job is 64 GPUs and the users already write Kubernetes manifests: Kueue with gang admission and a training operator covers that without the topology work, and one control plane is worth more than Slurm's polish. The condition that reverses it toward pure Slurm is a fleet where nothing serves traffic, which is rarer every year.

squeue and kubectl get pods answer the same question in two vocabularies, which is most of the operational cost of running both.

WHAT EACH ONE GIVES YOU BY DEFAULT Slurm: training gang, topology, MPI launch by default Slurm: serving no services, no rollouts build it Kubernetes: serving deployments, autoscaling, ecosystem by default Kubernetes: training Kueue + labels + an operator build it The axis is your workload mix, not a preference, and the reversal is where the two shares cross. Running both is the least painful arrangement I have operated, and it is two on-call surfaces.

What interviewers probe next

  • "Your researchers refuse to write YAML. What changes?" Nothing about the scheduler; give them a submission CLI or run Slurm-on-Kubernetes so sbatch still works.
  • "How does a 512-GPU job ever get a window on a busy Kubernetes cluster?" The same way it does on Slurm: reservation (hold freed nodes until the gang fits) or priority aging in Kueue; without one, small jobs starve it forever.
  • "What does Slurm do badly for training?" Elasticity and services; a job that wants to shrink when a node dies needs a framework that handles it, and Slurm's job model is fixed-size.
  • "Which would you choose for a 64-GPU startup?" Kubernetes with Kueue; the batch gaps are small at that size and the serving stack has to exist anyway.

Common mistakes

  • Answering with a preference ("Kubernetes is the future") instead of a workload mix and a reversal condition.
  • Forgetting that stock Kubernetes has no gang scheduling, then describing a training platform that deadlocks on its first busy day.
  • Claiming Slurm cannot run containers; Pyxis and Enroot have run images under srun for years.
  • Treating the hybrid as a cop-out; it is what most large fleets run, and the interviewer wants to hear how the boundary is managed.

Key takeaways

  • Slurm has gang, topology, backfill, fair share and MPI launch natively; Kubernetes needs Kueue or Volcano, a topology model and a training operator to match.
  • Kubernetes has services, autoscaling, RBAC and the operator ecosystem; Slurm has none.
  • Two 1,200-GPU jobs on 2,000 GPUs without gang scheduling can hold 1,000 each and do nothing.
  • Decide by GPU-hour mix; the hybrid (Slurm partitions or Slurm-on-Kubernetes, plus Kubernetes for the rest) is the common landing.
That one was free — and so are 10 answers per topic without an account. Signing in doubles that to 20, opens the Plus lessons in the courses, and remembers which topics you keep getting wrong.no card · Google sign-in · nothing to cancel
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 10 to 20 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free

The concepts behind this question

Ranked by how closely each one overlaps this question's topic, so the first card is the thing to read if the answer above moved too fast.

Foundational
🗂️ Scheduling & Orchestration
Node Lifecycle: Drain, Upgrade and ReturnA node moves through a fixed cycle between provisioning and decommissioning, and most fleet operations are one lap around it: cordon so nothing new lands, drain so running work finishes or moves, act, validate, then return to the pool. The wall-clock cost of a fleet-wide change is dominated by draining rather than by the change itself, which makes the plan a scheduling document rather than a technical one.
Foundational
🗂️ Scheduling & Orchestration
Slurm vs KubernetesEvery GPU platform team has this argument, and the two schedulers were built for different jobs: Slurm for long, large, all-or-nothing training on bare metal; Kubernetes for many services that scale up and down. Training fleets run Slurm because gang scheduling, topology and MPI-style launch are native there; serving fleets run Kubernetes because autoscaling and rolling deploys are native there. A platform that does both picks a hybrid: Slurm on Kubernetes (Slinky, Soperator) or a batch scheduler on Kubernetes (Kueue, Volcano, KAI). The interview question is which, for which workload, and why.
Advanced
🗂️ Scheduling & Orchestration🔒 Premium
Gang Scheduling with Kueue and VolcanoA distributed training job is 64 pods that start together or not at all: if 40 are running and 24 are Pending, the 40 hold their GPUs idle at a collective barrier waiting for ranks that may never come, and two such jobs can deadlock a whole cluster. Gang scheduling makes the job the unit of admission. Kueue and Volcano add queues, quotas, priorities and preemption on top, which is what turns a pile of GPUs into a platform several teams can share without starving each other.
Core
🗂️ Scheduling & OrchestrationSign in
Slurm for AI ClustersSlurm is the scheduler most large training clusters still run, because it was built for exactly this shape of work: long jobs that need many nodes at once, launched with one command, placed with knowledge of the network. A candidate for a training-infrastructure role is expected to read an sbatch script, know how GPUs are requested and enforced, and explain why a job is stuck in the queue. This page covers the model, the commands that matter, the GPU-specific configuration, and the failure modes a platform engineer meets.
UP NEXT ON YOUR JOURNEY
FEDITOR'S NOTE

Scored on naming the specific batch features Slurm has natively (gang, topology, backfill, fair share) and what Kubernetes needs installed to match them, then on giving a decision with a reversal condition rather than a preference.

DISCUSSION · 0

No comments yet — be the first to share your approach.