引导式测验 · 中等 等级

GPU 内存管理和碎片测验

测试 GPU 分配与保留内存、分配器重用和碎片诊断,包括empty_cache 和可扩展段的限制。

相关引导路径GPU 内存管理与分片
问题 1 的 8

什么是 GPU 内存碎片?

预览每个问题8 问题

当您参加测验时,就会出现答案和解释。

  1. 什么是 GPU 内存碎片?
    • 当 GPU 发生物理损坏时
    • 当模型层数过多时
    • 当两个 GPU 对结果不一致时
    • 当空闲内存被分割成太小的分散块而无法满足大的连续请求时
  2. 为什么像 PyTorch 这样的框架使用缓存内存分配器?
    • 为了使模型更加准确
    • 通过重用池内存块来避免缓慢的直接驱动程序分配/释放调用
    • 对权重进行加密
    • 将所需 GPU 数量减少到 1 个
  3. 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
  4. 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
  5. vLLM 的 PagedAttention 如何减少推理过程中的内存浪费?
    • 模型的训练数据
    • 注意力键值(KV)缓存,使用固定大小的页面
    • GPU 的时钟速度
    • 日志的字体大小
  6. 哪种技术可以减少激活内存以帮助避免内存不足错误?
    • 添加更多层
    • 使用更长的学习率预热
    • 梯度检查点(重新计算)
    • 将更多检查点保存到磁盘
  7. 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
  8. 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