Skip to content

Group MIG instances by parent GPU when applying allocation policies - #2036

Open
jonathan-meiri wants to merge 1 commit into
NVIDIA:mainfrom
jonathan-meiri:mig-parent-aware-allocation
Open

jonathan-meiri wants to merge 1 commit into
NVIDIA:mainfrom
jonathan-meiri:mig-parent-aware-allocation

Conversation

@jonathan-meiri

Copy link
Copy Markdown

What

Allocation candidates are bucketed by the device UUID (AnnotatedID.GetID()). A MIG instance has its own UUID, so every MIG instance looks like a distinct physical GPU. As a result a multi-slot request under distributed/packed (and spread, in #1936) can land entirely on MIG instances of a single physical card, even when the intent is to span distinct GPUs.

This is pre-existing behavior surfaced during review of #1936 (thanks @tariq1890).

Fix

Bucket candidates by the physical GPU instead of the advertised device:

  • MIG instances group by their parent GPU, taken from Device.Index ("<gpu>:<mig>").
  • All other devices continue to key on their UUID — no change for the non-MIG case.

Devices.PhysicalGPUKey centralizes this, and greedyAlloc/prepareCandidates use it. All three policies benefit; distributed/packed are unchanged for non-MIG setups.

Test

TestDistributedAlloc_MIG_SpansDistinctPhysicalGPUs sets up two idle MIG instances on GPU 0 and one busier time-sliced instance on GPU 1; a 2-slot request now spans both physical GPUs. It fails on the pre-fix bucketing and passes with it.

Follow-up to #1936.

@copy-pr-bot

copy-pr-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@myeolenv

Copy link
Copy Markdown

Thanks for the contribution. We will review this PR soon.

@jonathan-meiri
jonathan-meiri force-pushed the mig-parent-aware-allocation branch 2 times, most recently from 33abf0b to 4f2ddf6 Compare September 22, 2026 07:47
Allocation buckets keyed on the device UUID, so each MIG instance looked
like a distinct physical GPU. distributed/packed/spread could therefore
stack a multi-slot request onto MIG instances of one physical card.

Bucket by physical GPU instead: MIG instances group by parent (from
Device.Index), other devices by UUID. Follow-up to NVIDIA#1936.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: runatom-ai <258621014+runatom-ai@users.noreply.github.com>
Signed-off-by: Jonathan Meiri <33288957+Meiri28@users.noreply.github.com>
@jonathan-meiri
jonathan-meiri force-pushed the mig-parent-aware-allocation branch from 4f2ddf6 to 06b21ab Compare September 23, 2026 05:54
@kvalliyurnatt kvalliyurnatt self-assigned this Sep 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants