On a Kubernetes GPU cluster wired in racks and blocks, how do Kueue topology-aware scheduling and Volcano network-topology scheduling keep a multi-node training job's pods close together?
answer
- the scheduler picks the switches
- node-label levels in a Topology
- topologyName on a ResourceFlavor
- podset-required versus podset-preferred
- HyperNode tiers, hard mode, highestTierAllowed
basics
~20 sKueue reads a Topology of node-label levels through a ResourceFlavor and, given podset-required-topology or podset-preferred-topology on the pod template, admits a job only where its pods fit one rack or block. Volcano models switches as HyperNode tiers and honours a job's networkTopology.
solid answer
~50 sPods in one rack or block get more bandwidth than pods spread across the fabric, so the scheduler should pack a training job. Kueue's topology-aware scheduling (beta, on by default since 0.14) needs a `Topology` that lists node-label levels from widest to narrowest and a ResourceFlavor that references it with `topologyName`. A job then sets one annotation on its pod template: `kueue.x-k8s.io/podset-required-topology` keeps it queued until one domain at that level holds all its pods, and `podset-preferred-topology` tries that level, then wider ones, and finally admits it spread out. Kueue gates the pods and injects node selectors for the domains it chose. Volcano describes the fabric as `HyperNode` objects in tiers, a smaller tier meaning a faster domain, and a job's `networkTopology` sets `mode: hard` with `highestTierAllowed`, or `soft` for best effort, once the `network-topology-aware` plugin is enabled.
code
yaml · 23 linesapiVersion: kueue.x-k8s.io/v1beta2
kind: Topology
metadata:
name: gpu-fabric
spec:
levels:
- nodeLabel: topology.internal.example/block
- nodeLabel: topology.internal.example/rack
- nodeLabel: kubernetes.io/hostname
---
apiVersion: kueue.x-k8s.io/v1beta2
kind: ResourceFlavor
metadata:
name: h100-80gb
spec:
nodeLabels:
nvidia.com/gpu.product: NVIDIA-H100-80GB-HBM3
topologyName: gpu-fabric
---
# on the training Job's pod template
metadata:
annotations:
kueue.x-k8s.io/podset-required-topology: topology.internal.example/rackgo deeper
Recall that racks and switches matter for multi-node training, and that Kueue and Volcano can both be told to keep a job's pods inside one domain.
Explain the Topology levels, topologyName on a ResourceFlavor, the required, preferred and unconstrained annotations, and Volcano's HyperNode tiers with hard and soft modes.
Pick the level per job from its node count and the domain sizes, avoid required levels no domain can satisfy, and plan for node loss inside a pinned assignment.
Decide where topology data comes from, labels or discovered HyperNodes, and how strict placement trades queueing delay against step time across the fleet.
## Why placement is a scheduling question On the shared cluster, the 32 nodes sit in **racks** of 4 nodes (32 GPUs behind one leaf switch) and **blocks** of 4 racks (16 nodes). Pods inside one rack talk through fewer switches, with more bandwidth and less latency, than pods spread across blocks. How the communication library then builds its rings over that fabric is the library's own business; *which nodes the job gets* is decided at scheduling time, and that is where Kueue and Volcano act. ## Kueue topology-aware scheduling (TAS) - **Status**: beta since Kueue 0.14, `TopologyAwareScheduling` feature gate on by default. - **Admin side**: a `Topology` object lists `levels`, each a `nodeLabel`, from the widest domain to the narrowest; a `ResourceFlavor` references it with `spec.topologyName` and must also set at least one `nodeLabels` entry (and `topologyName` cannot be changed once set). - **Capacity**: for each domain Kueue counts the allocatable resources of ready, schedulable nodes, minus other TAS workloads and non-TAS pods such as DaemonSets. - **User side**: exactly one annotation on the **pod template** (not the Job's own metadata): | Annotation | Behaviour | |---|---| | `kueue.x-k8s.io/podset-required-topology: <level label>` | All pods in one domain at that level; otherwise the Workload waits | | `kueue.x-k8s.io/podset-preferred-topology: <level label>` | Try that level, then each wider level; if nothing fits, admit spread across domains | | `kueue.x-k8s.io/podset-unconstrained-topology` | Any nodes, still using TAS bookkeeping to fill gaps | - **Several pod sets, one domain**: the `kueue.x-k8s.io/podset-group-name` annotation puts pod sets that share a name, such as a launcher and its workers, into one group that is fitted into the same topology domain. - **Fragmentation**: because TAS knows each domain's free capacity, a small unconstrained job can be packed into a partly used rack instead of breaking up an empty one that a large required job is waiting for. - **After admission**, the chosen domains appear in the Workload's `status.admission.podSetAssignments[].topologyAssignment`. Pods are created with the `kueue.x-k8s.io/topology` scheduling gate; Kueue injects a node selector for the assigned domains and removes the gate. ## Volcano network-topology-aware scheduling - A **`HyperNode`** (`topology.volcano.sh/v1alpha1`) is a performance domain, typically a switch, whose members are nodes or other HyperNodes; its **tier** ranks it, and the **smaller the tier, the higher the bandwidth**. HyperNodes are created by hand or kept current by HyperNode auto-discovery from sources such as UFM, RoCE or node labels. - A Volcano Job, or its PodGroup, carries **`networkTopology`**: `mode: hard` (the API default) keeps the job inside one HyperNode no higher than `highestTierAllowed` (or `highestTierName`) and leaves it Pending otherwise; `mode: soft` packs as tightly as it can without a hard limit. - `subGroupPolicy` (on the PodGroup) gives sub-groups of a large job their own topology constraint, for instance one partition per tier-1 HyperNode. - The `network-topology-aware` plugin must be enabled in the Volcano scheduler's configuration. ## Side by side | | Kueue TAS | Volcano | |---|---|---| | Topology source | Node labels listed in a `Topology` | `HyperNode` objects, manual or discovered | | Where it is set | `topologyName` on a ResourceFlavor; pod template annotation | `networkTopology` on the Job or PodGroup | | Strict | `podset-required-topology` | `mode: hard` with `highestTierAllowed` | | Best effort | `podset-preferred-topology` | `mode: soft` | | Acts at | Admission: assigns domains, injects node selectors | Scheduling: binds pods into the domain | ## What a refusal looks like With a required level that no domain can currently meet, Kueue leaves the Workload pending and says why in its status, in messages of the shape `couldn't assign flavors to pod set main: topology "default" allows to fit only 4 out of 10 pod(s)`. That message is the point of the feature: the job waits in the queue, holding nothing, instead of four pods holding GPUs while the other six wait for room. Volcano's equivalent is a `hard` job that stays `Pending` until a HyperNode at or below its allowed tier has room for it. ## Choosing the level per job 1. A 4-node fine-tuning job (32 GPUs) fits one rack: **required at the rack level**. 2. The 16-node pretraining job (128 GPUs) cannot fit a 4-node rack but fits one block: **required at the block level**, or preferred at the rack level, which climbs to a block and spreads only if no block is free. 3. A job that can make progress spread out, and should not wait: **preferred**. 4. Never require a level no domain can satisfy: a 20-node job required at the block level (16 nodes) is never admitted, because no block is that big.
- What happens when a node inside a Kueue-assigned topology domain fails mid-run?When the Topology's lowest level is the node, Kueue pins pods with node selectors, so a lost node would strand the Workload. Kueue's node hot swap (the `TASFailedNodeReplacement` feature gate) looks for a replacement node without changing the rest of the assignment. Restarting the training processes and resuming from a checkpoint stays with the job's launcher.
- Where does Volcano's HyperNode tree come from?Admins create `HyperNode` objects by hand, or enable HyperNode auto-discovery, which creates and updates them from sources such as UFM, RoCE or node labels. Each HyperNode lists member nodes or child HyperNodes and a tier, and the `network-topology-aware` plugin must be enabled in the scheduler configuration for jobs' `networkTopology` to take effect.
- Kueue topology-aware scheduling works from node labels alone, with no Topology or flavor.
- podset-preferred-topology keeps a job queued until one domain fits it.
- In Volcano, a higher HyperNode tier means a faster network domain.
- Requiring a block-level domain is safe whatever the job's size.
- Pod topologySpreadConstraints pack a training job's pods into one rack.
Assumes Kueue 0.20 (TAS beta and on by default since 0.14, kueue.x-k8s.io/v1beta2 Topology) and Volcano 1.15 HyperNodes and networkTopology.