MLA-C01 Practice Question 46: Framework Container Script Mode
AWS Certified Machine Learning Engineer – Associate (MLA-C01) · Test 5 · question 6 of 10
A team has a working PyTorch training script that it has been running on an on-premises GPU server. It wants to run the script as SageMaker AI training jobs with as few changes as possible. The script depends on a supported PyTorch version plus two extra open-source packages from PyPI, timm and albumentations. The team has no one to maintain Docker images and wants AWS to keep patching the training environment.
What is the most appropriate way to run the training?
Show answer and explanation
Answer:
When a custom model uses a framework that has a prebuilt SageMaker AI container, such as PyTorch, the simplest path is *script mode*. SageMaker AI runs the team's own script inside the AWS-managed framework image. If the script needs extra packages, AWS's guidance is to first check whether the prebuilt image accepts a requirements.txt file, which the framework containers install at startup. Extending the image is only the next step if that is not enough. The script stays nearly unchanged, and AWS maintains and patches the image (option A).
- B is wrong because it works but brings back image maintenance. Every time AWS releases a patched base image, the team has to rebuild and re-push its extended image, which is the work it wanted to avoid for just two pip packages. - C is wrong because building an image from scratch puts all of the patching, CUDA compatibility, and toolkit integration on the team. It is the most maintenance-heavy option, meant for frameworks with no prebuilt container. - D is wrong because moving to a built-in algorithm means discarding the working script, and a built-in algorithm cannot reproduce an arbitrary PyTorch architecture or data augmentation pipeline.
Reference: Docker containers for training and deploying models - Scenarios