Cloud Technology Community Question

How to handle multi-tenant AI workloads on a single Kubernetes cluster?

Posted on 2025-02-05 • In Cloud Technology • By Steven Reynolds

Our department shares a large GPU cluster. How does Kubernetes ensure that one researcher's massive Deep Learning job doesn't starve everyone else's smaller experiments? Are ResourceQuotas enough to manage GPU allocation fairly, or is there a more advanced way to "slice" a single A100 GPU among multiple pods?

3 Answers 12,468 Views

All answers to this question 3 Answers

Betty Cooper Answered on 2025-02-07
Answered

ResourceQuotas are the first line of defense, but they are "blunt." They limit the total number of GPUs a namespace can request. For better sharing, you should look into NVIDIA Multi-Instance GPU (MIG) or "GPU Time-Slicing." MIG allows you to physically partition one high-end GPU into up to seven isolated instances. Kubernetes can then treat each slice as a separate resource. If you use Time-Slicing, multiple pods can share a GPU by taking turns on the compute cores. Combined with "PriorityClasses," you can ensure that "Production Inference" always beats "Experimental Training" if the cluster runs out of space.

Jason Myers Answered on 2025-02-09
Answered

If I use MIG, is the memory also isolated? I'm worried that if one user's pod has a memory leak or an out-of-memory (OOM) error, it might crash the other "slices" on that same physical card.

Betty Cooper Commented on 2025-02-11
Commented

Jason, that’s the beauty of MIG—it provides hardware-level isolation for both compute and memory. If a pod in one MIG partition crashes or OOMs, it has zero impact on the other partitions. It’s much safer than simple library-level sharing. However, keep in mind that you can't change the MIG profile dynamically without "draining" the node, so you have to plan your partition sizes (like 1g.5gb vs 3g.20gb) based on your team's typical model sizes.

Mark Wagner Answered on 2025-02-12
Answered

Taints and Tolerations are also key. We taint our GPU nodes so that basic web-app pods don't accidentally get scheduled there and waste expensive GPU-node "headroom."

Steven Reynolds Commented on 2025-02-14
Commented

Great point, Mark. There is nothing more frustrating than seeing a simple Nginx pod sitting on a node that could be running a $30k GPU for a training job.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.