Title here
Summary here
一条新提示到达时,系统先确定哪些文档已有 KV,再安排逐层读取。模型一边消费本层缓存,一边重算受新上下文影响较大的位置。
CacheBlend 系统由三个主要组件组成:
graph TB
subgraph "CacheBlend 系统架构"
User["用户查询"] --> Retriever["检索器"]
Retriever --> Controller["Loading Controller<br>加载控制器"]
subgraph "KV Cache Store"
CPU["CPU RAM"]
SSD["SSD"]
Disk["Slower Disks"]
end
Controller --> Store["KV Cache Store<br>KV缓存存储"]
Store --> CPU
Store --> SSD
Store --> Disk
Controller --> Fusor["Fusor<br>缓存融合器"]
Store --> Fusor
Fusor --> LLM["LLM 推理引擎"]
LLM --> Response["生成响应"]
end
style Controller fill:#87CEEB
style Fusor fill:#90EE90
style Store fill:#FFD700CacheBlend 在 vLLM 之上实现,约 3000 行 Python 代码。集成点包括:
graph TB
subgraph "vLLM + CacheBlend 集成"
subgraph "vLLM 核心"
Engine["LLM Engine"]
Executor["Model Executor"]
Runner["Model Runner"]
end
subgraph "CacheBlend 扩展"
Meta["cache_fuse_metadata"]
OldKV["old_kvs"]
Status["temp_status"]
end
subgraph "修改的模块"
LlamaModel["LlamaModel"]
LlamaAttn["LlamaAttention"]
XFormers["XFormers Backend"]
end
Engine --> Executor
Executor --> Runner
Runner --> LlamaModel
LlamaModel --> Meta
LlamaModel --> OldKV
LlamaModel --> Status
LlamaAttn --> XFormers
end下一步: Loading Controller(加载控制器)