A 16-pod pretraining job on a shared Kubernetes GPU cluster has 11 pods running and holding GPUs while 5 stay Pending; how do Kueue and Volcano each prevent this?
answer
- half a job holds GPUs idle
- quota for the whole workload
- aggregate quota is not placement
- waitForPodsReady timeout and requeue
- PodGroup minMember under schedulerName: volcano
basics
~20 sKueue admits a Workload only when quota for every pod is free, can check node placement with topology-aware scheduling, and with waitForPodsReady evicts and requeues a Workload not fully ready in time. Volcano binds none of a PodGroup's pods until minMember can be placed.
solid answer
~50 sHalf of a synchronous training job holds GPUs and makes no progress, and two such jobs can deadlock each other. Kueue works at admission: it unsuspends a Workload only when quota for all its pod sets is reserved, but aggregate quota is not placement, so Kueue 0.20 recommends topology-aware scheduling to admit only when the pods fit real nodes, with `waitForPodsReady` as the safety net: if the pods are not all ready within `timeout` (30 minutes by default), the Job is suspended and requeued with exponential backoff, and `blockAdmission: true` admits Workloads one at a time. Volcano works in the scheduler itself: pods set `schedulerName: volcano`, a `PodGroup` sets `minMember`, and Volcano binds none of them until that many can be placed. The choice is whether you keep kube-scheduler with a quota layer above it or run a batch scheduler.
code
yaml · 24 linesapiVersion: scheduling.volcano.sh/v1beta1
kind: PodGroup
metadata:
name: pretrain-run
namespace: pretrain
spec:
minMember: 16
queue: pretrain
---
apiVersion: v1
kind: Pod
metadata:
name: pretrain-run-worker-0
namespace: pretrain
annotations:
scheduling.k8s.io/group-name: pretrain-run
spec:
schedulerName: volcano
containers:
- name: trainer
image: registry.internal.example/pretrain:latest
resources:
limits:
nvidia.com/gpu: 8go deeper
Recall what gang scheduling means: all pods of a training job start together or none do, and that both Kueue and Volcano provide it.
Explain Kueue's whole-Workload quota admission and the waitForPodsReady timeout, and Volcano's PodGroup with minMember and schedulerName: volcano.
Diagnose why quota admission still half-schedules, layer topology-aware scheduling and waitForPodsReady, tune timeouts and backoff, and judge when blockAdmission's throughput cost pays.
Choose the fleet's scheduling architecture, a quota layer over kube-scheduler or a batch scheduler, by integrations, operating cost and who owns it.
## Why half a job is worse than none A synchronous multi-node training job cannot take its first step until every rank has joined (why every rank must be present is a data-parallel concept, not a scheduler one). The default kube-scheduler places pods one at a time, so a 16-pod job of 8 GPUs per pod can end up with 11 pods running, holding **88 GPUs that do nothing**, and 5 pods Pending. Worse, two such jobs can each hold part of what the other needs and **deadlock**. **All-or-nothing** (gang) scheduling means a job's pods start together or not at all. Kueue and Volcano both provide it, at different layers. ## Kueue: all-or-nothing at admission Kueue's 0.20 documentation names four complementary mechanisms, in the order to apply them: 1. **Quota admission.** A Workload is unsuspended only when quota for *all* of its pod sets can be reserved at once. 2. **Topology-aware scheduling (TAS).** Quota counts totals, while scheduling depends on node layout. With 8 GPUs free split 4 + 4 across two nodes, quota admits a pod that needs 8 on one node, and it then sits Pending at kube-scheduler. TAS (beta, on by default) tracks free capacity per node and topology domain and admits only when all the pods fit. The documentation recommends it as the default for batch and ML workloads. 3. **ProvisioningRequest** admission checks, for autoscaled clusters, which wait for capacity before unsuspending. 4. **`waitForPodsReady`**, the safety net, set in Kueue's own configuration. The `waitForPodsReady` settings: - `timeout`: **30 minutes** by default. When an admitted Workload still has `PodsReady=False` at expiry, its admission is cancelled, the Job is **suspended** and the Workload **requeued**. - `recoveryTimeout`: for a Workload that was running and lost a pod; it defaults to `timeout`, and `0s` disables it. - `blockAdmission` (default `false`): when `true`, Kueue blocks admission across **all ClusterQueues** until every previously admitted Workload is ready, which prevents two half-started jobs from deadlocking. - `requeuingStrategy`: `timestamp` (`Eviction` by default, or `Creation`), `backoffBaseSeconds` (60), `backoffMaxSeconds` (3600) and `backoffLimitCount`; unset, requeueing is endless, and reaching the limit **deactivates** the Workload. - `unscheduledTimeout`: alpha in 0.20 behind `WaitForPodsReadyUnscheduledTimeout`, to requeue sooner when pods are unscheduled rather than slow to start. Kueue's own documentation calls `waitForPodsReady` a heuristic: it does not prevent partial scheduling, it stops a partly scheduled Workload holding resources forever. ## Volcano: all-or-nothing in the scheduler - Pods set **`schedulerName: volcano`**, so Volcano rather than kube-scheduler binds them. - A **`PodGroup`** (`scheduling.volcano.sh/v1beta1`) carries **`minMember`**: the minimum number of pods that must run; if there are not enough resources to start them all, the scheduler starts none. `minResources` does the same in resource terms, and `spec.queue` names a Volcano `Queue` (`default` if unset). - A Volcano `Job` (`batch.volcano.sh/v1alpha1`) creates its PodGroup, carrying its `minAvailable` into `minMember`; other pods join a PodGroup through the annotation `scheduling.k8s.io/group-name`. - The `enqueue` action moves a PodGroup from `Pending` to `Inqueue` only when idle resources meet its minimum (the overcommit factor defaults to 1.2); `allocate` then places it. A group with only part of `minMember` running reports `Unknown`. ## Reading the symptoms - **Kueue**: the Workload's `PodsReady` condition stays `False` while pods start; a timeout shows as an `Evicted` condition with reason `PodsReadyTimeout`, `.status.requeueState.count` counts the backoff requeues, and a Workload that hit `backoffLimitCount` is deactivated rather than requeued. - **Volcano**: `kubectl get podgroup` shows the phase. `Pending` means the group was accepted but cannot yet be allocated, `Inqueue` means its minimum fits and pods may be created, `Running` means `minMember` pods run, `Unknown` means only part of them do. - **Neither**: if pods sit Pending with no PodGroup and no Workload, the job never reached the gang layer, usually because the `queue-name` label or `schedulerName` is missing. ## Side by side | | Kueue | Volcano | |---|---|---| | Layer | Admission above kube-scheduler | The scheduler that binds pods | | Unit | Workload (from a Job, JobSet, RayJob, Kubeflow job...) | PodGroup | | Guarantee | Quota for the whole Workload; with TAS, node fit at admission | No pod bound until `minMember` fit | | Late failure | `waitForPodsReady` evicts and requeues | PodGroup phase shows `Unknown` | | Queues | LocalQueue, ClusterQueue, cohorts | `Queue` with weight and capability | ## Choosing for this cluster 1. Teams already submit Jobs, JobSets or Kubeflow jobs and you want to keep kube-scheduler: Kueue, with TAS on and `waitForPodsReady` configured. 2. You want gang binding, queue weights and batch actions inside one scheduler: Volcano with PodGroups. 3. Either way, set the gang size to what the job truly needs to make progress, and set timeouts longer than a normal image pull and start-up.
- When is Kueue's blockAdmission worth its cost?When admitted quota can exceed what physically fits, for example without topology-aware scheduling, so two admitted jobs could each half-start and deadlock. `blockAdmission: true` admits one Workload at a time across all ClusterQueues until the previous one is ready, at a throughput cost. With per-workload timeouts (alpha in 0.20), `maxTimeoutOnWorkload`, 2 hours by default, bounds how long one Workload can block.
- What covers a node dying after a gang-admitted job is already running?In Kueue, `recoveryTimeout`: once a running Workload drops to `PodsReady=False`, Kueue waits that long for a replacement pod (it defaults to `timeout`; `0s` disables it), then suspends and requeues the Job. Volcano reports a PodGroup with only part of `minMember` running as `Unknown`. Restarting the processes and resuming from a checkpoint belongs to the job's launcher.
- Kueue's quota check guarantees every admitted pod will find a node.
- Volcano starts the pods it can place and waits for the rest.
- waitForPodsReady stops partial scheduling from ever happening.
- On a waitForPodsReady timeout only the Pending pods are restarted.
- Gang scheduling needs Volcano because Kueue has no all-or-nothing mechanism.
Assumes Kueue 0.20 (waitForPodsReady defaults; unscheduledTimeout alpha in 0.20) and Volcano 1.15 with the scheduling.volcano.sh/v1beta1 PodGroup.