Courseiva
Applications of Foundation ModelsmediumMultiple ChoiceObjective-mapped

AIF-C01 Applications of Foundation Models Practice Question

Exhibit

Refer to the exhibit.

SageMaker Training Job Configuration:
{
  "AlgorithmSpecification": {
    "TrainingImage": "763104351884.dkr.ecr.us-west-2.amazonaws.com/huggingface-pytorch-training:1.13.1-transformers4.26.0-gpu-py39-cu117-ubuntu20.04",
    "TrainingInputMode": "File"
  },
  "HyperParameters": {
    "epochs": "3",
    "per_device_train_batch_size": "8",
    "learning_rate": "2e-5",
    "max_seq_length": "512"
  },
  "InputDataConfig": [
    {
      "ChannelName": "train",
      "DataSource": {
        "S3DataSource": {
          "S3DataType": "S3Prefix",
          "S3Uri": "s3://my-bucket/train/"
        }
      },
      "ContentType": "text/csv"
    }
  ],
  "OutputDataConfig": {
    "S3OutputPath": "s3://my-bucket/output/"
  },
  "ResourceConfig": {
    "InstanceType": "ml.p3.2xlarge",
    "InstanceCount": 1,
    "VolumeSizeInGB": 50
  },
  "RoleArn": "arn:aws:iam::123456789012:role/SageMakerRole",
  "StoppingCondition": {
    "MaxRuntimeInSeconds": 86400
  }
}

Refer to the exhibit. The training job is failing with an error 'CUDA out of memory'. Which hyperparameter change is MOST likely to resolve the issue?

⚠ Common exam trap

AWS often tests the misconception that increasing epochs or learning rate can fix resource exhaustion errors, when in fact only adjustments that reduce per-step memory usage (like batch size or sequence length) are effective.

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 per_device_train_batch_size to 4

The 'CUDA out of memory' error indicates that the GPU memory is exhausted during training. Reducing `per_device_train_batch_size` directly decreases the number of samples processed simultaneously per GPU, which lowers memory consumption for activations, gradients, and optimizer states. This is the most direct and effective hyperparameter change to resolve an out-of-memory condition.

Answer analysis

Option-by-option breakdown

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

  • Increase the number of epochs to 10

    Why it's wrong here

    Increasing epochs does not reduce memory footprint; it increases training time.

  • Increase learning_rate to 5e-4

    Why it's wrong here

    Learning rate does not affect memory usage.

  • Reduce per_device_train_batch_size to 4

    Why this is correct

    Smaller batch size uses less GPU memory.

  • Increase max_seq_length to 1024

    Why it's wrong here

    Longer sequences consume more memory, worsening the OOM error.

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

Courseiva writes every AIF-C01 question from scratch — 619 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 →

How Courseiva writes practice questions · Editorial policy

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.