Parallel prefetching: The secret sauce for faster LLM inference.
PRESERVE optimizes LLM inference by cleverly prefetching model weights and KV-cache data during communication operations, reducing memory bottlenecks and communication overhead.
-----
https://arxiv.org/abs/2501.08192
Original Problem π:
LLM inference faces two critical challenges - HBM bandwidth bottlenecks limiting single-device performance, and significant communication overhead in distributed settings. The combined effect severely impacts inference speed and cost-efficiency.
-----
Solution in this Paper π§:
β PRESERVE introduces a novel prefetching framework that overlaps memory reads with collective communication operations
β The framework automatically inserts prefetch operators into computational graphs without requiring code modifications
β It intelligently manages L2 cache utilization to prevent cache pollution
β The system uses parallel streams to synchronize prefetching and communication operations
β A graph optimization algorithm dynamically tracks prefetched data and estimates L2 cache usage during compilation
-----
Key Insights π‘:
β Optimal L2 cache size increases from 8MB to 104MB when prefetching is considered
β Maximum speedup occurs when allreduce and prefetch latencies match
β Network bandwidth significantly impacts prefetching effectiveness
β Cluster size influences the balance between prefetch and communication latencies
-----
Results π:
β Up to 1.6x end-to-end speedup on state-of-the-art LLMs
β 1.25x improvement in performance per cost with optimal L2 cache configuration
β Demonstrated scalability across various batch sizes and sequence lengths










