MLA-C02 · LESSON 3
Deployment and Orchestration of ML and AI Workflows24% · 3 topics
Learn deployment infrastructure for ML and AI models, provisioning and configuring resources, and MLOps automation and CI/CD.
3.1Manage deployment infrastructure
3.1 Manage deployment infrastructure for ML and AI model types.
Concept
SageMaker inference options are real-time inference (low latency, always on), serverless inference (intermittent traffic, with cold starts), asynchronous inference (large payloads, long processing, queued requests, scales to 0) and batch transform (bulk processing of large data). Consolidate many small models with multi-model endpoints and multiple containers with multi-container endpoints.
How it works / steps
- Check latency, payload size, processing time and traffic patterns
- Real-time for low-latency constant use; serverless for intermittent use
- Asynchronous inference for large inputs or processing that takes minutes
- Batch transform for periodic bulk predictions
- Consolidate many per-customer models with a multi-model endpoint
Workplace example
Consolidate 1,000 per-customer demand forecasting models into one multi-model endpoint, loading only invoked models into memory to lower cost.
Common confusions and exam tips
- Serverless inference cannot use GPUs
- Asynchronous inference writes results to S3 and can notify completion via SNS
- Batch transform does not create a persistent endpoint
Mini quiz
Q1. You will run your own inference container on a SageMaker AI endpoint. Where is the most appropriate place to store the container?
- Push the image to an Amazon ECR repository
- Put only the Dockerfile in an Amazon S3 bucket
- Put the source code on an Amazon EFS file system
- Keep it in a local registry on a staff PC
Show answer and explanation
Answer: A Push the image to an Amazon ECR repository
SageMaker AI pulls container images from ECR.
Q2. Which statement about SageMaker serverless inference is incorrect?
- Capacity goes to 0 when unused, and you are charged only for usage
- You configure memory size and maximum concurrency
- You can specify GPU instances to run large deep learning models
- After a period of no use, the first request may experience a cold start
Show answer and explanation
Answer: C You can specify GPU instances to run large deep learning models
Serverless inference does not support GPUs. If you need GPUs, use real-time or asynchronous inference.
Reference links
3.2Provision and configure resources
3.2 Provision and configure resources for ML and AI workloads based on existing architecture and requirements.
Concept
Configure endpoint instance types (CPU, GPU, Inferentia) and sizes, auto scaling (target tracking on InvocationsPerInstance and others) and placement inside a VPC according to requirements. SageMaker Inference Recommender recommends the best instances through load testing. Define infrastructure with CloudFormation or CDK; Bedrock also supports importing your own models (Custom Model Import).
How it works / steps
- Compare candidate instances' performance and cost with Inference Recommender
- Configure the auto scaling policy and minimum and maximum instance counts
- Place endpoints inside a VPC and allow only necessary traffic
- Define endpoint configuration with IaC
- For models trained elsewhere, also consider Bedrock Custom Model Import
Workplace example
For an image classification endpoint, choose an Inferentia instance cheaper than GPU based on Inference Recommender results, and scale on invocations per instance.
Common confusions and exam tips
- Only some configurations (such as asynchronous inference) can set the auto scaling minimum to 0
- Oversized instances waste money
- Consider scale-out speed and tune cooldown periods
Mini quiz
Q1. On a real-time endpoint, requests for large documents that take 3 minutes to process fail with timeouts. Responses need not be returned immediately. What is the most appropriate next step?
- Move to a serverless inference endpoint and add memory
- Start a Batch Transform job for each request
- Use a larger instance to fit processing within the limit
- Move to an asynchronous inference endpoint, output to S3 and notify on completion
Show answer and explanation
Answer: D Move to an asynchronous inference endpoint, output to S3 and notify on completion
Real-time inference has a response time limit. For long processing, use asynchronous inference, which can process for up to 1 hour. [Other options] Serverless inference also has a response time limit. A larger instance isn't guaranteed to fit. Per-request Batch Transform starts slowly and isn't for individual requests.
Q2. Before releasing a new model to production, you want to find which instance types can meet latency and cost requirements. Which is the most appropriate method?
- Check training resource use in SageMaker Debugger and pick the same type
- Run load tests on candidate instances with SageMaker Inference Recommender
- Choose the inference instance type from Compute Optimizer recommendations
- Monitor and compare production latency metrics with SageMaker Model Monitor
Show answer and explanation
Answer: B Run load tests on candidate instances with SageMaker Inference Recommender
Inference Recommender load-tests candidate instances and compares latency, throughput and cost. [Other options] Model Monitor watches after release. Compute Optimizer doesn't load test SageMaker endpoints. Training resource use doesn't show inference performance.
Reference links
3.3Implement MLOps automated orchestration and CI/CD
3.3 Implement automated orchestration and continuous integration and continuous delivery (CI/CD) pipelines for MLOps and AI workloads.
Concept
SageMaker Pipelines automates the flow of data processing → training → evaluation → condition (meets the bar?) → model registration. Deploy models approved in Model Registry from staging to production with CodePipeline and similar. Switch safely with deployment guardrails (blue/green: all at once, canary, linear, with automatic rollback on alarms).
How it works / steps
- Define processing, training, evaluation and registration steps in Pipelines
- Register the model only when evaluation results meet the bar (condition step)
- Trigger the deployment pipeline on Model Registry approval
- Configure canary traffic shifting and automatic rollback with deployment guardrails
- Start pipelines on data arrival or on a schedule
Workplace example
When new data arrives in S3, EventBridge starts Pipelines; if AUC is 0.85 or higher the model is registered, and after approval CodePipeline rolls it out to production via canary.
Common confusions and exam tips
- Pipelines is for ML workflows and CodePipeline for software CI/CD; use them together
- Control deployment with the model approval status (Approved and so on)
- Set CloudWatch alarms as rollback conditions
Mini quiz
Q1. You want to automatically roll back to the previous model if the error rate rises midway through updating an endpoint's model. Which is the most appropriate method?
- Specify CloudWatch alarms in deployment guardrails and configure automatic rollback
- Delete and recreate the endpoint for every update, and recreate it again if it fails
- Have staff watch the screen 24 hours a day and roll back to the previous model by hand if errors increase
- Disable error-rate alarms so staff are not notified during model updates
Show answer and explanation
Answer: A Specify CloudWatch alarms in deployment guardrails and configure automatic rollback
Deployment guardrails automatically roll back to the previous fleet when the specified CloudWatch alarms fire.
Q2. When Model Monitor finds a data drift violation, you want to start a retraining pipeline automatically. Which is the most appropriate configuration?
- Notify staff of violations via SNS and have them start the pipeline
- Catch the violation alarm with EventBridge and start a SageMaker Pipelines run
- Run the Model Monitor schedule hourly to detect violations sooner
- Add SageMaker Clarify bias monitoring to investigate the drift cause
Show answer and explanation
Answer: B Catch the violation alarm with EventBridge and start a SageMaker Pipelines run
EventBridge rules can start SageMaker Pipelines triggered by alarms or schedules. [Other options] More frequent monitoring doesn't start retraining. SNS leaves a manual step. Clarify adds detection and doesn't trigger retraining.
Reference links
Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.
Notes (unofficial, original questions, no pass guarantee)
- The questions on this site are original practice questions written by this site based on publicly available skills outlines and exam guides. They are not actual exam questions.
- Amazon Web Services, AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. This site is not affiliated with or endorsed by AWS.
- This content is a study aid and does not guarantee a pass. Exam content, format and prerequisites may change without notice; always check the latest information on the official page before taking the exam.
- Your accuracy on the mock exam cannot be converted to the official (scaled) score and does not predict a pass or fail.
- Progress is saved only in this browser (localStorage) unless you sign in with Google to sync it. You can delete it from the Cookie & storage settings page (Japanese).