Auto-sync: update nexus workspace

This commit is contained in:
2026-04-28 07:26:52 +08:00
parent b83b4e3105
commit 3224ec4787
436 changed files with 17107 additions and 15920 deletions

23
wiki/concepts/KV-Cache.md Normal file
View File

@@ -0,0 +1,23 @@
---
title: "KV Cache"
type: concept
tags: [kv-cache, inference, llm, optimization]
aliases: [KV Cache, Key-Value Cache, KV缓存]
last_updated: 2025-12-20
---
## Definition
KV Cache大语言模型推理过程中的缓存机制。KKey和 VValue是由每个 Token 的向量通过线性变换得到的两类向量用于注意力计算。KV Cache 将这些历史 K/V 保存下来,避免后续解码步骤重复计算。
## Key Facts
- 节省计算:无需每次都重新计算历史 Token 的注意力
- 显存开销KV Cache 随上下文长度、层数、头数、维度线性增长,是推理中最大的显存开销来源之一
- [[vLLM]] 的核心优化对象
- [[PagedAttention]] 通过分块管理解决其碎片化问题
## Connections
- [[vLLM]] ← 优化 ← [[KV Cache]]
- [[PagedAttention]] ← 解决 ← [[KV Cache]] 的碎片化问题
## Sources
- [[大模型相关术语和框架总结llm-mcp-prompt-rag-vllm-token-数据蒸馏]]