Guide-linked quiz · Medium Level
GPU Memory Management and Fragmentation Quiz
Test GPU allocated versus reserved memory, allocator reuse, and fragmentation diagnosis, including the limits of empty_cache and expandable segments.
Question 1 of 8
What is GPU memory fragmentation?
Preview every question8 questions
Answers and explanations appear as you take the quiz.
- What is GPU memory fragmentation?
- When the GPU physically breaks apart
- When the model has too many layers
- When two GPUs disagree on a result
- When free memory is split into scattered chunks too small to satisfy a large contiguous request
- Why do frameworks like PyTorch use a caching memory allocator?
- To make the model more accurate
- To avoid slow direct driver allocation/free calls by reusing pooled memory blocks
- To encrypt the weights
- To reduce the number of GPUs needed to one
- A CUDA allocation fails despite apparently unused reserved memory. What should a developer investigate?
- Whether fragmentation is proven by the error alone
- Whether all live tensors have already been freed
- Whether inactive split blocks or other allocations explain the failure
- Whether changing the learning rate releases GPU memory
- Which PyTorch allocator option can be tested for changing-size workloads that leave unused memory slivers?
- Expandable segments in the allocator configuration
- Increasing every tensor dimension
- Disabling the GPU cooling system
- Increasing the optimizer learning rate
- What does vLLM's PagedAttention manage to reduce memory waste during inference?
- The model's training data
- The attention key-value (KV) cache, using fixed-size pages
- The GPU's clock speed
- The font size of logs
- Which technique reduces activation memory to help avoid out-of-memory errors?
- Adding more layers
- Using a longer learning-rate warmup
- Gradient checkpointing (recomputation)
- Saving more checkpoints to disk
- A live CUDA tensor still has Python references. Will empty_cache release that tensor’s allocation?
- No; it releases unused cached memory rather than live tensor storage
- Yes; it deletes every referenced tensor
- Yes; it moves the tensor automatically to NVMe
- Only if the tensor contains zero values
- PyTorch reports reserved memory greater than allocated memory. What distinction explains the gap?
- Reserved memory measures only CPU RAM
- Allocated memory includes every process on the GPU
- The difference directly proves a model accuracy error
- The allocator can retain cached blocks beyond memory currently used by tensors
Keep testing yourself
More quizzes picked for your level.