Skip to content

Commit e34cc7e

Browse files
authored
Merge pull request #36 from LMCache/kuntai-add-spf
Add shortest prefill first.
2 parents 78dcbd0 + 1bc678b commit e34cc7e

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
layout: post
3+
title: "Shortest Prefill First—Smarter Scheduling for Faster Prefill!"
4+
thumbnail-img: /assets/img/shortest_prefill_first.png
5+
share-img: /assets/img/shortest_prefill_first.png
6+
author: Kuntai Du
7+
image: /assets/img/shortest_prefill_first.png
8+
---
9+
10+
***TL;DR:*****Shortest Prefill First (SPF)** scheduling cuts LLM time-to-first-token by up to **18%** in prefill-decode disaggregation—unlocking even greater gains when combined with LMCache!
11+
12+
<div align="center">
13+
<img src="/assets/img/shortest_prefill_first.png" alt="comparison" style="width: 97%; vertical-align:middle;">
14+
<p><em>Shortest prefill first significantly reduces request waiting time</em></p>
15+
</div>
16+
17+
---
18+
19+
At LMCache Lab, we’re obsessed with LLM performance. As prefill-decode disaggregation becomes the norm, we spotted a major, untapped scheduling opportunity for prefill nodes.
20+
That’s why we developed **SPF** (Shortest Prefill First, introduced in our SOSP 2025 [paper](https://arxiv.org/pdf/2505.07203)), a scheduling strategy that always serves requests with the shortest prefill time first. This reduces queueing delays across the board and gets your users their results faster.
21+
We’ve implemented a proof-of-concept for SPF in vLLM ([PR](https://github.com/vllm-project/vllm/pull/21558)).
22+
23+
## Benchmarking SPF 📊
24+
25+
Here’s a side-by-side comparison of *mean* and *median* time-to-first-token (TTFT) for leading LLM serving platforms (200 random input lengths averaging 10,000; output length = 1; all requests arriving at once):
26+
27+
| Approach | Mean TTFT (ms) | Median TTFT (ms) |
28+
|--------------------|---------------:|-----------------:|
29+
| **vLLM (native)** | 7,500.75 | 6,280.66 |
30+
| **vLLM (SPF)** | 6,116.30 | 4,816.27 |
31+
| **Fireworks** | 8,052.40 | 7,943.03 |
32+
| **DeepInfra** | 7,664.74 | 6,564.00 |
33+
34+
**Takeaway:**
35+
Shortest Prefill First delivers an **18% reduction** in mean TTFT compared to native vLLM, with even larger gains over Fireworks and DeepInfra. The median TTFT improvements are just as strong—SPF consistently delivers faster results from your hardware!
36+
37+
## SPF unlocks even more with LMCache 🌟
38+
39+
The real power of SPF emerges when paired with an advanced KV cache layer.
40+
SPF boosts your KV cache hit rate by enhancing cache locality—requests that benefit most from the cache (and thus have shorter prefill times) are prioritized. To maximize the benefits, SPF and the KV cache system should work hand-in-hand.
41+
We’re actively integrating SPF with **LMCache**—the most advanced KV cache layer available—unlocking even more dramatic speedups and cost savings at scale.
42+
43+
## Want to try it out? 🤩
44+
45+
Ready for these speedups out-of-the-box? **LMIgnite** is your one-click solution for LLM deployment. It’s easy, multi-tenant, and delivers top-tier performance—including SPF and other cutting-edge research—without any engineering hassle.
46+
**Sign up** [here](https://lmignite.tensormesh.ai/) for early access.
47+
48+
Faster prefill, faster decode, more efficient infra—the LMCache Lab way! 🚀
49+
50+
## Contacts
51+
- **LMCache Github: [https://github.com/LMCache/LMCache](https://github.com/LMCache/LMCache)**
52+
- **Chat with the Developers** **[Interest Form](https://forms.gle/mQfQDUXbKfp2St1z7)**
53+
- **LMCache [slack](https://join.slack.com/t/lmcacheworkspace/shared_invite/zt-2viziwhue-5Amprc9k5hcIdXT7XevTaQ)**
54+
- **vLLM Production-Stack [channel](https://vllm-dev.slack.com/archives/C089SMEAKRA)**
83.8 KB
Loading

0 commit comments

Comments
 (0)