Once you deploy a mannequin to a GPU endpoint, the smallest unit of GPU you possibly can request is one entire accelerator.
This constraint can value you twice. First, you possibly can’t host extra fashions on an occasion than it has accelerators. An ml.p4d.24xlarge has eight A100s, so it holds eight fashions, whether or not each wants 40 GB or 14 GB. Second, and fewer apparent, it makes each deployment come all the way down to a alternative of which full GPU to deploy to. As your concurrency and immediate lengths develop, a full GPU on an older occasion stops being sufficient, however a full GPU on a more moderen one is greater than your mannequin can use. You find yourself both under-served or paying for functionality you by no means attain.
In the present day, Amazon SageMaker Inference helps GPU partitioning, which makes use of NVIDIA Multi-Occasion GPU (MIG) to divide a bodily GPU into impartial partitions. Every partition receives a set share of the GPU’s compute items and a devoted block of its reminiscence, with isolation enforced in {hardware}. That adjustments each constraints: you possibly can place a special mannequin in every partition, and you’ll select a fraction of a more moderen accelerator as a substitute of an entire one in every of both technology.
This put up covers each. The primary half is the direct profit: deploy extra fashions than you’ve got GPUs, with isolation between them. The second is the one clients ask about when the query turns to value: how the granularity of partitioning helps you decide the right-sized unit, and what we measured after we did.
One factor to know earlier than you learn additional: GPU partitioning works on endpoints that use inference elements, the assemble you employ to deploy a number of fashions to at least one endpoint and set the compute every mannequin will get. Partitioning builds instantly on it. A partition is a useful resource a element asks for, in the identical place it already asks for CPU and reminiscence. In case you haven’t used inference elements, this put up introduces them. Single-model endpoints, serverless endpoints, and heterogeneous occasion swimming pools can’t be partitioned.
What clients do at present, and why every choice falls quick
When you’ve got extra fashions than accelerators, you’ve got had three selections.
Run fewer, bigger endpoints and batch more durable – This raises utilization, however solely when the fashions are interchangeable. A portfolio of fine-tuned variants or per-tenant fashions shouldn’t be.
Use multi-model endpoints – These load and unload fashions from a shared GPU on demand, which inserts sparse, bursty visitors. However fashions share the system with out isolation, so a heavy request for one mannequin impacts the others. A mannequin that isn’t loaded additionally pays a load penalty on first use.
Transfer to self-managed Kubernetes – That is the place clients who want actual GPU partitioning have gone. MIG works there, however you tackle driver versioning, partition configuration, a tool plugin, scheduling, and retaining all of it constant throughout a fleet. That’s loads of work for a {hardware} functionality your cases have already got.
Why MIG
NVIDIA Multi-Occasion GPU (MIG) splits one GPU into as many as seven cases, relying on the GPU. Every occasion has its personal compute, cache, reminiscence and reminiscence bandwidth. As a result of the break up is in {hardware} moderately than software program, you get ensures that different sharing strategies can’t give:
- Predictable latency – Every partition has devoted reminiscence bandwidth, so one mannequin’s visitors spike doesn’t present up in one other mannequin’s p99.
- Fault isolation – A crash or reminiscence error stays inside its partition as a substitute of taking down each mannequin on the GPU.
- Proper-sized capability – Small and mid-sized fashions get a slice that matches them as a substitute of an entire GPU. You may combine slice sizes on one system.
- No chilly begins – Each mannequin retains its personal partition and stays loaded, with no load penalty and no eviction.
- Tenant isolation – Reminiscence safety between partitions is enforced in {hardware}, which makes safety and compliance critiques less complicated.
- Dependable planning and chargeback – A partition performs the identical approach no matter its neighbors, so load assessments predict manufacturing. GPU value additionally maps cleanly to a mannequin, crew or tenant.
Partitioning has boundaries price realizing up entrance. The utmost variety of partitions is determined by the accelerator and by no means exceeds seven. MIG itself solely permits a format to vary whereas its partitions are idle, and on SageMaker AI which means selecting a format if you create the endpoint. A mannequin that wants multiple GPU nonetheless wants entire units. Inside these boundaries, you get the isolation of separate GPUs with out dedicating one to every mannequin.
Partitioning with out the platform work
Till now, getting MIG meant working the Kubernetes stack your self. GPU partitioning on Amazon SageMaker AI removes that step: you decide a partition profile to your mannequin, and SageMaker AI handles GPU configuration, placement and scaling. You get hardware-isolated GPU sharing on a managed endpoint, with out having to run the platform beneath it.
Salesforce has been a part of this work from the beginning, serving to outline the necessities and validating the preliminary implementation.
“NVIDIA MIG partitions a single GPU into a number of remoted cases, every with devoted compute and reminiscence sources. Salesforce sees this as an essential functionality as a result of many inference workloads don’t require a complete GPU. MIG would permit us to consolidate workloads safely, considerably enhance GPU utilization, cut back inference prices, and keep predictable efficiency and powerful isolation.
This functionality would assist us scale AI Inference extra effectively throughout totally different use instances. Salesforce has helped outline necessities, validated the preliminary resolution. We at the moment are getting ready to validate the answer with consultant manufacturing workload and exhibit robust buyer demand with AWS. We imagine MIG assist would ship significant technical and enterprise worth for enterprise clients.”
— Richard Chang, Software program Engineering Architect, Salesforce
The way it works
GPU partitioning provides two non-compulsory fields to API calls you already make. There aren’t any new API operations, no new useful resource sorts, and no new AWS Id and Entry Administration (IAM) actions, and an endpoint that omits each fields behaves precisely because it does at present.
AcceleratorPartitionLayouts goes on a manufacturing variant in CreateEndpointConfig and declares how every accelerator is split:
An A100 has seven compute slices to divide. The previous format makes use of all seven, so every of the eight A100s on the p4d occasion carries three partitions and the endpoint offers 24, eight of every sort.
The carve applies uniformly. One format entry describes how one accelerator is split, and each accelerator on each occasion within the variant is split the identical approach. The listing isn’t positional, so an entry doesn’t map to a particular GPU.
AcceleratorPartitionType goes on an inference element and selects which partition the mannequin runs on:
Every element copy occupies one partition of the requested sort. With eight partitions of every sort on the occasion, elevating CopyCount locations further copies on free partitions. That is helpful for a small mannequin serving excessive concurrency, the place a single course of leaves the GPU ready on requests.
NumberOfAcceleratorDevicesRequired is at all times 1 right here. With a partition sort set it means one partition moderately than one accelerator. NumberOfCpuCoresRequired and MinMemoryRequiredInMb nonetheless describe host CPU and host reminiscence, as a result of GPU reminiscence comes from the partition sort.
Invocation doesn’t change. InvokeEndpoint addresses a mannequin by inference element identify, and the partition it occupies by no means seems within the request.
Partitioning occurs whereas the endpoint is provisioned. When it reaches InService each accelerator is carved and the partitions are empty, which is a sound state as elements land on them afterward. In our testing, carving accelerators added roughly 17 seconds to provisioning. The remainder of the time is the same old occasion launch and container pull.
Partition profiles by GPU
The profiles out there to you’re a property of the GPU, so begin by discovering out which GPU your occasion sort carries and look it up in NVIDIA’s supported MIG profiles, which is the authority on the total profile set and the combos legitimate on one system.
| Occasion household | Accelerator | GPU reminiscence | Granularity (compute / reminiscence) | Accessible partition profiles | Max partitions per GPU |
| P4d | NVIDIA A100 | 40 GB | 7 / 8 | mig-1g.5gb, mig-1g.10gb (see driver observe), mig-2g.10gb, mig-3g.20gb, mig-4g.20gb, mig-7g.40gb | 7 |
| P5 | NVIDIA H100 | 80 GB | 7 / 8 | mig-1g.10gb, mig-1g.20gb, mig-2g.20gb, mig-3g.40gb, mig-4g.40gb, mig-7g.80gb | 7 |
| G7 | NVIDIA RTX PRO 4500 Blackwell | 32 GB | 2 / 2 | mig-1g.16gb, mig-2g.32gb | 2 |
| G7e | NVIDIA RTX PRO 6000 Blackwell Server Version | 96 GB | 4 / 4 | mig-1g.24gb, mig-2g.48gb, mig-4g.96gb | 4 |
Learn the profile identify as compute items adopted by GPU reminiscence: mig-3g.40gb takes three compute items and 40 GB. The granularity column is what limits a format. An A100 and an H100 divide into sevenths on compute and eighths on reminiscence, whereas G7 divides into halves and G7e into quarters. Profile names differ between GPUs even the place the slice counts match, so don’t carry a format from one occasion household to a different with out checking it in opposition to this desk.
Inside these limits you’ve got actual alternative. On a P4d or P5 you possibly can carve seven of the smallest profile, or two 3g partitions, or the 4g plus 2g plus 1g format used within the earlier instance, or take the entire system as one. On a G7e you possibly can take 4 of the smallest, or two 1g beside a 2g, or two 2g, or one entire system. On a G7, both two partitions or one.
The 3g profile is the one to know, as a result of its two dimensions don’t match: it takes three of the seven compute items however 4 of the eight reminiscence items. Two of them fill the GPU and nothing else will match beside them.
The high-level rule: Each profile in your format should be one your GPU provides, and the compute and reminiscence items your profiles add as much as should not exceed what one system offers. Each are checked if you create the endpoint configuration, and both one failing is a rejection moderately than a fallback to an entire accelerator.
Driver observe for P4d: mig-1g.10gb requires an R525 or newer NVIDIA driver, and the default P4d picture ships 470.256.02. Request it on the default picture and the carve fails with out an error naming the profile. Set InferenceAmiVersion to al2023-ami-sagemaker-inference-gpu-4-1 on the manufacturing variant to get a picture on the 580 driver line, which provides it.
Selecting a format to your workload
Selecting effectively is a separate query from selecting a format that’s merely accepted. A partition arms you compute and reminiscence in mounted proportions, and the 2 do totally different jobs throughout inference.
Compute items are what you want for prefill. Prefill reads the immediate and builds its illustration. That is the compute-heavy part, and it scales with the streaming multiprocessors, and so the TFLOPs, your partition holds. The longer your inputs and the extra prompts arriving directly, the extra it governs how rapidly you come back a primary token.
Reminiscence items are what you want for decode and for capability. Producing tokens re-reads the mannequin weights on each step, so decode is bounded by reminiscence bandwidth moderately than by math, and reminiscence additionally caps how a lot KV cache you possibly can maintain. That cap in flip units the context size you possibly can serve and what number of sequences you possibly can serve concurrently.
Nearly no actual workload workout routines solely one in every of these, so the purpose isn’t to select a dimension however to decide on a mixture that helps your use case. Select a profile whose proportions cowl your heaviest part whereas leaving the opposite adequately served. On the compute aspect, what issues is how lengthy your prompts are and what number of arrive directly. On the reminiscence aspect, it’s your output size, your context window, and your concurrency.
Reminiscence is the simpler of the 2 to underestimate, as a result of a partition has to carry three issues and never simply the mannequin: the weights, which for an 8B mannequin at FP16 are about 16 GB. The KV cache, sized for the context size and the variety of concurrent sequences you plan to permit, which is the time period individuals omit and the one which grows with visitors. And 1–2 GB of runtime overhead for the CUDA context and the serving course of. Add these up earlier than selecting a profile, as a result of a partition sized to the weights alone will load the mannequin after which fail beneath load, or quietly serve a a lot shorter context than you configured. For a concrete reference level, that very same 8B mannequin at FP16 comfortably serves an 8,000-token context on a 40 GB partition.
The place MIG provides probably the most worth
A portfolio of small and mid-size fashions – The direct case. Wonderful-tuned variants, embedding fashions, rerankers, and classifiers that every depart most of an accelerator unused now share one.
Multi-tenant mannequin serving – Once you host a mannequin per buyer, MIG offers you a {hardware} boundary between them: a course of in a single partition can’t learn one other partition’s reminiscence or take its throughput. Scope the declare precisely, although. Fashions on the identical occasion nonetheless share host CPU, system reminiscence, storage, networking, and endpoint routing, so partitioning is an isolation mechanism for the GPU and never a whole tenancy boundary.
Multi-stage pipelines on one occasion – A transcription mannequin, a diarization mannequin, and a language mannequin, or an embedder, a reranker, and a generator. Every stage is a individually addressable element by itself partition, and a community hop between levels disappears.
A small mannequin within the request path – A security classifier or guardrail mannequin that has to run on each request however can’t justify an accelerator, with predictable latency as a result of it isn’t time-slicing in opposition to the primary mannequin.
Challengers and canaries – Run a candidate mannequin on a small partition beside the mannequin serving manufacturing visitors as a substitute of standing up a second endpoint.
Efficiency: A slice of a more moderen GPU in opposition to an entire older one
Along with bin-packing, the opposite profit you get is granularity on high-end GPUs: extra GPU choices to deploy a mannequin onto, and the selection of which one is yours. Each supported accelerator turns into a number of sizes moderately than one, so the sensible approach to consider it’s that every profile is a GPU choice in its personal proper, sitting alongside the entire accelerators you already select between. That issues most if you end up contemplating a bigger or newer occasion sort, as a result of transferring up stops being all-or-nothing: you possibly can take as a lot or as little of that larger GPU as your workload wants, at any of the sizes it publishes, as a substitute of paying for the entire accelerator.
To see whether or not that pays off, we in contrast one mig-3g.40gb partition of an H100 in opposition to one entire, uncarved A100-40GB. The 2 have comparable GPU reminiscence, which makes it a clear strategy to see how highly effective a slice of a extra superior occasion could be.
We used genai-bench to generate load, driving each endpoints from the identical shopper so the GPU is the one variable. Either side ran Llama-3.1-8B-Instruct on manufacturing SageMaker real-time endpoints, one mannequin reproduction every, with an an identical container picture, tokenizer, and shopper configuration. Each have been invoked by the SageMaker AI native OpenAI-compatible route. We swept 5 visitors shapes, written D(enter tokens, output tokens) and starting from quick prompts to long-context summarization, every throughout a concurrency ladder from 2 to 512.
Determine 1: Combination output tokens per second for one mig-3g.40gb partition of an H100 in opposition to one full A100-40GB, throughout 5 visitors shapes and a concurrency ladder from 2 to 512
Determine 2: Partition value profit per million output tokens in opposition to concurrency for a similar 5 visitors shapes
4 issues stand out.
- The partition is quicker in every single place – It delivered extra output tokens per second in each state of affairs at each concurrency, by 53 p.c to 89 p.c on the load the place every state of affairs’s value profit is largest, and decrease inter-token latency in each one too, by 8.9 p.c to 42.1 p.c. The hole widens with load.
- Time to first token is decrease in each case, by 5.6 p.c to 47.5 p.c.
- On value it’s 18–34 p.c cheaper per million output tokens, above a crossover that strikes earlier as prompts lengthen. Concurrency 64 for 100-token prompts, 4 for 8,000-token prompts. Under the crossover the entire A100 is the cheaper unit. These costs are all on-demand, which on the time of research have been measured as $25.251286 per hour for an
ml.p4d.24xlargeand $63.296000 per hour for anml.p5.48xlargewithin the US West (Oregon) AWS Area. Purely for our personal evaluation, we derived the unit value by dividing the whole-instance value by the variety of items on it: 8 on the p4d, and 16 on the p5, the place our partition is half of a GPU. - On the prime of the ladder on long-context visitors, the A100 stopped serving. On each the 6,000- and eight,000-token workloads it failed a 3rd to a half of its requests in opposition to a serving-path deadline, whereas the partition failed none. That’s the reason these two panels finish sooner than the remaining.
Deal with this as a case-by-case comparability, not a verdict. The helpful psychological mannequin is to treat the out there GPU fractions as GPU sorts in their very own proper. Listing them alongside entire accelerators, work out what your visitors really calls for of compute and of reminiscence, and evaluate them by yourself workload. For prime-concurrency, long-input visitors the partition gained on each efficiency and price right here. For brief-input or low-concurrency workloads the entire A100 remained cheaper. Partitioning isn’t a one-size-fits-all reply. It offers you extra sizes to select from, so you possibly can decide the one that matches your workload.
What to know earlier than you decide to a format
Partitioning adjustments the form of an endpoint, and some properties are price understanding earlier than you design one.
A element’s partition sort is mounted for the lifetime of that element. Shifting a mannequin to a special profile means creating a brand new element. Altering the endpoint’s carve means a brand new endpoint and a visitors migration, as a result of updating an endpoint configuration doesn’t re-carve hosts which might be already working. This makes partitioning an excellent match for a secure portfolio and a poor one for a mixture you reshuffle day by day.
A requested profile has to exist within the endpoint’s format. There isn’t any fallback to an entire accelerator, so a element asking for a profile the variant didn’t declare is rejected.
Partitioning applies to real-time inference on inference element endpoints. Serverless endpoints and heterogeneous occasion swimming pools aren’t supported, and asynchronous invocation can’t deal with an inference element, so async workloads are out of scope.
You’re billed for the total GPU occasion, as you might be at present. Partitioning raises how a lot of that occasion you should use. It doesn’t change its hourly worth.
Lastly, a mannequin that genuinely wants a full accelerator, or multiple, ought to maintain having one. No partition spans accelerators.
Supported cases and Areas
GPU partitioning is offered on the P4d, P5, G7, and G7e occasion households. Help is on the household degree, so smaller sizes inside a household are lined.
It’s out there within the following AWS Areas: US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Tokyo), Europe (Frankfurt), and Europe (Eire).
Occasion availability varies by Area, so affirm that your chosen occasion sort is obtainable in your Area and that you’ve endpoint utilization quota for it.
Getting began
To partition a GPU endpoint, work out the reminiscence and compute every of your mannequin’s wants, decide the profiles that match, declare a format in your endpoint configuration, and deploy every mannequin as an inference element that requests a profile from that format. Nothing about the way you invoke your fashions adjustments.
For the API reference, the total profile tables for every occasion household, and a step-by-step walkthrough, see GPU partitioning within the Amazon SageMaker AI Developer Information.
To attempt it your self, run the GPU partitioning pattern pocket book, which deploys a number of fashions onto partitions of a single GPU endpoint.
The broader change is price retaining in thoughts as you propose capability. Each supported accelerator is now a number of sizes moderately than one. Whether or not a partition of a more moderen GPU or an entire accelerator of an older one is the precise unit for a given mannequin is not a query you’ll want to reply by rounding up. It’s one you possibly can measure.
In regards to the authors

