AIF-C01 Fundamentals of AI and ML Practice Question
Exhibit
{
"TrainingJobName": "my-training-job-1",
"TrainingJobStatus": "Failed",
"FailureReason": "AlgorithmError: OutOfMemoryError: CUDA out of memory. Tried to allocate 4.00 GiB (GPU 0; 8.00 GiB total capacity; 3.95 GiB already allocated; 2.50 GiB free; 4.00 GiB reserved in total by PyTorch)"
}Refer to the exhibit. A data scientist ran a training job on Amazon SageMaker. The job failed with the error shown. What is the most likely cause?
⚠ Common exam trap
AWS often tests the distinction between infrastructure errors (S3, IAM) and runtime errors (CUDA memory), where candidates mistakenly attribute a GPU memory error to a misconfiguration in data access or code syntax.
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 batch size is too large for the instance's GPU memory
The error message indicates a CUDA out-of-memory error, which occurs when the GPU memory is insufficient for the requested batch size. Option D is correct because increasing the batch size beyond the GPU's memory capacity causes the training job to fail with this specific error.
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 S3 input path is incorrect
Why it's wrong here
SageMaker validates the S3 URI and fails fast with a validation error before the job starts when a bucket or prefix is malformed; a job that launched and then failed points to a runtime cause such as missing permissions or absent objects. An incorrect path suits pre-flight validation failures, not mid-execution errors.
- ✗
The IAM role does not have permission to access S3
Why it's wrong here
The exhibit's error is a client-side Python exception from the training script, not an S3 AccessDenied or ClientError, so IAM permissions are irrelevant here. An IAM role lacking S3 permissions is tempting because SageMaker training jobs commonly fail that way, and it would be correct if the log showed an access-denied message when reading the input channel.
- ✗
The training code has a syntax error
Why it's wrong here
A syntax error would surface as a Python SyntaxError during script parsing, before any training loop or dataset access; the exhibit's error occurs later, so the code parsed successfully. Syntax errors are tempting because training scripts do fail on them, and this would be correct if the log showed a traceback at import or compile time.
- ✓
The batch size is too large for the instance's GPU memory
Why this is correct
A batch size exceeding GPU memory triggers an out-of-memory failure during the forward or backward pass, since activations for the whole batch must be held simultaneously. Reducing the batch size, or using gradient accumulation, directly addresses this constraint rather than altering the model architecture.
Go deeper
Related to this question
About these practice questions
One of 862 original AIF-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AIF-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 AIF-C01 exam.