[ field guide ] · updated 28 Nov 2026
GPU on Kubernetes: a field guide
Most workloads do not need a whole H100. This page collects what I have measured about sharing one between several workloads on Kubernetes, and how I would choose between the options.
Tested: July 2025, two weeks on NVIDIA H100 hardware.
[ the short answer ]
Start with HAMi unless you need hard isolation
Choose HAMi when
- Your users are internal and trusted, such as data science or research teams.
- You run long training jobs, where 6 hours against 10 matters.
- You change GPU allocations often.
- You debug GPU memory problems regularly and want errors you can act on.
Choose MIG when
- You serve external users or have compliance requirements, so hardware isolation is required.
- You prefer predictable performance to peak performance.
- You can plan allocations in advance.
- You can afford maintenance windows for reconfiguration.
The two can be combined: HAMi on training clusters, where speed matters most, and MIG for inference serving, where isolation matters most.
[ side by side ]
HAMi and MIG on the same H100
| HAMi | MIG | |
|---|---|---|
| How it shares the GPU | Software: time-slicing with per-pod memory limits | Hardware: the GPU is split into isolated instances |
| BERT-base training, time per batch | 35.3 ms (12 GB slice) | 60.0 ms (1g.12gb instance) |
| Changing an allocation | Restart the job, about 30 seconds; other workloads keep running | Drain, reconfigure and reboot the node, about 15 minutes; every workload on it moves |
| Running out of GPU memory | A CUDA out-of-memory error with usage, request size and free memory | An internal PyTorch assertion with nothing to act on |
| Five identical jobs at once | All scheduled immediately; finish within 5% of each other | No interference at all; unused capacity cannot be reclaimed |
| How a pod asks for it | nvidia.com/gpu: 1 and nvidia.com/gpumem: 12000 | nvidia.com/mig-1g.12gb: 1 |
On real BERT-base training HAMi was 1.7 times faster per batch. An overnight run that takes 10 hours on a MIG instance finishes in about 6 on a HAMi slice of the same size.
[ a warning about benchmarks ]
Synthetic tests overstate the gap
Synthetic benchmarks showed HAMi more than eight times ahead. The real training job showed 1.7 times. Measure with your own workload before you decide.
| Synthetic test | HAMi 12 GB | MIG 1g.12gb |
|---|---|---|
| Memory bandwidth, GPU internal | 1,667 GB/s | 202 GB/s |
| Matrix multiplication | 45.4 TFLOPS | 4.8 TFLOPS |
[ reference ]
MIG profiles on an H100
As reported by nvidia-smi mig -lgip. A profile name gives the compute slices and the memory, so 1g.12gb is one compute slice with a nominal 12 GB.
| Profile | Instances per GPU | Memory each |
|---|---|---|
| 1g.12gb | 7 | 10.75 GiB |
| 1g.24gb | 4 | 21.62 GiB |
| 2g.24gb | 3 | 21.62 GiB |
| 3g.47gb | 2 | 46.38 GiB |
| 4g.47gb | 1 | 46.38 GiB |
| 7g.94gb | 1 | 93.12 GiB |
[ run your own test ]
What to measure
- Training time with your own models, not synthetic benchmarks.
- What the error looks like when a job runs out of GPU memory.
- Several users submitting jobs at the same time.
- How long a configuration change takes and what it interrupts.
- How you debug a failed job with the tools you already have.
With either option, DCGM metrics stop at the node or GPU instance. Per-pod GPU utilisation needs extra monitoring.
[ not covered yet ]
Coming to this page
- Multi-node GPU scheduling strategies
- Cost optimisation for shared GPU infrastructure
- Production monitoring for GPU workloads
- Migrating between sharing technologies
[ sources ]
The full write-ups
16 Jul 2025
HAMi vs MIG: 2 Weeks of Real Testing on H100 GPUs
Real-world comparison of HAMi and MIG GPU sharing technologies. Performance benchmarks, operational complexity, and debugging experience with actual workloads on H100 hardware.
6 Jun 2025
Maximizing GPU Efficiency: Setting Up MIG on Nvidia H100 in Kubernetes
A comprehensive guide to implementing Multi-Instance GPU (MIG) on Nvidia H100 in Kubernetes. Learn how to achieve true multi-tenancy, improve resource utilization, and reduce costs.
The benchmark code is ingpu-benchmark. Results depend on your workloads and cluster, so treat these numbers as a starting point.
[ newsletter ]
Get new posts by email
GPUs, inference and cost on Kubernetes, sent when there is a new post. No spam. Prefer feeds? Use RSS.