MLS-C01 Modeling Practice Question
A data scientist is training a deep learning model on Amazon SageMaker using a custom Docker container. The training job fails with an error 'OutOfMemoryError: CUDA out of memory'. The instance type is ml.p3.2xlarge (8 GB GPU memory). The model has 50 million parameters. What is the most likely cause and solution?
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
✓
The model uses FP32 precision; enable mixed precision training
A model with 50 million parameters in FP32 precision requires approximately 200 MB per parameter (4 bytes each = 200 MB for 50M), plus additional memory for activations, gradients, and optimizer states, which can easily exceed the 8 GB GPU memory of ml.p3.2xlarge. Mixed precision training (FP16) halves the memory usage for tensors, reducing the overall footprint and often fitting the model within GPU limits. Option A (instance type) may solve the problem but is more expensive and unnecessary if mixed precision works. Option B (batch size) is a contributing factor but not the most likely root cause, as even a batch size of 1 may still cause OOM due to parameter storage. Option C (gradient checkpointing) trades compute for memory by recomputing activations, but does not address the primary issue of parameter storage in FP32. Therefore, enabling mixed precision is the most direct and cost-effective solution.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The instance type is insufficient; switch to ml.p3.8xlarge
Why it's wrong here
Upgrading instance is costly; mixed precision is a better first step.
- ✗
The batch size is too large; reduce batch size
Why it's wrong here
Reducing batch size helps but may not be enough; mixed precision is more effective.
- ✗
Enable gradient checkpointing to reduce memory
Why it's wrong here
Gradient checkpointing trades compute for memory, but mixed precision directly reduces memory footprint.
- ✓
The model uses FP32 precision; enable mixed precision training
Why this is correct
Mixed precision (FP16) halves memory usage, fitting the model into 8 GB.
Go deeper
Related to this question
About these practice questions
Courseiva writes every MLS-C01 question from scratch — 1,672 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.