Before you start: words you need#
| Word | Plain meaning |
|---|---|
| SM | Streaming multiprocessor: one of the 100+ compute blocks inside a GPU (4.a). |
| Context | A process’s private state on the GPU: its memory mappings and loaded code. Switching between contexts costs time. |
| Time-slicing | Processes take turns on the whole GPU, a few milliseconds each. |
| MPS | Multi-Process Service: an NVIDIA daemon that lets several processes’ kernels run on the GPU at the same time. |
| MIG | Multi-Instance GPU: hardware partitioning of one GPU into up to seven smaller, isolated GPUs. |
| Isolation | How much one tenant can slow down, crash or read the data of another. |
| OOM | Out of memory: an allocation fails because the GPU’s memory is full. |
1. What is it?#
A flagship GPU is often far bigger than one small workload needs. An embedding model, a reranker or a 1B-parameter classifier may use 10% of an H100. There are three ways to let several processes share it:
- time-slicing: take turns,
- MPS: run together, without walls,
- MIG: cut the GPU into separate smaller GPUs, with walls.
They trade efficiency against isolation. A fourth option, often the best, is to share inside one process: one inference server batching many users’ requests (12.j). The three mechanisms are for when workloads cannot live in one process.
Facts checked on 12 November 2026.
flowchart TB
subgraph TS["Time-slicing"]
direction LR
A1["Process A<br/>whole GPU"] -->|"context switch"| A2["Process B<br/>whole GPU"]
end
subgraph MPS["MPS"]
direction LR
B1["Process A"] --> SRV["MPS server<br/>one shared context"]
B2["Process B"] --> SRV
SRV --> GPU1["GPU: kernels overlap"]
end
subgraph MIG["MIG"]
direction LR
C1["Process A"] --> S1["Slice 1<br/>own SMs, own memory"]
C2["Process B"] --> S2["Slice 2<br/>own SMs, own memory"]
end
class A1,A2,B1,B2,C1,C2 compute
class SRV queue
class GPU1,S1,S2 memory2. Why does it matter?#
Small models on dedicated GPUs waste most of the money. Three services each using a third of an H100, on three H100s, cost three times what they need to. On a platform with dozens of small models (embedders, rerankers, safety classifiers, small chat models) the waste is large.
But sharing has a price. A noisy neighbour can raise your latency, take your memory or crash your process. Which mechanism you choose decides how much of that you accept, and it is often decided by who the tenants are: your own services, other internal teams, or external customers (21.f, 23.i).
3. Simple analogy#
Sharing a commercial kitchen:
- Time-slicing: each restaurant gets the whole kitchen for an hour. Simple, but only one cooks at a time, and the swap-over wastes time.
- MPS: everyone cooks at once in the same room. Efficient, but one cook’s fire sets off everyone’s alarm.
- MIG: the kitchen is rebuilt as several small locked kitchens. Nobody interferes, but a small kitchen stays small even when the one next door is empty.
4. Tiny example: three services, three ways#
An embedder, a reranker and a small LLM each run 1,000 kernels of 2 ms, and each kernel keeps 25%, 30% and 35% of the SMs busy. Together they fit in one GPU (90%).
time-sliced: 6,900 ms one at a time, plus a switch cost every slice
MPS: 2,000 ms all three overlap; nobody waits
MIG 2g+2g+3g: 2,100 ms each fits its slice, except the reranker (30% of SMs in a 2/7 = 29% slice)Now the small LLM’s traffic grows to 60% of the SMs:
MPS: 2,300 ms total demand 115%, so everyone slows a little
MIG 2g+2g+3g: 2,800 ms the LLM is stuck in its 3/7 slice while the others' idle SMs are wastedThe program is in section 6. The point: MPS adapts to changing demand; MIG does not, but MIG is the only one where the LLM’s growth cannot hurt the embedder at all.
5. Technical explanation#
Time-slicing (the default)#
Each process gets its own context. When several are active, the GPU runs one context at a time and switches every few milliseconds. While A runs, B’s kernels wait, even if A uses only 5% of the SMs.
Memory is not time-sliced. Every process’s allocations sit in the GPU’s memory together, with no per-process limit. One greedy process (for example an LLM server set to use 90% of memory) makes the others fail with OOM.
On Kubernetes, the NVIDIA device plugin can advertise one GPU as several (replicas: 4 in its
sharing config), so four pods each get “a GPU” that is really a quarter of the turns. Nothing
enforces memory. Use it for development and notebooks.
MPS#
MPS funnels several processes through one server, so their kernels can run on the GPU at the same time, filling SMs one process would leave idle.
Controls (soft limits, set per client):
CUDA_MPS_ACTIVE_THREAD_PERCENTAGE cap on the share of SMs a client may use
CUDA_MPS_PINNED_DEVICE_MEM_LIMIT cap on the device memory a client may allocate
Since Volta, each client has its own GPU address space, so one client
cannot read another's memory by accident.The cost is fault and performance isolation. A fatal GPU error in one client can be reported to, and stop, the other clients on that GPU, and there is no hardware wall stopping one client’s memory traffic from slowing the rest. MPS is for processes that trust each other, usually several of your own small services. The device plugin and the NVIDIA DRA driver (21.c) can both start an MPS daemon for you.
MIG#
On A100, H100, H200, B200, B300 and GB200/GB300 GPUs, MIG divides the GPU into up to seven instances. Each has its own SMs, its own memory, its own share of the L2 cache and memory controllers, and its own copy engines. To software, each instance looks like a separate, smaller GPU.
| GPU | Smallest slice | Example profiles | Full GPU |
|---|---|---|---|
| H100 80 GB | 1g.10gb | 1g.20gb, 2g.20gb, 3g.40gb, 4g.40gb | 7g.80gb |
| H200 141 GB | 1g.18gb | 1g.35gb, 2g.35gb, 3g.71gb, 4g.71gb | 7g.141gb |
| B200 180 GB | 1g.23gb | 1g.45gb, 2g.45gb, 3g.90gb, 4g.90gb | 7g.180gb |
| B300 288 GB | 1g.34gb | 1g.67gb, 2g.67gb, 3g.135gb, 4g.135gb | 7g.269gb |
| RTX PRO 6000 Blackwell 96 GB | 1g.24gb | 2g.48gb | 4g.96gb (up to 4 slices) |
“2g.45gb” means two of the seven compute slices and 45 GB of memory.
Isolation is real: one instance cannot use another’s memory, slow its memory accesses, or crash it. The cost is rigidity:
- sizes come from a fixed menu, and not every combination fits on one GPU,
- changing the layout needs the affected instances idle (the GPU Operator’s MIG manager drains and reconfigures a node from a label),
- an idle instance cannot lend its capacity to a busy neighbour.
The bigger memory of Blackwell slices changes what MIG is useful for. A 1g.45gb slice of a B200 holds an 8B model in BF16 with room for KV cache; a 1g.10gb slice of an H100 only holds small models.
Fractional GPUs in schedulers and DRA#
Above these hardware mechanisms, schedulers add bookkeeping:
- KAI Scheduler (21.e) lets a pod ask for
gpu-fractionorgpu-memory. It packs pods onto shared GPUs and, in its newer releases, can enforce the memory limit. Underneath it is still time-slicing or MPS. - DRA (21.c) can share one claim between pods, allocate MIG slices as devices, and, with
consumable capacity (a beta feature gate in Kubernetes 1.37; alpha
ConsumableSharesin the NVIDIA DRA driver), hand out a share of one GPU to several claims. The plan is for the DRA driver to create MIG slices on demand instead of from a fixed node layout; that is not yet officially supported. - vGPU (NVIDIA’s virtual GPU software) splits a GPU between virtual machines, mainly for virtual desktops and VM-based clouds.
Choosing#
| Time-slicing | MPS | MIG | |
|---|---|---|---|
| Kernels run at the same time | No | Yes | Yes (in separate slices) |
| Memory isolation | None | Soft limits | Hard |
| Performance isolation | None | Weak | Strong |
| Fault isolation | Separate contexts | Weak | Strong |
| Adapts to changing demand | Yes | Yes | No (fixed slices) |
| Best for | Development, notebooks | Your own small services packed together | Several tenants, guaranteed capacity |
6. Under the hood#
The simulation behind section 4: time-slicing runs one job at a time; MPS overlaps them and stretches everything when total SM demand passes 100%; MIG gives each job a fixed fraction.
// sharing.go — three small services on one GPU: take turns, run together, or split the GPU.
package main
import "fmt"
type Job struct {
Name string
Kernels int // kernels to run
KernelMs float64 // duration of each kernel on an unshared GPU
SMShare float64 // fraction of the GPU's SMs each kernel can keep busy
}
func work(j Job) float64 { return float64(j.Kernels) * j.KernelMs }
// timeSliced: one context at a time, a fixed slice each, and a cost per switch.
func timeSliced(jobs []Job, sliceMs, switchMs float64) float64 {
left := make([]float64, len(jobs))
for i, j := range jobs {
left[i] = work(j)
}
var clock float64
for active := len(jobs); active > 0; {
for i := range jobs {
if left[i] <= 0 {
continue
}
run := min(sliceMs, left[i])
clock += run + switchMs
if left[i] -= run; left[i] <= 0 {
active--
}
}
}
return clock
}
// concurrent (MPS): kernels overlap; if total SM demand exceeds the GPU, everything stretches.
func concurrent(jobs []Job) float64 {
var demand, longest float64
for _, j := range jobs {
demand += j.SMShare
longest = max(longest, work(j))
}
return longest * max(1, demand)
}
// partitioned (MIG): each job owns a fixed slice; a job needing more than its slice runs slower,
// and a slice it does not fill is wasted.
func partitioned(jobs []Job, slices []float64) float64 {
var longest float64
for i, j := range jobs {
longest = max(longest, work(j)*max(1, j.SMShare/slices[i]))
}
return longest
}
func main() {
jobs := []Job{{"embedder", 1000, 2, 0.25}, {"reranker", 1000, 2, 0.30}, {"small LLM", 1000, 2, 0.35}}
mig := []float64{2.0 / 7, 2.0 / 7, 3.0 / 7} // 2g + 2g + 3g on a 7-slice GPU
fmt.Printf("time-sliced: %5.0f ms\n", timeSliced(jobs, 2, 0.3))
fmt.Printf("MPS: %5.0f ms\n", concurrent(jobs))
fmt.Printf("MIG 2g+2g+3g: %5.0f ms\n", partitioned(jobs, mig))
jobs[2].SMShare = 0.6 // the small LLM's traffic grows
fmt.Println("after the small LLM grows to 60% of the SMs:")
fmt.Printf("MPS: %5.0f ms\n", concurrent(jobs))
fmt.Printf("MIG 2g+2g+3g: %5.0f ms\n", partitioned(jobs, mig))
}Output:
time-sliced: 6900 ms
MPS: 2000 ms
MIG 2g+2g+3g: 2100 ms
after the small LLM grows to 60% of the SMs:
MPS: 2300 ms
MIG 2g+2g+3g: 2800 msThe model is deliberately simple: it treats SM share as the only shared resource. Real kernels also compete for memory bandwidth and L2 cache, which MPS shares and MIG partitions, so under MPS a memory-heavy neighbour can slow you more than this suggests.
7. Performance implications#
- Time-slicing costs a context switch per slice and leaves SMs idle whenever the running job is small. For small kernels it is the slowest option by a wide margin.
- MPS gives the best total throughput for several small, cooperative workloads, and adapts as their demand changes. Tail latency suffers when a neighbour is busy.
- MIG gives each tenant predictable latency, because its SMs, cache and memory bandwidth are its own. Total throughput is lower when demand is uneven, because idle slices cannot be lent.
- One server with batching beats all three for many users of the same model: one batched kernel uses the GPU far better than several small ones (12.j). Multi-LoRA does the same for many fine-tunes of one base model (20.i).
8. Production implications#
- Put same-model traffic in one server first. Use these mechanisms for different models that cannot share a process.
- Time-slicing only for development. Nothing stops one pod taking all the memory.
- MPS for your own small services, with per-client memory limits set, and the knowledge that a crash can take the neighbours down.
- MIG for multi-tenant isolation or guaranteed capacity, and plan the layout per node pool: reconfiguring means draining.
- Label node pools by sharing mode (
full,mps,mig-2g.45gb) so the scheduler and the registry’s resource requirements (21.b) match them. - Monitor per-slice and per-client metrics (DCGM reports per MIG instance), not only the whole GPU.
9. Common mistakes#
- Time-slicing in production and being surprised when one pod OOMs another.
- MPS between untrusted tenants. Weak fault and performance isolation.
- MIG layouts that do not match the models. A 3g slice for a model that needs 4g is useless; a 7g slice for a 2 GB embedder is waste.
- Reconfiguring MIG on a live node without draining it first.
- Splitting a GPU for traffic that one batching server could handle.
- Counting a fractional GPU as a full GPU in capacity dashboards (21.l).
10. Hands-on exercise#
- Run
sharing.go. Raise each job’sSMShareto 0.6. What happens to MPS and MIG, and why? - Add a
MemGBfield toJoband a memory size to each MIG slice (B200: 23 GB per 1g). Show a job that fits under MPS but does not fit any slice of a 2g+2g+3g layout. - Pick a MIG layout for one B200 that serves an 8B model in BF16 (16 GB of weights plus 20 GB of KV cache), two embedders (2 GB each) and a 1.5B reranker. Check that it is a valid combination in NVIDIA’s MIG user guide.
- You run a platform for external customers who each want “a small GPU”. Which mechanism do you offer, and what do you tell them about burst capacity?
11. Interview questions#
- Why does time-slicing waste capacity for small workloads?
- What does MPS give up to gain efficiency, and when is that acceptable?
- What makes MIG isolation “hard” rather than “soft”?
- Why is one batching server usually better than any of the three for many users of one model?
- How do Kubernetes schedulers and DRA represent a fraction of a GPU in 2026?
12. Further reading#
Checked on 12 November 2026.