MLA-C01 Question 195
Select 3You have trained a machine learning model using a custom framework outside of SageMaker and saved the model artifacts in an S3 bucket. You now want to deploy this model using SageMaker for real-time inference. Which methods can you use to integrate this external model into SageMaker?
- A
Use the SageMaker pre-built Deep Learning Containers and specify the location of the model artifacts in the container's configuration.
- B
Write a custom inference script, package the model and script into a Docker image, and push it to Amazon Elastic Container Registry (ECR) for deployment.
- C
Directly upload the model artifacts to the SageMaker model registry and create an endpoint from there without any additional steps.
- D
Use SageMaker's BYOM (Bring Your Own Model) approach by specifying the custom model artifacts in an S3 bucket and an appropriate inference container for deployment.
- E
Use AWS Lambda to deploy the model directly, bypassing SageMaker entirely, as SageMaker cannot support external models.
Show answer and explanation
Correct answers: A, B, D
Explanation
SageMaker provides multiple methods to integrate and deploy models built externally. The pre-built Deep Learning Containers allow you to deploy models trained in supported frameworks by specifying S3 model artifacts. Additionally, you can create a custom Docker image with your model and inference logic, push it to ECR, and deploy it on SageMaker. Finally, SageMaker's Bring Your Own Model (BYOM) approach is designed for seamless integration of external models by specifying their S3 location and using an appropriate container. Directly uploading model artifacts to the model registry without a container or using AWS Lambda to bypass SageMaker are not suitable approaches for this scenario.
- A. Correct.
Correct: SageMaker pre-built Deep Learning Containers (e.g., TensorFlow, PyTorch) allow you to specify the location of external model artifacts stored in S3 for deployment, making integration straightforward for supported frameworks.
- B. Correct.
Correct: Packaging the model and a custom inference script into a Docker image, then pushing it to ECR, is a valid method for deploying externally built models in SageMaker, especially for unsupported custom frameworks.
- C. Incorrect.
Incorrect: You cannot directly upload model artifacts to the SageMaker model registry without additional steps. SageMaker requires either a compatible inference container or custom deployment logic.
- D. Correct.
Correct: SageMaker's BYOM approach is specifically designed for integrating externally trained models. By specifying the S3 location of the model artifacts and an appropriate inference container, you can deploy external models seamlessly.
- E. Incorrect.
Incorrect: While AWS Lambda can deploy models, it bypasses SageMaker entirely and isn't a recommended method for leveraging SageMaker's inference capabilities. SageMaker supports external models through its BYOM and container-based approaches.