MLOpsModel Deployment & CI/CD Automation

How do you share GPUs across production ML inference tenants while enforcing memory isolation, predictable latency, and fair resource allocation?

Question 148 of 164 · Updated

On this page

GPU sharing lets multiple production inference workloads use one physical accelerator instead of reserving an entire GPU for every small or lightly loaded endpoint. The challenge is not merely making two containers see the same device. It is deciding which resources are shared, which are isolated, how contention is controlled, and how the platform proves that one tenant cannot unexpectedly damage another tenant's latency or availability.

A production design chooses among exclusive GPU assignment, hardware partitioning such as NVIDIA Multi-Instance GPU (MIG), software time-slicing, and concurrent sharing mechanisms such as NVIDIA Multi-Process Service (MPS). It combines that choice with Kubernetes scheduling, explicit memory budgets, tenant quotas, admission control, workload classes, autoscaling, and per-tenant observability.

  • MIG partitions supported GPUs into hardware-isolated GPU instances with dedicated portions of compute and memory-system resources. It is the strongest of these mechanisms when predictable isolation and QoS matter.
  • Time-slicing lets multiple workloads take turns using a GPU. It can improve utilization for bursty or idle-heavy workloads, but does not provide memory or fault isolation and does not guarantee proportional compute.
  • MPS allows CUDA processes to execute concurrently and can impose some compute limits, but clients still share important resources; it is not equivalent to MIG hardware isolation.
  • Exclusive assignment provides the simplest resource ownership model, but can leave substantial capacity unused.

The right policy depends on tenant trust, model memory footprint, latency SLO, workload burstiness, GPU generation, and the cost of a noisy neighbor.

Curriculum boundary: Q38 discusses CPU/GPU/accelerator scheduling generally. Q126 covers inference autoscaling and capacity planning. Q127 covers admission control and backpressure. Q134 covers endpoint, artifact, and multi-tenant security. Q139 covers model loading, warmup, and GPU memory during deployments. Q140 covers dynamic batching, deadline-aware scheduling, and fair concurrency. This question focuses specifically on physical GPU sharing and isolation between separately scheduled inference workloads: MIG, time-slicing, MPS, enforceable memory boundaries, Kubernetes allocation, noisy-neighbor control, and tenant-level QoS validation.

1. Why GPU sharing becomes an MLOps problem#

Imagine a platform hosting four inference services:

  • Tenant A serves a small image classifier with a 2 GB model.
  • Tenant B serves an embedding model with a 5 GB model.
  • Tenant C serves a low-traffic document classifier with a 1 GB model.
  • Tenant D runs a development endpoint that receives occasional test requests.

Each endpoint requests a full 80 GB GPU, but load tests show that their combined working sets and compute demand are much smaller. Four separate GPUs may be provisioned even though the combined workload could fit on one physical GPU.

That wastes money. However, placing all four containers on one GPU without isolation creates other problems:

  • Tenant A's traffic burst increases compute contention.
  • Tenant B allocates memory while Tenant C is loading a model.
  • Tenant D runs a large diagnostic batch and causes latency spikes for A.
  • One process leaks GPU memory or crashes a CUDA context.
  • The platform sees high aggregate utilization but cannot identify which tenant caused the pressure.

A shared GPU is therefore a multi-tenant resource pool. It needs allocation, accounting, fairness, isolation, and operational controls just like shared CPU, memory, storage, or network capacity.

2. Separate the resource dimensions#

Do not treat a GPU as one scalar resource called an NVIDIA GPU device. Different workloads contend for different resources.

  • Device memory capacity: model weights, activations, KV cache, temporary workspaces, CUDA context, and fragmentation.
  • Compute capacity: streaming multiprocessors and kernel execution time.
  • Memory bandwidth and cache: data movement can become the bottleneck even when compute utilization looks moderate.
  • Copy and video engines: input transfers, decoding, and other hardware engines can be shared or partitioned differently.
  • Host-side resources: CPU preprocessing, pinned memory, PCIe bandwidth, network input, and data-loader threads.
  • Queueing and scheduling: time waiting for the device can dominate end-to-end latency.
  • Failure domain: whether one tenant's process, memory exhaustion, or device reset can affect other tenants.

A request that consumes only 10% of GPU compute can still allocate most of device memory. Another workload can use little memory but saturate memory bandwidth. A fair scheduler must account for the resource that is actually scarce.

Use measured per-model profiles rather than model parameter count. Benchmark peak memory, steady-state memory, compute demand, batch sensitivity, and tail latency under representative inputs.

3. Understand the four main sharing choices#

Exclusive GPU assignment#

One workload or trusted serving pool receives the entire physical GPU.

Advantages:

  • Straightforward ownership and debugging.
  • Strong operational separation when devices and node access are also isolated.
  • Full device memory and compute capacity are available.
  • Easier performance characterization.

Disadvantages:

  • Low utilization when the service is bursty or small.
  • More expensive for many small endpoints.
  • Scaling replicas can require many complete devices.
  • Idle reservations can block other tenants.

Use exclusive assignment for large models, strict performance guarantees, untrusted workloads, or workloads that need the whole device.

NVIDIA Multi-Instance GPU (MIG)#

On supported GPU architectures, MIG divides one physical GPU into multiple GPU instances. Each instance receives a defined portion of GPU compute and memory-system resources. NVIDIA describes isolation across memory paths including cache banks, memory controllers, and DRAM bandwidth, enabling more predictable performance when other instances are busy. <Cite refs={["turn429337search0","turn429337search7"]}/>

Advantages:

  • Hardware-backed separation between GPU instances.
  • Dedicated memory capacity and memory-bandwidth resources per instance.
  • More predictable latency and throughput than unconstrained sharing.
  • Fault isolation between GPU instances.
  • Container and Kubernetes support on supported configurations.

Disadvantages:

  • Only supported GPU models and profiles are available.
  • Instance sizes are discrete; a workload may not fit the next smaller profile.
  • Partition geometry can constrain placement and create stranded capacity.
  • Reconfiguration requires operational coordination and may disrupt workloads.
  • Some cross-instance communication and profiling capabilities are limited.

MIG is a strong default for mutually untrusted or SLO-sensitive tenants when hardware and model footprint fit available profiles. Confirm exact GPU generation, driver, firmware, profile, and orchestration support before designing around it.

GPU time-slicing#

Time-slicing advertises multiple schedulable replicas for a physical GPU. Kubernetes can place several pods on that GPU, and the GPU scheduler interleaves their work. NVIDIA's GPU Operator documentation notes that unlike MIG, time-slicing does not provide memory or fault isolation between replicas. A request for multiple time-sliced replicas also does not guarantee proportional compute. <Cite refs={["turn429337search10","turn429337search13"]}/>

Advantages:

  • Simple to enable through the device plugin or supported driver configuration.
  • Works on a wider range of GPUs than MIG.
  • Useful when workloads are idle much of the time.
  • Can increase utilization without changing application code.

Disadvantages:

  • Workloads share device memory.
  • A tenant can allocate memory needed by another tenant.
  • Compute is best-effort, not a guaranteed fraction.
  • A noisy neighbor can increase p95 and p99 latency.
  • Device-level telemetry may not be attributable to each container in all configurations.

Use time-slicing for trusted, low-risk, bursty workloads where occasional contention is acceptable. Do not advertise it as hard tenant isolation or a guaranteed GPU fraction.

NVIDIA Multi-Process Service (MPS)#

MPS allows multiple CUDA processes to share a GPU with concurrent execution. It can improve utilization when kernels from separate processes can overlap. Compute-active-thread limits can constrain some compute usage, but MPS clients still share important GPU resources and do not receive MIG-equivalent memory-bandwidth or error isolation. NVIDIA's MIG concepts documentation compares these concurrency mechanisms and their isolation properties. <Cite refs={["turn429337search7"]}/>

Advantages:

  • Concurrent execution rather than only time-interleaved work.
  • Useful for workloads that leave compute units idle between kernels.
  • Can improve utilization for compatible process patterns.
  • Can be combined with some MIG configurations, subject to supported limits.

Disadvantages:

  • Does not create independent hardware memory partitions between clients.
  • Shared caches, memory bandwidth, and device memory remain contention points.
  • Error isolation is weaker than MIG.
  • Requires compatible CUDA/runtime and process-management configuration.
  • A configured compute percentage is not an end-to-end latency guarantee.

Use MPS when concurrent execution improves throughput and the trust and isolation requirements permit shared device resources. Validate behavior under memory pressure and fault injection.

4. Select a sharing mode from workload requirements#

A practical selection sequence:

  1. Is the tenant untrusted or contractually entitled to resource isolation?
  2. Does it require a strict p99 latency SLO?
  3. Can its model and peak working set fit into an available MIG profile?
  4. Does it need more memory or compute than a single MIG profile can provide?
  5. Is the workload bursty and idle for long periods?
  6. Can the service tolerate best-effort compute and shared memory?
  7. Does it need cross-process GPU communication or a feature unsupported by the selected partition mode?
  8. Can the scheduler attribute usage and enforce quotas at the chosen granularity?

A useful policy:

  • Strict isolation and supported profile: prefer MIG or exclusive assignment.
  • Trusted, small, bursty endpoints: consider time-slicing after contention tests.
  • Compatible concurrent CUDA processes with accepted shared-resource risk: consider MPS.
  • Large models or tightly coupled multi-GPU jobs: use exclusive or explicitly designed multi-GPU allocation.

Do not choose the mechanism solely from average GPU utilization. A 25% average can hide a 100% burst during another tenant's critical request window.

5. Numerical example: calculate whether a shared GPU is safe#

Suppose a supported accelerator has 80 GB of device memory. Four inference services have measured peak working sets:

  • Service A: 14 GB.
  • Service B: 18 GB.
  • Service C: 9 GB.
  • Service D: 7 GB.

The total model-serving working set is 48 GB. Add a 20% allowance for runtime, context, and workspace variation:

48 × 1.20 = 57.6 GB.

Reserve a further 8 GB for platform overhead and safety headroom. The planning requirement becomes 65.6 GB. Raw 80 GB capacity appears sufficient.

But this arithmetic does not prove that all four workloads fit in a single MIG layout. MIG profiles are discrete, and memory and compute slices must be allocated in supported combinations. A set of partitions may leave 14 GB free in aggregate but still be unable to create the exact profile needed by a model. Check actual profile geometry and placement rather than treating GPU memory as freely divisible. <Cite refs={["turn429337search7","turn429337search12"]}/>

Now consider a time-sliced GPU. All four workloads can see the same physical memory pool. If Service B unexpectedly allocates another 24 GB for a large batch, the other services can encounter allocation failures even though their own application-level budgets were respected. Time-slicing alone does not enforce per-tenant memory budgets.

The platform must either use hardware partitioning, enforce a real memory boundary supported by its driver/runtime stack, or keep workloads on separate devices. A Kubernetes resource request is not automatically a CUDA memory limit.

6. Design a tenant-aware GPU resource contract#

A tenant resource contract should state what is guaranteed and what is best effort.

For each workload define:

  • GPU type and compatible device pool.
  • Sharing mode: exclusive, MIG, time-sliced, or MPS.
  • Memory capacity or enforceable memory limit.
  • Compute allocation or best-effort class.
  • Maximum concurrent requests and batch size.
  • Queue budget and deadline/SLO class.
  • Maximum model count and model-loading behavior.
  • Permitted co-tenancy class.
  • Priority and preemption policy.
  • Usage and cost attribution.
  • Failure behavior when the requested profile is unavailable.

Example:

  • Premium tenant: one MIG profile with a 20 GB memory allocation and dedicated partition resources; p99 target measured under a documented load envelope.
  • Standard tenant: shared time-sliced pool, bounded request concurrency, best-effort compute, and no hard latency guarantee.
  • Development tenant: low-priority shared pool with strict queue and time limits.

Do not promise a fixed percentage of GPU performance merely because a pod requests a fractional resource. The underlying sharing mechanism must enforce the promised property.

7. Kubernetes allocation and scheduling#

Kubernetes schedules extended resources exposed by a device plugin or supported Dynamic Resource Allocation (DRA) driver. The scheduler sees the resources advertised by the driver; it does not automatically understand every application's real memory footprint or latency needs.

A robust platform separates:

  • GPU node pools by hardware generation and capability.
  • MIG-enabled nodes with approved profile layouts.
  • Time-sliced pools for best-effort workloads.
  • Exclusive pools for large or sensitive workloads.
  • Namespaces and service accounts by tenant or trust boundary.
  • ResourceQuota and admission policies for GPU consumption.
  • Node labels and affinity rules for compatible hardware and partition profiles.
  • Taints and tolerations for dedicated pools.
  • Priority classes for workload importance.

For a MIG workload, schedule the actual advertised MIG resource type or DRA claim, not an abstract GPU fraction that the driver does not enforce. For time-sliced workloads, understand that the device plugin may advertise multiple replicas of one device; these replicas are schedulable slots, not independent physical GPUs.

Avoid a scheduler configuration that lets a low-priority tenant occupy all compatible MIG profiles, leaving no place for a latency-critical service. Use reservations, quotas, priority, and admission control together.

8. Prevent noisy-neighbor effects#

Noisy neighbors are not limited to GPU compute saturation.

Common sources:

  • A large batch temporarily consumes memory needed by other models.
  • A tenant launches multiple replicas and saturates compute.
  • A model repeatedly allocates and frees large buffers, increasing fragmentation.
  • A long-running kernel delays latency-sensitive kernels.
  • CPU preprocessing or host-to-device transfers saturate the PCIe path.
  • A model load or warmup overlaps with peak production traffic.
  • One tenant's memory leak causes device-wide allocation failures.
  • A burst of small requests creates many concurrent kernels and queue contention.

Controls:

  • Separate strict-SLO tenants into MIG or exclusive pools.
  • Set per-tenant request concurrency and maximum batch sizes.
  • Enforce memory budgets where the runtime provides a genuine enforcement boundary.
  • Use admission control before GPU work is submitted.
  • Reserve capacity for high-priority requests.
  • Keep model loading and maintenance in controlled windows.
  • Apply queue limits and deadlines; reject excess work early rather than allowing unbounded waiting.
  • Use separate node pools for incompatible trust or runtime requirements.
  • Test worst-case co-tenant combinations, not only isolated benchmarks.

A CPU-side semaphore limits submitted requests, but does not necessarily constrain the GPU memory a process can allocate. Use the correct control at the correct layer.

9. Fairness: requests, compute, memory, and business priority#

Equal request counts do not imply equal resource consumption. A 2 ms classifier request and a 500 ms generative request should not necessarily receive the same quota unit.

Possible fairness units:

  • Active inference concurrency.
  • Estimated GPU milliseconds.
  • Token count or generated tokens for LLM inference.
  • Memory reservation.
  • Batch slots or weighted request cost.
  • A service-class budget derived from measured compute demand.

A weighted fair scheduler can assign tenant weights. For example, Tenant A has weight 2 and Tenant B weight 1. When both are continuously backlogged and the platform can enforce the chosen scheduling unit, A may receive roughly two-thirds of the share and B one-third. This is a policy target, not a guarantee delivered by GPU time-slicing alone.

Use per-tenant queues and bounded dispatch. Prevent a tenant with many replicas from gaining more share merely by creating more pods. Apply quotas at tenant or service identity level, not only per pod.

For latency-critical services, fairness may be subordinate to deadlines and priority. Define what happens when premium traffic consumes reserved capacity and ensure lower-priority work cannot starve indefinitely.

10. Memory planning and model placement#

Model weights are only part of inference memory. Account for:

  • Weights and quantization metadata.
  • Activations and temporary workspaces.
  • CUDA context and runtime allocations.
  • Input/output buffers.
  • Batch-size-dependent memory.
  • KV cache for autoregressive models.
  • Framework allocator pools and fragmentation.
  • Model-loading peaks when old and new versions overlap.
  • Safety margin for variable input sizes.

For an LLM, memory demand changes with context length, batch size, and KV-cache policy. For computer vision, image resolution and batch size change activation memory. For smaller classifiers, host memory and preprocessing may dominate instead.

Use workload-specific admission checks. Reject a request before execution if its estimated memory/compute demand exceeds the tenant's budget or the partition's safe envelope. Do not depend on an eventual CUDA out-of-memory exception as normal admission control.

11. Capacity planning and packing#

Packing more services onto a GPU increases utilization but also increases the chance of correlated contention.

A useful capacity process:

  1. Benchmark each model alone across representative batch sizes and input shapes.
  2. Record peak memory, steady-state memory, throughput, p50/p95/p99, and GPU engine utilization.
  3. Benchmark representative pairs and groups of co-tenants.
  4. Test cold model load and warmup separately from steady-state serving.
  5. Select a partition or sharing mode using the worst relevant interference result.
  6. Reserve headroom for bursts, deployments, and unexpected input distributions.
  7. Re-evaluate after driver, CUDA, framework, model, or hardware changes.

Example: a model sustains 120 RPS alone at p99 40 ms. When co-located with another compute-heavy model, it sustains 75 RPS at p99 110 ms. Average utilization may improve, but the original 50 ms SLO is violated. Isolate the pair or reduce admitted load; do not declare the GPU more efficient solely because total RPS increased.

Use bin-packing only after compatibility and isolation constraints are applied. A placement optimizer should consider GPU profile geometry, memory, compute demand, tenant trust, failure domain, and service SLO.

12. Monitoring and per-tenant observability#

Aggregate GPU utilization is insufficient in a multi-tenant platform. Operators need to know which workload caused pressure and whether the isolation promise is being met.

Track:

  • Physical GPU utilization, memory usage, temperature, power, and error state.
  • MIG instance utilization and memory where supported.
  • Per-process or per-container usage when the sharing mode and telemetry stack support attribution.
  • GPU queue wait and request execution time.
  • Per-tenant p50, p95, and p99 latency.
  • Per-tenant throughput, concurrency, batch size, and rejection rate.
  • CUDA out-of-memory and allocation-failure counts.
  • Model load/warmup duration and memory peaks.
  • GPU reset, Xid, ECC, and device health events where applicable.
  • CPU preprocessing, host memory, PCIe transfer, and network bottlenecks.
  • Quota usage, reserved capacity, and stranded partition capacity.
  • Cost per 1,000 predictions and per tenant.

Be careful with telemetry limitations. NVIDIA's EKS time-slicing guidance notes that DCGM cannot attribute metrics to individual containers in that configuration. If attribution is unavailable, do not fabricate per-tenant GPU utilization from aggregate metrics; combine application-level timings, process metrics where available, and controlled profiling. <Cite refs={["turn429337search14"]}/>

Alert on p99 regressions correlated with co-tenant activity, memory headroom exhaustion, repeated allocation failures, GPU health events, queue growth, and persistent quota imbalance.

13. Failure scenarios and debugging#

Scenario A: One tenant causes CUDA out-of-memory errors for other services

  • Identify the sharing mode and verify whether memory isolation is actually provided.
  • Inspect process memory and allocation peaks, not just pod resource requests.
  • Check model-loading overlap, batch spikes, and framework allocator behavior.
  • Move strict-SLO tenants to MIG or exclusive devices, or apply a supported enforced memory boundary.
  • Add a co-tenant memory-pressure test to release validation.

Scenario B: p99 latency rises only when another tenant is active

  • Compare isolated and co-located benchmarks.
  • Inspect compute, memory bandwidth, queue wait, host-to-device transfers, and batch sizes.
  • Determine whether the sharing mode provides QoS or only best-effort access.
  • Reduce co-location, cap concurrency, change partition profile, or move the workload to a dedicated pool.

Scenario C: Kubernetes says GPU capacity is available but the model cannot start

  • Check advertised device resources and actual MIG profile geometry.
  • Verify node labels, device plugin health, driver/runtime compatibility, and device claims.
  • Confirm that the requested profile exists and has enough memory.
  • Inspect whether another workload has consumed a compatible profile even though aggregate GPU memory remains free.

Scenario D: GPU utilization is low but requests are slow

  • Inspect queue wait, CPU preprocessing, feature retrieval, network transfer, and synchronization.
  • Check whether the workload is waiting behind another process or using undersized batches.
  • Profile the model with representative inputs.
  • Do not solve every latency problem by adding another GPU.

Scenario E: A GPU reset or driver fault disrupts several tenants

  • Identify which workloads share the physical failure domain.
  • Drain the affected node and stop new scheduling.
  • Recreate or validate MIG profiles as required by hardware and driver.
  • Reschedule according to tenant priority and recovery policy.
  • Review whether high-trust or high-SLO tenants need separate physical devices.

Scenario F: A tenant bypasses its memory budget

  • Determine whether the budget was only a Kubernetes request, an application convention, or an enforced device/runtime limit.
  • Review container permissions, device access, and runtime configuration.
  • Enforce the boundary using a supported isolation mechanism or separate hardware.
  • Add a negative test that attempts to exceed the declared budget.

Scenario G: A partition change leaves capacity stranded

  • Inspect available MIG profiles and actual workload size distribution.
  • Compare requested profiles with current partition geometry.
  • Rebalance only through a controlled maintenance process; do not reset a production GPU without a drain and recovery plan.
  • Use workload pools with a small number of standard profiles where possible.

14. Production trade-offs#

  • MIG vs time-slicing: MIG offers stronger hardware isolation and more predictable QoS, but profile sizes are discrete and may leave stranded capacity. Time-slicing is easier to adopt but is best effort and shares memory.
  • MIG vs exclusive GPUs: MIG can improve packing and tenant density, while exclusive devices simplify performance and fault-domain reasoning. Large models may not fit useful MIG profiles.
  • MPS vs time-slicing: MPS can allow concurrent execution and improve throughput for compatible processes; time-slicing is simpler but interleaves execution. Neither should be mistaken for MIG-equivalent memory and fault isolation.
  • Utilization vs latency: Higher packing density can increase throughput per dollar while worsening tail latency. Optimize against SLO-qualified throughput, not utilization alone.
  • Fairness vs priority: Equal sharing can protect small tenants but may harm urgent requests. Priority can protect critical services but starve lower tiers without minimum guarantees.
  • Static partitions vs dynamic reconfiguration: Static layouts are operationally predictable; dynamic changes can improve utilization but require drains, profile recreation, and disruption planning.
  • Isolation vs cost: Dedicated hardware costs more, but may be required by tenant trust, compliance, or strict latency commitments.
  • Memory enforcement vs compatibility: Newer driver/runtime features can improve sharing controls, but platform support and observability may lag. Verify exact version compatibility before production adoption.

15. Common mistakes#

  • Assuming Kubernetes GPU requests enforce device-memory limits.
  • Calling time-sliced replicas independent GPUs.
  • Promising proportional compute from a time-slice count.
  • Treating MPS compute limits as complete memory and fault isolation.
  • Selecting MIG profiles using aggregate free memory instead of supported profile geometry.
  • Packing workloads based on average utilization and ignoring bursts or p99.
  • Ignoring CUDA context, workspace, KV cache, and model-loading peaks.
  • Measuring only GPU utilization while ignoring queue wait and host bottlenecks.
  • Allowing a tenant to increase its share by creating more replicas.
  • Mixing untrusted and strict-SLO tenants in a best-effort sharing pool.
  • Assuming all GPU metrics can be attributed to containers under every sharing mode.
  • Reconfiguring MIG on a live node without a drain, maintenance, and recovery procedure.

16. CI/CD, load tests, and platform validation#

GPU sharing policy must be tested as part of platform and model releases.

Hardware and compatibility gates

  • Verify GPU model, architecture, driver, CUDA runtime, device plugin, and framework compatibility.
  • Validate the requested MIG profile or sharing mode exists on the target node.
  • Confirm the model fits the assigned memory envelope with documented headroom.
  • Verify startup, model load, warmup, and health probes on the actual partition type.
  • Test node reboot and device-plugin restart behavior, including MIG profile recreation where required.

Isolation tests

  • Run a tenant at its maximum permitted memory and concurrency.
  • Run a second tenant with a deliberately heavy memory workload.
  • Confirm the first tenant's memory boundary and latency objective remain within the declared guarantee.
  • For time-slicing, explicitly test and document the absence of hard memory and compute isolation.
  • Test process crash, CUDA allocation failure, and supported device error scenarios.
  • Verify tenant identity cannot request a higher-tier GPU pool through untrusted pod labels or request fields.

Performance and fairness tests

  • Measure isolated and co-located p50/p95/p99, throughput, queue wait, and memory peaks.
  • Test burst traffic and worst-case payload sizes.
  • Verify per-tenant concurrency and quota limits.
  • Confirm a tenant creating more replicas does not bypass its aggregate quota.
  • Test weighted fairness under sustained contention and verify starvation bounds.
  • Test premium-priority traffic without silently violating lower-tier contracts.

Resilience tests

  • Simulate node drain, GPU failure, driver restart, and pod eviction.
  • Verify rescheduling respects hardware compatibility and tenant isolation.
  • Test model rollout while other tenants are active.
  • Confirm a failed tenant cannot cause unbounded retries or queue growth for co-tenants.
  • Verify capacity exhaustion produces a controlled rejection or queue response.

Observability tests

  • Confirm application-level GPU execution and queue timing are emitted.
  • Validate which metrics are available per process, container, MIG instance, or physical device.
  • Ensure missing per-tenant attribution is visible rather than reported as zero.
  • Verify alerts for OOM, memory pressure, p99 regression, queue growth, and device health.
  • Confirm dashboards distinguish physical device capacity from partitioned and time-sliced schedulable slots.

Release gates

  • Block promotion when a strict-SLO tenant's measured co-tenant p99 exceeds its objective.
  • Block when model peak memory exceeds the declared partition budget.
  • Require a rollback plan for device-plugin, driver, profile, and sharing-policy changes.
  • Canary platform changes on a small, representative GPU pool.
  • Retain benchmark results and hardware/software versions with the deployment record.

17. Practical implementation sequence#

  1. Classify tenants by trust, latency SLO, model size, and workload burstiness.
  2. Inventory GPU models, supported MIG profiles, driver versions, and scheduler capabilities.
  3. Benchmark each model alone and with representative co-tenants.
  4. Define explicit resource contracts for exclusive, MIG, MPS, and time-sliced pools.
  5. Configure Kubernetes device resources, DRA claims where applicable, quotas, node labels, and admission controls.
  6. Enforce per-tenant concurrency and workload budgets at the serving layer.
  7. Instrument memory, compute, queueing, latency, and tenant-level outcomes.
  8. Test memory pressure, noisy neighbors, device faults, rollout overlap, and fairness.
  9. Start with conservative packing and increase density only after SLO-qualified measurements.
  10. Revisit placement after model, driver, CUDA, framework, or traffic changes.

18. Final takeaway#

GPU sharing is not a binary choice between one GPU per pod and several pods per GPU. It is a spectrum of resource isolation.

Use exclusive GPUs when the workload needs the whole device or strict separation. Use MIG when supported hardware partitioning and predictable tenant QoS justify discrete resource slices. Use time-slicing for trusted, bursty workloads that can tolerate best-effort compute and shared memory. Use MPS when concurrent execution helps and the remaining shared-resource risks are acceptable.

The production rule is simple: never promise a tenant a memory, compute, or latency guarantee that the selected sharing mechanism cannot enforce and the platform cannot measure.

Related questions

Explore other topics:Machine LearningRetrieval-Augmented GenerationAI Agents