Summary
Add support for NVIDIA Multi-Instance GPU (MIG) resources in slurm-bridge, including:
- Scheduling workloads onto pre-configured MIG instances.
- Supporting dynamically created and removed MIG instances through Kubernetes Dynamic Resource Allocation (DRA).
This issue follows up on the roadmap discussion where the maintainers suggested opening a separate issue to track and prioritize MIG and GPU partitioning support.
Motivation
MIG-capable NVIDIA GPUs can be partitioned into multiple hardware-isolated GPU instances. Each MIG instance has dedicated compute and memory resources and can be allocated independently.
Without MIG awareness, slurm-bridge can only account for the physical GPU as a whole. This prevents Kubernetes and native Slurm workloads from safely sharing a MIG-enabled GPU while retaining consistent resource accounting between the two schedulers.
A typical use case is a node with one physical GPU partitioned into several MIG instances, where:
- Kubernetes workloads request individual MIG profiles through DRA.
- Native Slurm jobs may also request MIG resources.
- slurm-bridge must ensure that both scheduling domains use a consistent view of the available MIG capacity.
- Two workloads may use different MIG instances on the same physical GPU without being assigned the same instance or exceeding the parent GPU's capacity.
Requested functionality
1. Pre-configured MIG instances
Support nodes where MIG mode and MIG instances have already been configured outside slurm-bridge.
slurm-bridge should be able to:
- Discover MIG devices advertised through Kubernetes DRA ResourceSlice objects.
- Associate each MIG instance with its parent physical GPU.
- Preserve the MIG profile and device identity during scheduling.
- Translate a Kubernetes MIG allocation into the corresponding Slurm resource request or reservation.
- Prevent the same MIG instance from being allocated to both a Kubernetes workload and a native Slurm job.
- Allow different MIG instances on the same physical GPU to be allocated independently when the Slurm configuration permits it.
2. Dynamic MIG
Support DRA drivers that advertise possible MIG partitions before the corresponding MIG instances physically exist.
For example, the NVIDIA DRA driver can advertise abstract MIG devices using partitionable-device capacity. After scheduling, its kubelet plugin creates the selected GPU Instance and Compute Instance during NodePrepareResources, and removes them during NodeUnprepareResources.
For this mode, slurm-bridge should be able to:
- Understand partitionable GPU devices and their shared-capacity relationships.
- Preserve the selected parent GPU, MIG profile, placement, and capacity in the scheduling decision.
- Reserve the corresponding parent-GPU capacity in the Slurm external job.
- Avoid allocations that select overlapping or incompatible MIG placements.
- Coordinate correctly with the DRA prepare lifecycle, where the concrete MIG UUID may not exist until after scheduling.
- Release the Slurm-side reservation when the workload finishes or device preparation fails.
- Recover consistently after scheduler, controller, kubelet plugin, or node restarts.
The goal is not necessarily for slurm-bridge itself to configure MIG hardware. Hardware creation and removal may remain the responsibility of the NVIDIA DRA driver. The requirement is that slurm-bridge can schedule and account for those dynamic partitions correctly.
Expected scheduling behavior
Given one physical GPU with multiple compatible MIG partitions:
- A Kubernetes workload requests a specific MIG profile or capacity.
- slurm-bridge represents the request in the external Slurm job.
- Slurm selects a node without conflicting with native Slurm allocations.
- Kubernetes binds the DRA allocation to a compatible MIG partition on that node.
- For dynamic MIG, the DRA driver creates the concrete MIG instance during resource preparation.
- The workload receives only the allocated MIG device.
- When the workload terminates, the Slurm reservation is released and a dynamically created MIG instance may be removed by the DRA driver.
Multiple workloads should be able to use non-overlapping MIG instances on the same physical GPU without oversubscribing its compute, memory, or placement capacity.
Summary
Add support for NVIDIA Multi-Instance GPU (MIG) resources in slurm-bridge, including:
This issue follows up on the roadmap discussion where the maintainers suggested opening a separate issue to track and prioritize MIG and GPU partitioning support.
Motivation
MIG-capable NVIDIA GPUs can be partitioned into multiple hardware-isolated GPU instances. Each MIG instance has dedicated compute and memory resources and can be allocated independently.
Without MIG awareness, slurm-bridge can only account for the physical GPU as a whole. This prevents Kubernetes and native Slurm workloads from safely sharing a MIG-enabled GPU while retaining consistent resource accounting between the two schedulers.
A typical use case is a node with one physical GPU partitioned into several MIG instances, where:
Requested functionality
1. Pre-configured MIG instances
Support nodes where MIG mode and MIG instances have already been configured outside slurm-bridge.
slurm-bridge should be able to:
2. Dynamic MIG
Support DRA drivers that advertise possible MIG partitions before the corresponding MIG instances physically exist.
For example, the NVIDIA DRA driver can advertise abstract MIG devices using partitionable-device capacity. After scheduling, its kubelet plugin creates the selected GPU Instance and Compute Instance during NodePrepareResources, and removes them during NodeUnprepareResources.
For this mode, slurm-bridge should be able to:
The goal is not necessarily for slurm-bridge itself to configure MIG hardware. Hardware creation and removal may remain the responsibility of the NVIDIA DRA driver. The requirement is that slurm-bridge can schedule and account for those dynamic partitions correctly.
Expected scheduling behavior
Given one physical GPU with multiple compatible MIG partitions:
Multiple workloads should be able to use non-overlapping MIG instances on the same physical GPU without oversubscribing its compute, memory, or placement capacity.