MLS-C01 Question 272
Single answerYou are working on a machine learning pipeline that processes large datasets using Amazon SageMaker. To ensure uniformity and reduce setup times, you want to create a reproducible environment for training jobs across multiple instances of the SageMaker notebook. You plan to pre-install necessary libraries, dependencies, and configurations. Which approach should you take to achieve this?
- A
Create a custom Amazon Machine Image (AMI) with the required libraries and configurations, and use it with your SageMaker notebook instances.
- B
Use an Amazon Elastic Container Registry (ECR) to build a custom Docker image with the required libraries, and attach it to the SageMaker notebook.
- C
Install the required libraries and configurations manually on each SageMaker notebook instance whenever you start a new session.
- D
Use an AWS Lambda function to dynamically install the required libraries and configurations whenever a SageMaker notebook starts.
Show answer and explanation
Correct answer: A
Explanation
Creating a custom Amazon Machine Image (AMI) is the best approach for ensuring consistent and reproducible environments in Amazon SageMaker. By pre-installing required libraries and configurations in the AMI, you can guarantee uniformity across different notebook instances while reducing setup times. This method is particularly useful for machine learning pipelines that rely on exact dependencies and configurations.
- A. Correct.
This is the correct approach because creating a custom AMI allows you to pre-install libraries, dependencies, and configurations. You can then use this AMI with SageMaker notebook instances to ensure consistency across environments.
- B. Incorrect.
While Amazon ECR and custom Docker images are useful for deploying and running machine learning models, this option is not specifically suited for creating reproducible notebook environments.
- C. Incorrect.
Manually installing libraries and configurations on each notebook instance is not reproducible and introduces the risk of human error, making it unsuitable for ensuring uniformity.
- D. Incorrect.
Using an AWS Lambda function to install libraries dynamically can lead to inconsistent environments and increased startup times, making it an inefficient solution for this use case.