When Kubeflow meets Cilium: Debugging 60% idle GPUs in Kubernetes
Summary
The article describes a problem where distributed training jobs on Kubernetes with Kubeflow and Cilium result in idle GPUs, despite all pods appearing healthy. This issue, observed by Ramkumar Nagaraj and Bingi Narasimha Karthik from Adobe, stems from a conflict between Kubernetes' topology-agnostic scheduling and Cilium's topology-aware network policies. Kubernetes places pods based on resource availability, while CiliumNetworkPolicy enforces zone boundaries for security or cost control. This can lead to training coordinators landing in one zone and GPU workers in another, with network policies silently blocking communication. This problem manifests as a hard block (training never starts), cross-zone latency (30-60% throughput drop), or cross-AZ egress costs. The fix involves adding Kubernetes-native YAML to the workload spec, specifically "nodeAffinity", "topologySpreadConstraints", and "toleration", to co-locate all communicating pods within a single network-open zone. This approach increased GPU utilization from 40% to 85% in lab tests.
Key takeaway
For MLOps Engineers deploying distributed ML training on Kubernetes, you must explicitly account for network topology in your workload specifications. If you rely solely on default Kubernetes scheduling, your GPU clusters risk silent performance degradation or complete job stalls due to topology-aware CNI policies like Cilium. Implement "nodeAffinity" and "topologySpreadConstraints" in your YAML to ensure co-location of communicating pods, preventing wasted GPU cycles and unexpected cross-zone egress costs. Proactively instrument GPU utilization and pod-zone metrics to detect these issues quickly.
Key insights
The core problem is a silent conflict between topology-agnostic schedulers and topology-aware network policies in distributed systems.
Principles
- Topology-aware CNIs can silently conflict with topology-agnostic schedulers.
- Individually correct system decisions can lead to collective failure.
- Silent network policies can cause idle resources or performance degradation.
Method
Apply Kubernetes-native YAML with "nodeAffinity", "topologySpreadConstraints", and "toleration" to co-locate distributed training pods within a single network zone.
In practice
- Use "nodeAffinity" to pin workloads to specific zones.
- Apply "topologySpreadConstraints" for pod co-location.
- Monitor GPU utilization and pod-zone metrics.
Topics
- Kubernetes Scheduling
- Kubeflow
- Cilium Network Policy
- Distributed ML Training
- GPU Optimization
- Topology Spread Constraints
Code references
Best for: MLOps Engineer, Machine Learning Engineer, AI Architect
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 Cloud Native Computing Foundation.