MLA-C02 practice question: Training with SageMaker AI (3 of 3)
ML Model and Foundation Model (FM) Development A free question from our original MLA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
A ski resort technology group has a proprietary C++ library that its snow-forecast model depends on. The library is compiled for a specific Linux distribution and cannot be installed through a framework container or a requirements file.
The team needs a managed SageMaker AI training job that runs this library, reads its data from Amazon S3 channels, and writes the model to the output location that SageMaker AI expects.
Which approach meets these requirements?
Choose one answer.
AA. Use a built-in algorithm for training, and call the C++ library from a preprocessing step that runs in a notebook instance before each training job starts.
BB. Install the library from source in a notebook instance, then start a framework estimator that runs in the default framework container.
CC. Run the training on a plain Amazon EC2 instance outside SageMaker AI, and write the model to Amazon S3 with a script.
DD. Build a Docker image that holds the library and training code, follows the SageMaker AI container contract, and push it to Amazon ECR for the job.
Show the answer and explanation
Answer: D
A. Wrong: The built-in algorithm would not run the library in training, and a notebook step outside the managed job breaks the single managed run the team wants. The stem asks for the library in the training job itself.
B. Wrong: The default container does not contain the library, and installing a compiled library in a notebook does not give the training job access to it. The stem depends on the job running the library itself.
C. Wrong: This runs the training outside SageMaker AI and loses the managed job, logs and artifact handling. The stem asks for a managed training job.
D. Right: Correct. A bring-your-own-container image can run any code, reading channel data from /opt/ml/input/data and writing the final model to /opt/ml/model, which SageMaker AI uploads to S3. The image is stored in Amazon ECR and referenced by the training job. Learn more: Containers with custom training algorithms (opens in a new tab)
Explanation
A bring-your-own-container image can include a compiled library and follow the SageMaker AI container contract, reading inputs from /opt/ml/input and writing the model to /opt/ml/model. Built-in algorithms, notebook steps and default framework containers cannot run the library inside the managed job.
Want more on Training with SageMaker AI? The 5 full-length practice sets have 8 more Training with SageMaker AI questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →