A captioning model is accurate but too slow for real-time use on an NVIDIA GPU. Which step usually gives the biggest inference speedup without retraining?
- 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.
Efficiency at inference time matters as much as training speed.
Why D is the answer
Optimize it with TensorRT and batch incoming requests
TensorRT compiles the model into an optimized engine with fused kernels and lower precision, and batching keeps the GPU busy. Together they cut latency and raise throughput without retraining.
Remember: TensorRT plus batching speeds up inference.
How it works
Inference optimization includes compiling with TensorRT, lower precision and request batching.
In detail
- TensorRT optimizes inference engines.
- Batching raises GPU utilization.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Add more layers so the model needs fewer decoding steps per captionWrongMost tempting
More layers add compute per step.
Why it tempts: Fewer steps sounds faster, but more layers cost more per step.
B. Rewrite the model in pure Python loops so each step is easier to profileWrong
Python loops are slower than optimized kernels.
C. Run every request one at a time with the GPU clocks lowered to save powerWrong
Single requests and low clocks waste the GPU.
D. Optimize it with TensorRT and batch incoming requestsRight
TensorRT plus batching speeds up inference.
Use case
An illustrative scenario, not a real incident.
Illustrative: a TensorRT engine with dynamic batching triples requests per second on the same GPU.
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 LR S0["Export the model"] --> S1["Build a TensorRT engine"] --> S2["Pick precision"] --> S3["Enable batching"] --> S4["Benchmark"]
How to read this chart
- Read it in order: Export the model, then Build a TensorRT engine, then Pick precision, then Enable batching, then Benchmark.