Based on the MLA-C01 exam guideReport an error
update_endpoint (Blue/Green); risk-free validation means shadow testing.This week covered inference deployment, which is how a trained model is actually served. We weave Day 1 through Day 4 into a single decision flow so you can pull it out straight away in the exam room.
[ Trained model ]
│
① How do requests arrive? ← Day 1
┌───────────────┬───────┴───────┬───────────────┐
▼ ▼ ▼ ▼
Real-time Serverless Asynchronous Batch transform
(steady, low (sporadic, (large (bulk job)
latency) scale to 0) payload)
│
│ ② How do you operate the endpoint? ← Day 2
├─ Model → EndpointConfig → Endpoint
├─ Auto scaling (InvocationsPerInstance, minimum 1 instance)
├─ Zero-downtime deployment (update_endpoint, blue/green)
└─ A/B (weights) · Shadow (responses discarded)
│
│ ③ How do you cut cost and complexity? ← Day 3
├─ MME (same container + hundreds to thousands of models)
├─ MCE (containers for different frameworks, up to 15)
├─ Inference pipeline (preprocess → inference → postprocess)
└─ Inferentia (lower deep learning inference cost, Neuron compile)
│
│ ④ How do you tune bulk and sporadic workloads? ← Day 4
├─ Batch: InstanceCount · SplitType · BatchStrategy
└─ Serverless: MemorySize · MaxConcurrency · Provisioned ConcurrencyLet's burn Day 1's key table into memory once more.
| Option | Response | Traffic | Payload / time | Always-on cost |
|---|---|---|---|---|
| Real-time | Synchronous, ms to seconds | Steady | <6MB, <60 seconds | Yes (minimum 1 instance) |
| Serverless | Synchronous, ms to seconds | Sporadic | <4MB, <60 seconds | None (scales to 0) |
| Asynchronous | Queue-based asynchronous | Variable, long processing | <1GB, <60 minutes | None (scales to 0) |
| Batch transform | Per job | Bulk | Entire dataset | None (shuts down when finished) |
Selection decision tree
Is an immediate response required?
├─ No → Bulk run over the whole dataset? → Yes: batch transform / No (individual requests, large payload, long processing): asynchronous
└─ Yes → Is traffic steady? → Yes: real-time / No (sporadic, cold start acceptable): serverless
Extra constraint: payload >6MB or processing >60 seconds → real-time/serverless are out; go to asynchronous/batch💡 Related theory: At the root of the four options is the triangle trade-off of "always-on cost vs. latency vs. throughput." Real-time has the lowest latency but a constant cost; serverless has a cost near 0 but cold-start latency; asynchronous suits large jobs but adds queue delay; batch has the highest throughput but zero immediacy. The exam hides which of these three to prioritize inside the scenario. "Within 50ms" means latency first (real-time), "lots of idle time, so the cost is wasteful" means cost first (serverless), and "process 1 million records overnight" means throughput first (batch).
SageMakerVariantInvocationsPerInstance is the standard, and at least 1 instance is always kept (0 is not allowed). Auto Scaling cannot keep up with sudden spikes, so prepare with scheduled scaling or a high MinCapacity.The flow from deployment through scaling to replacement, condensed into one block of code, looks like this.
import boto3
sm = boto3.client("sagemaker")
aas = boto3.client("application-autoscaling")
# 1) Create Config → Endpoint
sm.create_endpoint_config(EndpointConfigName="cfg-v1", ProductionVariants=[{
"VariantName": "AllTraffic", "ModelName": "churn-model",
"InstanceType": "ml.m5.xlarge", "InitialInstanceCount": 2}])
sm.create_endpoint(EndpointName="churn-ep", EndpointConfigName="cfg-v1")
# 2) Register auto scaling (minimum 1 instance, 0 not allowed)
aas.register_scalable_target(
ServiceNamespace="sagemaker",
ResourceId="endpoint/churn-ep/variant/AllTraffic",
ScalableDimension="sagemaker:variant:DesiredInstanceCount",
MinCapacity=2, MaxCapacity=10)
# 3) Replace with the new model without downtime — the endpoint name stays the same
sm.update_endpoint(EndpointName="churn-ep", EndpointConfigName="cfg-v2")⚠️ Trap: There are two cases that are easily used as wrong answers. ① Attaching a GPU to XGBoost — tree models gain little from a GPU, so CPU is the correct answer. ② Trying to scale a real-time endpoint to 0 — real-time enforces a minimum of 1 instance, so if you need 0 you must go to serverless/asynchronous.
Day 3's four patterns, distinguished one line at a time:
TargetModel, models load dynamically from S3. "There are very many models of the same kind and I want to cut endpoint cost."TargetContainerHostname. "TensorFlow and PyTorch on one endpoint."MME vs. MCE is a pair that is easy to confuse in the exam. The deciding keywords are "are the frameworks the same or different?" and "are there hundreds of models or only a few?" Same container + many = MME, different containers + few = MCE. The inference pipeline differs from both in that it is "sequential execution," not "selective invocation." The input flows through one container and on to the next.
The invocation parameter name alone tells you immediately which pattern is in use.
| Parameter / API | Where it is used | Meaning |
|---|---|---|
TargetModel | MME invocation | Which model artifact in S3 to use |
TargetContainerHostname | MCE invocation | Which container to send to |
TargetVariant | Real-time endpoint invocation | Ignore the weights and force a specific variant |
InitialVariantWeight | EndpointConfig | Traffic split ratio per variant |
InputLocation | Asynchronous invocation | S3 path where the input data is placed |
split_type / strategy | Batch transform | Unit for splitting the input / mini-batch method |
join_source | Batch transform | Join the original input back onto the output |
MaxConcurrency | Serverless | Maximum number of requests handled concurrently |
InstanceCount (parallelism), SplitType=Line (split by record), BatchStrategy=MultiRecord/MaxPayloadInMB/MaxConcurrentTransforms.input_filter/output_filter/join_source.MemorySize (1 to 6GB) + MaxConcurrency and it scales down to 0.
The big picture of cost optimization is "eliminating idle cost." If there are periods when traffic drops to 0, serverless, asynchronous, and batch can bring the cost of those periods close to 0. Conversely, if traffic is always high, lower the unit cost with real-time + Auto Scaling + (for many models) MME + (for deep learning) Inferentia. Almost every inference cost scenario reduces to these two branches.
Here are exam keywords mapped directly to answers.
These are the wrong choices that appear repeatedly in the exam.
| Plausible wrong answer | Why it is wrong | Correct choice |
|---|---|---|
| Attach a GPU (p4d) to XGBoost inference to save cost | Tree models gain almost nothing from GPU parallelization | CPU (m5/c5) |
| Scale a real-time endpoint in to 0 instances | Real-time enforces a minimum of 1 instance | Serverless / asynchronous |
| Choose serverless every time just because "cut cost" is mentioned | With steady, high traffic it actually costs more | Check the traffic pattern first |
| Deploy a GPU deep learning model as serverless | Serverless does not support GPUs | Real-time (GPU) / asynchronous |
| Delete and recreate the endpoint to deploy a new model | The address breaks and downtime occurs | New Config + update_endpoint |
| Validate the new model with a 50:50 A/B | Half of the users actually receive the new model's responses | Shadow testing |
| Consolidate models of different frameworks into an MME | An MME has only one container | MCE |
| Batch is slow, so keep adding instances | It has no effect if the input cannot be split | Input sharding + split_type |
| Process a 200MB, 5-minute request in real-time | Exceeds the 6MB / 60-second limit | Asynchronous inference |
| Symptom | Cause | Action |
|---|---|---|
| Normal on regular days but latency spikes only during events | Auto Scaling cannot keep up with startup time | Scheduled scaling / raise MinCapacity |
| Inference cost is high even during idle hours | Real-time endpoint running around the clock | Move to serverless / asynchronous / batch |
| Hundreds of models and the endpoint cost explodes | An endpoint was launched for every model | Consolidate with MME |
| Deep learning inference GPU cost is unaffordable | General-purpose GPU unit price | Inferentia (inf1/inf2) + Neuron compile |
| Production accuracy is lower than training performance | Preprocessing mismatch (training-serving skew) | Bundle preprocessing with an inference pipeline |
| Only the first call is slow (serverless, MME) | Cold start / cold load | Provisioned Concurrency, increase memory |
| Error rate rises after deployment | New model regression | Canary or linear shifting + alarm-based automatic rollback |
update_endpoint) in order?Next week we move to the stage of operating the deployed models: orchestration and monitoring.
Click a choice to reveal the answer and explanation.
Question 1
An inference workload has the requirements "individual requests, 300 MB input payload, about 10 minutes of processing, and results retrieved from S3 after completion." What is the most appropriate option?
Question 2
Which is the most accurate key criterion distinguishing a multi-model endpoint (MME) from a multi-container endpoint (MCE)?
Question 3
Even with autoscaling applied to a real-time endpoint, latency spikes during a predictable large traffic surge (a year-end sale). What is the most appropriate complement?
Question 4
Which of the following pairings of an inference cost reduction scenario and an appropriate technique is incorrect?
Question 5
While deploying a new model to a live real-time endpoint, you want to validate its performance on production traffic first, without exposing the new model's responses to users. What is the most appropriate method?