Why your Kubernetes scheduler can't handle AI workloads
Summary
The default Kubernetes scheduler, `kube-scheduler`, is ill-equipped for AI workloads, particularly distributed training, due to its inability to gang-schedule and its lack of multi-node fabric topology awareness. This leads to partial-scheduling deadlocks, where 4 available GPUs might be reserved by 16-worker jobs that cannot progress, and severe communication latency for large-scale distributed training. To address these issues, three specialized Kubernetes-native schedulers are presented: Kueue, KAI Scheduler, and Volcano. Kueue focuses on multi-tenant job queueing and quota management, preventing partial-allocation deadlocks. KAI Scheduler, derived from NVIDIA Run:ai, excels in AI-native scheduling for NVIDIA GPU clusters, offering gang scheduling and topology-aware placement. Volcano, a mature CNCF project, provides robust batch scheduling with gang scheduling, preemption, and deep integration with ML frameworks like PyTorch and TensorFlow. These schedulers can be deployed standalone or in combinations like Kueue + Volcano for comprehensive enterprise solutions.
Key takeaway
For MLOps Engineers or AI Architects deploying distributed training on Kubernetes, relying solely on `kube-scheduler` will lead to deadlocks and performance bottlenecks. You must evaluate specialized schedulers like Kueue, KAI Scheduler, or Volcano based on your cluster's specific needs, such as multi-tenancy, NVIDIA GPU topology, or framework integration. Choosing the right scheduler, or a combination like Kueue + Volcano, is critical to ensure efficient resource utilization and optimal distributed AI workload performance.
Key insights
The default Kubernetes scheduler fails AI workloads due to partial-scheduling and lack of fabric topology awareness, necessitating specialized schedulers.
Principles
- Gang scheduling prevents partial-allocation deadlocks in distributed jobs.
- Multi-node fabric topology awareness is crucial for distributed AI performance.
- Specialized schedulers enhance resource utilization and reduce latency for AI.
In practice
- Pair Kueue with Volcano for multi-tenant quota and pod placement.
- Use KAI Scheduler for dedicated NVIDIA GPU cluster optimization.
- Deploy Volcano standalone for mature gang scheduling and broad framework support.
Topics
- AI Workloads
- Distributed Training
- Gang Scheduling
- GPU Topology
- Kueue
- KAI Scheduler
- Volcano
Best for: CTO, VP of Engineering/Data, Director of AI/ML, MLOps Engineer, AI Architect, Machine Learning Engineer
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by The Lambda Deep Learning Blog.