Training an image-text model on modern NVIDIA GPUs is slow and memory-bound. Which change usually speeds it up with little accuracy loss?
- Exam domain
- Performance Optimization10% of the exam
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why the exam asks this
Performance Optimization (10% of the exam)
Objective in the exam guide: Enhance computational efficiency and improve the accuracy of outputs in AI models.
Computational efficiency is a core optimization task.
Why D is the answer
Use automatic mixed precision
Automatic mixed precision runs most math in FP16 or BF16 on Tensor Cores and keeps sensitive parts in FP32, cutting memory and time with little or no accuracy loss.
Remember: Mixed precision is the first speed lever.
How it works
Mixed precision stores and computes in lower precision where safe, using Tensor Cores for speed.
In detail
- Mixed precision uses Tensor Cores.
- Loss scaling protects FP16 gradients.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Increase the image resolution four timesWrong
Higher resolution adds work.
B. Switch all computation to FP64WrongMost tempting
FP64 is slower and uses more memory.
Why it tempts: Higher precision sounds more accurate.
C. Turn off the GPU and train on the CPUWrong
CPUs are much slower for this.
D. Use automatic mixed precisionRight
Mixed precision is the first speed lever.
Use case
An illustrative scenario, not a real incident.
Illustrative: enabling mixed precision cuts epoch time by about 40% and halves activation memory.
See it in different ways
mindmap
root(("Optimization"))
n1["Precision"]
n2["Mixed precision"]
n3["Quantization"]
n4["Search"]
n5["Learning rate"]
n6["Batch size"]
n7["Reuse"]
n8["Transfer learning"]
n9["Fine-tune a pretrained model"]
n10["Serving"]
n11["TensorRT"]
n12["Batching"]How to read this chart
- The centre is "Optimization".
- "Precision" covers "Mixed precision", "Quantization".
- "Search" covers "Learning rate", "Batch size".
- "Reuse" covers "Transfer learning", "Fine-tune a pretrained model".
- "Serving" covers "TensorRT", "Batching".
flowchart TD
Q{"GPU supports BF16?"}
Q -->|"Yes"| A0["BF16 mixed precision"]
Q -->|"No"| A1["FP16 with loss scaling"]How to read this chart
- At "GPU supports BF16?": if "Yes", go to "BF16 mixed precision"; if "No", go to "FP16 with loss scaling".