Cloud Native & eBPF

Kueue and Coscheduling bring gang scheduling and topology-aware placement to Kubernetes for AI training

Key Takeaway

The CNCF projects Kueue and the Coscheduling plugin now enable Kubernetes to schedule distributed AI training workloads with topology-aware pod placement and all-or-nothing gang scheduling, addressing fundamental mismatches between Kubernetes's individual pod scheduling model and the interdependent, latency-sensitive requirements of multi-GPU training jobs.

Summary

Kubernetes's default scheduler places pods individually without coordinating across pods or considering physical hardware topology, which causes distributed AI training jobs to suffer from high inter-GPU communication latency and partial starts that leave GPUs allocated but idle. The CNCF blog post details how two mechanisms—topology-aware scheduling (TAS) and gang scheduling—close this gap when implemented through Kueue and the Coscheduling plugin. TAS shapes pod placement to keep workers within the same topology domain (node, rack, or block) based on bandwidth requirements, while gang scheduling ensures all pods in a distributed job start simultaneously rather than straggling. Kueue enforces these decisions at admission time by evaluating jobs against quota, priority, and preemption criteria before they reach the kube-scheduler, tracking state in a Kueue Workload object.

The post also covers validation approaches for these capabilities and notes evolving native Kubernetes scheduler improvements for AI workloads. Topology domains range from same-node NVLink/NVSwitch connections (lowest latency) through same-rack high-speed fabric to cross-rack InfiniBand (highest latency). Without topology awareness, training jobs absorb unnecessary communication overhead that infrastructure metrics mask—activity appears normal while throughput remains below hardware potential. Kueue requires pre-applied topology labels (such as topology.kubernetes.io/rack) and does not auto-discover cluster topology.

How Kueue and Coscheduling augment Kubernetes for AI training

  • Kueue admission architecture: Kueue operates above kube-scheduler as a Kubernetes-native job queuing system, controlling which jobs reach scheduling and when, with admission decisions based on quota, priority, and preemption criteria.
  • Topology-aware placement domains: Kueue groups nodes into block, rack, and host domains using administrator-applied topology labels, placing a job's pods within a single domain that satisfies its bandwidth requirements.
  • Gang scheduling via Coscheduling plugin: The Coscheduling plugin ensures all pods in a distributed training job start simultaneously, preventing partial allocations where some GPUs sit idle while waiting for straggler pods.
  • Workload object tracking: Kueue represents each job's resource requirements, admission status, and pod sets in a Kueue Workload object, with optional life cycle management including eviction and requeueing when pods fail to reach ready state.
  • Communication pattern sensitivity: Different parallelization strategies (data-parallel AllReduce vs. tensor/pipeline/expert parallelism with continuous gather/reduce/all-to-all) impose varying latency tolerances, with cross-rack penalties compounding most severely in large-scale pretraining jobs.

Why it matters

For organizations running distributed AI training on Kubernetes clusters, these capabilities address a hidden efficiency problem: infrastructure metrics show active GPUs while communication overhead silently throttles throughput. Cloud providers and cluster administrators gain a concrete path to improve GPU utilization without hardware changes, though success depends on correct topology labeling. The integration also signals Kubernetes's continued evolution toward first-class support for AI/ML workloads, reducing the need for entirely separate schedulers or manual node affinity rules for training jobs.

What to do

  • Cluster administrators must apply topology labels, such as topology.kubernetes.io/rack, to nodes to enable topology-aware placement in Kueue.
  • Implement Kueue and the Coscheduling plugin to enable gang scheduling and topology-aware pod placement for distributed AI training workloads.

Original reference: www.cncf.io →