Add configurable allocation policy (packed/distributed) for replicated and MIG resources#1621
Open
wkd-woo wants to merge 1 commit intoNVIDIA:mainfrom
Open
Add configurable allocation policy (packed/distributed) for replicated and MIG resources#1621wkd-woo wants to merge 1 commit intoNVIDIA:mainfrom
wkd-woo wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
The existing distributedAlloc spreads replicated devices evenly across physical GPUs, which was designed for time-slicing where workloads compete for shared compute. MIG instances, however, are hardware-isolated and do not suffer from contention when packed onto the same GPU. This adds a --allocation-policy flag (env: ALLOCATION_POLICY) with two options: "distributed" (default, preserving current behavior) and "packed" (bin-packing onto fewest physical GPUs). The packed policy helps free up entire GPUs for full-GPU workloads in mixed clusters. The flag applies uniformly to all non-aligned allocation paths (MIG, time-slicing, MPS) and can be configured per-node via ConfigMap and the nvidia.com/device-plugin.config node label. Signed-off-by: 장재영B <jae.j@tossinvest.com>
421e3c9 to
6686d1a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--allocation-policyflag (ALLOCATION_POLICYenv) withdistributed(default) andpackedoptionspackedmode bin-packs replicated/MIG devices onto fewest physical GPUs, freeing up remaining GPUs for full-GPU workloadsdistributed) is unchanged — no breaking changesMotivation
The current
distributedAllocwas designed for time-slicing, where distributing replicas across physical GPUs avoids compute contention. However, MIG devices also fall into this code path simply becauseAlignedAllocationSupported()returnsfalsefor them — not because distributed allocation is the right strategy.MIG instances are hardware-isolated partitions with dedicated SMs and memory. Packing them onto fewer physical GPUs has no performance penalty, and frees up remaining GPUs for full-GPU workloads:
Relates to #491
Design
Key decisions:
distributedAllocis completely untouched —packedAllocis a separate function following the existingalignedAlloc/distributedAllocpatternalignedAllocis selected beforeallocationPolicyis ever checked, so settingpackedon a full-GPU node has no effectpackedis set, it applies to MIG, time-slicing, and MPS. Silently ignoring a user-set flag for specific device types would be inconsistentconfig-manager+ ConfigMap + node label (nvidia.com/device-plugin.config) mechanism via YAML configUsage
CLI flag / Environment variable
--allocation-policy=packed # or ALLOCATION_POLICY=packed Config file (per-node via ConfigMap + node label) version: v1 flags: migStrategy: mixed plugin: allocationPolicy: packedkubectl label node mig-node nvidia.com/device-plugin.config=mig-packedTest plan
All existing internal/rm/ tests pass unchanged