引导式测验 · 中等 等级
KV 缓存优化测验
检查 KV 缓存增长、分页分配、分组查询共享、前缀重用条件、量化以及上下文和并发性的内存扩展。
问题 1 的 8
KV 缓存存储什么以及为什么?
预览每个问题8 问题
当您参加测验时,就会出现答案和解释。
- KV 缓存存储什么以及为什么?
- 先前计算的注意键和值,因此不会在每个步骤中重新计算它们
- 用于再训练的模型训练数据
- 用于身份验证的用户密码
- 仅最终文本输出
- 为什么KV缓存会成为内存问题呢?
- 它会永久损坏 GPU
- 它随着序列长度、批量大小和层数而增长,有时超过模型权重
- 它仅适用于少于 10 个单词的文本
- 它复制操作系统
- PagedAttention 借用了什么操作系统概念?
- 磁盘碎片整理实用程序
- 防病毒扫描
- 具有固定大小块的虚拟内存分页
- 屏幕分辨率缩放
- Grouped-Query 和 Multi-Query Attention 如何减少 KV 缓存大小?
- 通过删除注意力机制
- 通过将缓存存储为图像
- 通过更少的数据进行训练
- 通过让许多查询头共享更少的键/值头
- KV 缓存中前缀共享的好处是什么?
- 具有相同启动提示的请求可以重用相同的缓存块
- 它对模型进行加密
- 它同样减慢了每个请求的速度
- 它消除了关注的需要
- Compared with storing the same KV entries in 16-bit, what does 8-bit storage do to raw cache-value bytes?
- It doubles the raw bytes
- It roughly halves the raw bytes, before metadata and other runtime memory
- It removes the key and value tensors entirely
- It guarantees twice the inference speed
- With full-context attention, no prefix sharing, and a fixed model and cache dtype, what happens if sequence length and batch size both double?
- It stays constant because model weights are fixed
- It roughly doubles
- Raw KV storage grows to roughly four times its previous size
- It becomes one quarter as large
- What must generally match for two requests to reuse the same cached prefix blocks?
- Only the user account name
- The requests must have different model weights
- The prompts must have the same character count but different tokens
- Their tokenized prefix and relevant model/cache configuration must be compatible