Real-time, serverless, async and batch inference: MLA-C02 study notes and practice questions
What to know about Real-time, serverless, async and batch inference for the MLA-C02 exam, from the Deployment and Orchestration of ML and AI Workflows domain (24% of the exam guide), then 3 free questions to test it. Part of the MLA-C02 study guide.
A pet insurer lets customers upload short videos of an injury when filing a claim. Each video is up to a few hundred megabytes and takes three to five minutes for the vision model to score, and customers do not need the result in the same request.
The model should scale to zero when no claims are pending, so that the insurer does not pay for idle instances, and the customer app should receive a job status to poll.
Which SageMaker AI inference option meets these requirements?
Choose one answer.
AA. A real-time endpoint with a fixed number of GPU instances, sized for the largest video, with the app waiting on the open HTTP connection for each result.
BB. An asynchronous inference endpoint, which queues large requests, scales to zero when idle, and writes results to S3 for the app to poll.
CC. A serverless inference endpoint, which lets the app send each video directly and wait for the scored result in the response.
DD. A batch transform job started once an hour over all videos uploaded in that hour, with the app reading results after each job finishes.
Show the answer and explanation
Answer: B
A. Wrong: A real-time endpoint keeps instances running when no claims are pending, and it holds the connection open for minutes, which is not reliable. The stem asks for scale to zero and a status to poll.
C. Wrong: Serverless endpoints suit smaller payloads and intermittent traffic, but this workload needs large payloads and multi-minute processing with polling. The option does not provide the queued, pollable pattern.
D. Wrong: Batch transform is designed for offline scoring of a dataset, and an hourly job adds delay to each claim. It does not give each customer a status they can poll.
Explanation
Asynchronous inference handles large payloads and long processing by queuing requests, writing results to S3, and it can scale to zero when idle. Real-time endpoints stay running and hold connections open, serverless endpoints target smaller payloads, and batch transform runs offline rather than per claim.
A logistics broker has an internal model that scores carrier invoices for duplicate billing. The tool is used by a few analysts during business hours, and it receives only a handful of requests per day with small payloads.
The broker wants the lowest cost for this light, unpredictable traffic and does not want to manage instance capacity, while still accepting that a request after an idle period may take a little longer.
Which endpoint type should the team choose?
Choose one answer.
AA. A real-time endpoint on a GPU instance that runs at all times, so that every request is answered at the same speed.
BB. A batch transform job that is started by hand each time an analyst wants a score for a new invoice.
CC. A serverless inference endpoint, which charges for the compute used during requests and needs no instance capacity to be managed.
DD. An Amazon EC2 instance running a web server that loads the model in memory and is managed by an auto scaling group with a minimum of two instances.
Show the answer and explanation
Answer: C
A. Wrong: A running GPU instance is paid for all day even though the traffic is a handful of requests. This is the highest cost for the light workload.
B. Wrong: Batch transform works for a set of records processed together, and it is not a request-time service for a single invoice. Starting a job by hand for each invoice adds delay and effort.
D. Wrong: Two always-on instances cost more than the light traffic justifies, and the broker would manage the servers itself. The stem asks for lower cost with no capacity management.
Explanation
Serverless inference suits intermittent traffic with small payloads, because the broker pays for compute used and does not manage instances. A running real-time endpoint or two instances pay for idle time, and batch transform is not built for single on-demand requests.
A logistics broker scores about 40 million shipments every night to predict which ones will miss their delivery window. Results are used the next morning in a planning report, and nobody needs an answer during the day.
The team wants the scores in Amazon S3, with no endpoint running between the nightly runs.
Which approach meets these requirements?
Choose one answer.
AA. A real-time endpoint that runs all day, with the scoring service calling it once for each shipment in the nightly batch.
BB. A serverless inference endpoint that the nightly job calls for each shipment, one request at a time.
CC. A multi-model endpoint that loads the shipment model from S3 when a request arrives, with the nightly job sending one request per shipment.
DD. A batch transform job that reads the shipment files from S3, scores them with the model, and writes the predictions back to S3.
Show the answer and explanation
Answer: D
A. Wrong: A running endpoint is paid for all day, and calling it once per shipment is slower than a bulk job designed for offline scoring. The stem asks for no endpoint between runs.
B. Wrong: Calling a serverless endpoint once for each of 40 million shipments is slow and expensive, and it is a request-time pattern. Offline scoring of a dataset is what batch transform is built for.
C. Wrong: A multi-model endpoint is a real-time endpoint for many models, and it runs continuously. It does not remove the need for an always-on serving layer.
Batch transform scores a large dataset offline, then releases its compute and writes results to S3. Real-time and serverless endpoints serve requests one at a time, and a multi-model endpoint still runs continuously.
Want more on Real-time, serverless, async and batch inference? The 5 full-length practice sets have 8 more Real-time, serverless, async and batch inference questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →
Study Real-time, serverless, async and batch inference