Home/Algo Bridge/LRU / LFU Cache (Hash + Doubly Linked List)/LC_146
⚡ Practice in Flashcards
🌉 Problem-Level AI BridgeLC_146 · 中等

LC_146 (LRU Cache) ➔ PagedAttention: Virtual Memory Block Table Mapping

Doubly linked list paired with hash table guarantees O(1) eviction and lookup for recency-based memory retention.

1️⃣ 1️⃣ Classical DSA Origin

LC_146 · LRU Cache

Pattern: LRU / LFU Cache (Hash + Doubly Linked List) — Hybrid architecture combining hash table with a doubly linked list. The hash table provides O(1) direct address lookup, while the doubly linked list maintains recency access order (LRU) or frequency (LFU) for O(1) insertion, elevation, and eviction.

⚡ Open LC-146 Solution ➔
2️⃣ 2️⃣ Production AI System Transfer

vLLM PagedAttention & Block-Paged KV Cache · PagedAttention: Virtual Memory Block Table Mapping

Industrial Application: Powers vLLM block eviction and SGLang RadixAttention node pruning when GPU HBM approaches allocation thresholds.

🧬 Target AI Kernel Interface
def paged_attention(Q: torch.Tensor, K_cache: torch.Tensor, V_cache: torch.Tensor, block_tables: torch.Tensor, context_lens: torch.Tensor, block_size: int = 16) -> torch.Tensor

🔗 Related Algorithmic Bridges

LC_239 ➔ PagedAttention: Virtual Memory Block Table Mapping
Algorithmic foundation connecting classic data structures to LLM high-pe...
LC_146 ➔ RadixAttention: Longest Prefix Match KV Cache
Doubly linked list paired with hash table guarantees O(1) eviction and l...
LC_146 ➔ Prefix Cache Attention Block
Doubly linked list paired with hash table guarantees O(1) eviction and l...
LC_460 ➔ PagedAttention: Virtual Memory Block Table Mapping
Algorithmic foundation connecting classic data structures to LLM high-pe...
LC_380 ➔ PagedAttention: Virtual Memory Block Table Mapping
Algorithmic foundation connecting classic data structures to LLM high-pe...
← LC_146 (LRU Cache) → SGLang RadixAttention Prefix Caching & KV Tree ManagementLC_460 (LFU Cache) → vLLM PagedAttention & Block-Paged KV Cache →