atlas

Research map / Large language models / Reasoning and chain of thought

KV-Runahead: Scalable Causal LLM Inference by Parallel Key-Value Cache Generation

ICML 2024 · Large language models › Reasoning and chain of thought · approach: KV cache compression · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes KV-Runahead, a parallel prefill scheme that reuses the KV-cache interface to pass keys/values point-to-point between processes with context-level load balancing, reducing time-to-first-token for causal LLMs.

Problem

Time-to-first-token (prompt/prefill phase) of long-context causal LLM inference is compute-bound, and existing tensor/sequence parallelism wastes computation and communication by ignoring causality and relying on all-gather.

Approach

Dual-purpose the KV-cache so that each process computes Q/K/V for an unevenly sized context chunk and passes its growing KV-cache to the next process via point-to-point send/recv, exploiting causality; partition sizes are chosen by hierarchical grid search and interpolated from a lookup table.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use KV-Runahead with searched context partitioning instead of TSPLlama 7B · Contexts 1k–16k, 4 and 8 GPUsTTFT speedup: 1.11 to 1.42; 1.14 to 1.41Helped
Use KV-Runahead with searched context partitioning instead of TSPFalcon 7B · Contexts 1k–8k, 4 and 8 GPUsTTFT speedup: 1.12 to 1.46; 1.20 to 1.63Helped
Use KV-Runahead with searched context partitioning instead of TSPLlama 13B · Contexts 1k–16k, 4 and 8 GPUsTTFTHelped
Use KV-Runahead with searched context partitioning instead of TSPFalcon 1B · Contexts 1k–8k, 4 and 8 GPUsTTFTHelped
Use KV-Runahead with searched context partitioning instead of TSPLlama 30B · Contexts 1k–2k, 4 and 8 GPUsTTFTHelped
Use even context partitioning rather than searched context partitioning (ablation)KV-Runahead · Falcon 7B, 4k contextTTFTHurt
Use searched context partitioning instead of even context partitioning (ablation)KV-Runahead · Falcon 7B, 4k context, 4 GPUsTTFT speedup: +1.30 speedup over TSPHelped
Use predicted/interpolated context partitions instead of searched partitions (ablation)KV-Runahead · Llama 7B, 10k and 12k contextsTTFT: within 1.3%No clear effect
Use MQA instead of MHA (ablation)Llama 7B with KV-Runahead · 16k context, 8 GPUsTTFT speedup over TSP: 1.41x -> 1.48xHelped
Use GQA8 instead of MHA (ablation)Llama 7B with KV-Runahead · 16k context, 8 GPUsTTFT speedup over TSP: 1.41x -> 1.46xHelped
Use KVR point-to-point communication instead of TSP all-gatherKV-Runahead · 8k, 12k, and 16k contexts with non-uniform bandwidthTTFT degradation: over 10% -> up to 3.7%Helped
Use 4 GPUs instead of 2 GPUsParallel inference on Llama 7B · 2k context, 10GB/sTTFT: 0.16sec -> 0.19secHurt

Surprising findings

Limitations

Experimental setup

Metrics: time-to-first-token (TTFT) speedup over TSP

Baselines: TSP (tensor/sequence parallelism) KVR-E TTFT lower bound TTFT*(p)

Builds on: tensor parallelism sequence parallelism (ring attention) KV-cache

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy