Courseiva
Machine Learning Implementation and OperationshardMultiple ChoiceObjective-mapped

MLS-C01 Practice Question: Machine Learning Implementation and Operations

Exhibit

2023-01-15 10:30:45,123 INFO - Training job started
2023-01-15 10:30:50,567 INFO - Epoch 1/10: loss=2.345, accuracy=0.45
2023-01-15 10:31:00,789 INFO - Epoch 2/10: loss=2.123, accuracy=0.52
2023-01-15 10:31:10,012 INFO - Epoch 3/10: loss=1.987, accuracy=0.58
...
2023-01-15 10:32:30,456 ERROR - OutOfMemoryError: CUDA out of memory. Tried to allocate 2.00 GiB (GPU 0; 15.90 GiB total capacity; 14.00 GiB already allocated; 1.50 GiB free; 14.10 GiB reserved in total by PyTorch)
2023-01-15 10:32:30,457 ERROR - Training terminated

Refer to the exhibit. A data scientist is training a PyTorch model on a SageMaker ml.p3.2xlarge instance (16 GB GPU memory). The training fails with the shown error. Which change should the scientist make to resolve the error?

⚠ Common exam trap

Many candidates confuse distributed training (more instances) with reducing per-instance memory pressure, or assume cost-saving features like Spot Training address resource exhaustion, when in fact only reducing batch size directly lowers GPU memory usage.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Reduce the batch size in the training script.

The error is an out-of-memory (OOM) condition on the GPU. Reducing the batch size directly decreases the memory footprint per training step, allowing the model to fit within the 16 GB GPU memory of the ml.p3.2xlarge instance. This is the most immediate and effective fix for a GPU memory exhaustion error in PyTorch.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Reduce the batch size in the training script.

    Why this is correct

    Smaller batch size reduces GPU memory consumption.

  • Increase the number of instances to 2.

    Why it's wrong here

    More instances do not reduce per-GPU memory usage.

  • Use SageMaker Managed Spot Training.

    Why it's wrong here

    Spot does not solve memory errors.

  • Increase the number of epochs.

    Why it's wrong here

    More epochs will still run out of memory.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This MLS-C01 question is part of Courseiva's 1,672-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.