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: Highly Effective in Reducing LLM KV-Cache Fragmentation | 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: Highly Effective in Reducing LLM KV-Cache Fragmentation | HackerNoon
Computing

vAttention: Highly Effective in Reducing LLM KV-Cache Fragmentation | HackerNoon

News Room
Last updated: 2025/06/17 at 9:06 PM
News Room Published 17 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.4 Analysis of Memory Fragmentation

Table 8 shows the block size (defined as the minimum number of tokens in a page), and how much physical memory can be (theoretically) wasted due to over allocation in the worstcase. The worst-case occurs when a new page is allocated but remains completely unused. Further, we show each model under two TP configurations – TP-1 and TP-2 – to highlight the effect of TP dimension on block size.

vAttention allocates physical memory equivalent to the page size on each TP worker whereas the per-token physical memory requirement of a worker goes down as TP dimension increases (because KV heads get split across TP workers).

Table 8. Block size (number of tokens in a newly allocated physical memory page) as a function of the page size and TP configuration. Columns on the right show how much memory can be wasted per-request in the worst-case.Table 8. Block size (number of tokens in a newly allocated physical memory page) as a function of the page size and TP configuration. Columns on the right show how much memory can be wasted per-request in the worst-case.

Figure 12. Illustration of code changes required to replace the prefill attention kernel of FlashAttention with that of FlashInfer. vAttention supports dynamic memory allocation transparently, enabling easy switching between kernels.Figure 12. Illustration of code changes required to replace the prefill attention kernel of FlashAttention with that of FlashInfer. vAttention supports dynamic memory allocation transparently, enabling easy switching between kernels.

Therefore, block size increases proportionally with the TP dimension. Table 8 shows that this results in the smallest block sizes of 32 (Yi-34B TP-1) to 128 (Yi-6B TP-2). In terms of the amount of physical memory, 64KB page size results in a maximum theoretical waste of only 4-15MB per request which increases to 16-60MB for 256KB page size. Overall, the important point to note is that by controlling the granularity of physical memory allocation, vAttention makes memory fragmentation insignificant. Recall that serving throughput saturates at about 200 batch size for all of our models (Figure 6). Hence, even at such large batch sizes, the maximum theoretical memory waste is at most a few GBs. Therefore, similar to vLLM, vAttention is highly effective in reducing fragmentation and allows serving using large batch sizes. However, if required, page size can be reduced further to as low as 4KB which is the minimum page size supported in almost all architectures today, including NVIDIA GPUs [28].

Implementation Effort

The primary advantage of vAttention is portability: it enables one to seamlessly integrate new attention kernels without having to having to write a paged version of it or change the serving framework. For example, switching between the prefill or decode kernels of FlashAttention and FlashInfer requires only a few lines of code changes as shown in Figure 12. In contrast, in PagedAttention, the developers first need to write a paged attention kernel and then make significant changes in the serving framework. For example, integrating FlashInfer decode kernels in vLLM required more than 600 lines of code changes spread over 15 files [21, 22, 24]. Implementing the initial paging support in FlashAttention GPU kernel also required about 280 lines of code changes [20] and additional efforts to enable support for smaller block sizes [16]. Given the rapid pace of innovation in LLMs, we believe it is important to reduce programming burden: production systems should be able to leverage new optimizations of the attention operator without re-writing code – similar to how optimized implementations of GEMMs are leveraged by deep learning frameworks without programmer intervention.

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 Meta is making all Facebook videos reels
Next Article Tinder launches new feature to go on double dates – and it boosts match rates
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

Amazon Boss Tells Staff AI means their jobs are at risk in coming years
Software
Top 10 Marketing Budget Software to Track Spend in 2025
Computing
Meet the MOP – the 15-ton mega bomb Trump will unleash on Iran if it joins war
News
The GEEKOM Mini PC IT12 2025 Edition is the best Mini PC under £500 and delivers top performance and exceptional value | Stuff
Gadget

You Might also Like

Computing

Top 10 Marketing Budget Software to Track Spend in 2025

34 Min Read
Computing

Intel debuts Core Ultra 200V series processors, Lenovo to unveil new AI-capable devices later this week · TechNode

1 Min Read
Computing

Huawei reveals name of first tri-fold phone: the Mate XT · TechNode

1 Min Read
Computing

Former VP of SAIC, a VW partner, arrested for taking bribes · 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?