By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: vAttention Performance & Portability for LLM Prefill Phase | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > vAttention Performance & Portability for LLM Prefill Phase | HackerNoon
Computing

vAttention Performance & Portability for LLM Prefill Phase | HackerNoon

News Room
Last updated: 2025/06/14 at 12:25 AM
News Room Published 14 June 2025
Share
SHARE

Table of Links

Abstract and 1 Introduction

2 Background

2.1 Large Language Models

2.2 Fragmentation and PagedAttention

3 Issues with the PagedAttention Model and 3.1 Requires re-writing the attention kernel

3.2 Adds redundancy in the serving framework and 3.3 Performance Overhead

4 Insights into LLM Serving Systems

5 vAttention: System Design and 5.1 Design Overview

5.2 Leveraging Low-level CUDA Support

5.3 Serving LLMs with vAttention

6 vAttention: Optimizations and 6.1 Mitigating internal fragmentation

6.2 Hiding memory allocation latency

7 Evaluation

7.1 Portability and Performance for Prefills

7.2 Portability and Performance for Decodes

7.3 Efficacy of Physical Memory Allocation

7.4 Analysis of Memory Fragmentation

8 Related Work

9 Conclusion and References

7.1 Portability and Performance for Prefills

To evaluate the prefill phase, we focus on the attention kernels provided by FlashAttention v2.5.6 [9, 33] and FlashInfer v0.0.3 [11, 46]. We do not include vLLM in these experiments because it does not have a prefill kernel of its own but instead uses FlashAttention kernel. We also could not evaluate Yi-34B because FlashInfer kernels do not support Yi-34B’s KV group size of 7 [23].

FlashInfer is a library that recently introduced a set of attention kernels optimized for different scenarios e.g., for

Figure 8. Prefill tokens processed per second with chunking (chunk size=2048). Using vanilla prefill kernels, vAttention outperforms the paged counterpart of both FlashAttention and FlashInfer. Throughput for longer context lengths drops sharply due to quadratic complexity of prefill attention.Figure 8. Prefill tokens processed per second with chunking (chunk size=2048). Using vanilla prefill kernels, vAttention outperforms the paged counterpart of both FlashAttention and FlashInfer. Throughput for longer context lengths drops sharply due to quadratic complexity of prefill attention.

chunked-prefills – an optimization proposed in Sarathi [26] and later adopted in various systems [25, 36, 38]. Sarathi splits the input tokens of a prompt into multiple smaller chunks and schedules one chunk at a time, enabling a serving system to add new requests in a batch without pausing ongoing decodes. This helps improve throughput without increasing latency [25]. Both FlashAttention and FlashInfer provide kernels to compute the attention scores of chunkedprefills with and without PagedAttention. We integrate them into vLLM and using chunk size of 2048 tokens, measure time-to-first-token (TTFT) for the following configurations:

FA_Paged: Uses flash_attn_with_kv_cache kernel API of FlashAttention.

FI_Paged: Uses FlashInfer’s PagedAttention kernel, representing state-of-the-art PagedAttention-based kernel for the prefill phase.

FA_vAttention: Uses FlashAttention’s vanilla prefill kernel via the flash_attn_func API.

FI_vAttention: Uses FlashInfer’s vanilla prefill kernel via the single_prefill_with_kv_cache API.

Both vAttention configurations therefore use kernels that support chunked-prefills over a virtually contiguous KVcache. We add dynamic memory allocation support to them without having to modify their code.

Figure 8 shows the prefill throughput of the four configurations for Yi-6B and Llama-3-8B. In all cases, vAttention delivers consistently higher throughput, outperforming

Table 6. Time-to-first-token (TTFT) for a single prompt of varying context lengths.Table 6. Time-to-first-token (TTFT) for a single prompt of varying context lengths.

FA_Paged by 1.60 − 3.92× and FI_Paged by 1.03 − 1.45×. For the same experiment, Table 6 shows the TTFT with different context lengths. Since TTFT directly depends on prefill throughput, compared to using vanilla kernels with vAttention, FA_Paged and FI_Paged increase TTFT by up to 3.92× (Yi-6B, context length 192K) and 1.45× (Llama-3-8B, context length 192K), respectively.

The source of vAttention’s performance gain is twofold in these scenarios. First, the vanilla kernel is faster than the paged kernel in both FlashAttention and FlashInfer. While FlashAttention’s paged kernel is not optimized for prefills (it is optimized for decodes), FlashInfer’s paged kernel is specifically designed to support chunked-prefills. However, the paged kernel is slower than the vanilla kernel as discussed in §3.3. This example illustrates the complexities of transferring performance-critical optimizations between different implementations – even when the implementations are written by the same team. The second source of improvement is vAttention’s less CPU overhead. For example, appending a new K or V tensor to the KV-cache requires a single tensor copy operation in vAttention, whereas in a paged implementation, it requires appending one block at a time. Further, FlashInfer involves creation and deletion of a few objects for its compressed Block-Tables in every iteration. vAttention avoids such overheads because it maintains KVcache’s virtual contiguity and therefore does not require a Block-Table.

Authors:

(1) Ramya Prabhu, Microsoft Research India;

(2) Ajay Nayak, Indian Institute of Science and Contributed to this work as an intern at Microsoft Research India;

(3) Jayashree Mohan, Microsoft Research India;

(4) Ramachandran Ramjee, Microsoft Research India;

(5) Ashish Panwar, Microsoft Research India.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article I got ChatGPT to rate my dinner and it found TWO hidden dangers in my diet
Next Article Sacha Baron Cohen & Isla Fisher FINALLY finalise divorce after toxic split
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

I’ve been using Google Photos for 10 years and this is what I want to see in the next 10 years
News
How to Create a Cost Management Plan (+Template) |
Computing
Walmart is selling outdoor cooking set for $25 & it is perfect Father’s Day gift
News
How AI Is Revolutionizing Agile Program Management with Confluence & Streamlit | HackerNoon
Computing

You Might also Like

Computing

How to Create a Cost Management Plan (+Template) |

28 Min Read
Computing

How AI Is Revolutionizing Agile Program Management with Confluence & Streamlit | HackerNoon

17 Min Read
Computing

Haiku OS Restores EXT4 Compatibility, RISC-V Once Again Booting

1 Min Read
Computing

Chinese flying car startup completes first low-altitude flight in Japan · TechNode

1 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?