LLM 推理性能核心框架:Prefill 拼算力,Decode 拼带宽,KV 缓存决定显存代价
中文摘要
LLM推理核心框架:Prefill阶段瓶颈在于算力,Decode阶段瓶颈在于内存带宽,KV缓存决定显存成本。
English Summary
LLM inference framework: Prefill is compute-bound, Decode is memory bandwidth-bound, and KV cache determines VRAM cost.
原文节选
作者整理了 llama.app 的推理概念文档(https://llama.app/docs/prefill-vs-decode),提出核心框架:Prefill 阶段并行读入 prompt、瓶颈在算力,Decode 阶段逐 token 自回归、瓶颈在内存带宽。