TL;DR
CONTINUUM introduces a novel hardware-virtualization approach to efficiently manage memory for dynamic AI workloads, particularly Large Language Models (LLMs). By optimizing the GPU's memory management unit (MMU) and decoupling metadata preparation from mapping, it achieves microsecond-level memory mapping costs, enabling significant performance gains and simplifying the development of complex AI applications.
What Problem Does This Paper Address?
Modern AI workloads, especially LLMs, are becoming increasingly dynamic. They require extreme memory agility, meaning tensors need to grow, fork, and share memory flexibly. However, current deep learning frameworks like PyTorch rely on a "contiguous tensor abstraction" which, while good for static workloads, struggles with this dynamism. State-of-the-art inference systems like vLLM use "software-defined paging" to manage memory, but this sacrifices the contiguous abstraction and introduces a rigid segregation between paged and contiguous memory pools. This leads to underutilization of resources and a significant engineering burden for developers who must write specialized kernels to handle fragmented memory. The core problem is the high latency of traditional memory mapping operations, which prevents efficient, fine-grained memory management on the critical path of AI inference.
Methods
CONTINUUM tackles this by introducing a new hardware-virtualization primitive for GPU memory management. Its core innovation lies in optimizing the GPU's MMU:
- Enhanced VMM Engine (Backend Primitive): This is a high-performance driver extension that modifies the NVIDIA GPU driver. It transforms the traditional, slow control plane for memory mapping into a transactional, batched remapping primitive. This is achieved by decoupling metadata preparation (e.g., page table entries) from the actual mapping commitment. Key techniques include:
- Eager Virtual Reservation: The system eagerly sets up the page table hierarchy, ensuring the translation skeleton is physically resident before any inference request.
- Offline PTE Pre-calculation: Page table entry (PTE) binary formats are pre-calculated in host memory, decoupling this complex logic from the GPU execution timeline.
- Batched Transactional Mapping: Instead of serial operations, mappings are batched and committed via a single hardware transaction, reducing latency from milliseconds to microseconds.
- Elastic Tensor Abstraction (Frontend Interface): Built on top of the VMM backend, this is a PyTorch extension that provides a "contiguous tensor view" to upper-layer kernels. It decouples the virtual address space from physical residency, allowing tensors to be reserved (eagerly) without immediate physical memory commitment.
- Materialize: Physical pages are bound to the virtual address space on demand.
- Share (Zero-Copy Aliasing): This primitive allows creating new virtual views that map to the same physical pages as a source tensor, enabling efficient state sharing and branching without data movement.
- Release: Handles deallocation and invalidation of mappings.
- Workload Orchestration (Policies): This layer translates high-level algorithmic intent into low-level VMM operations, enabling dynamic memory management strategies like dynamic KV cache growth and zero-copy branching for reasoning topologies.
Datasets
Not discussed in the paper. The evaluation uses synthetic workloads and benchmarks based on existing LLM models and serving systems.
Key Insights and Ideas
- Hardware MMU is Underutilized: The GPU's native MMU is a powerful tool for dynamic memory management, but its potential is hampered by the high latency of traditional driver interfaces.
- Decoupling is Key: Separating metadata preparation from the actual mapping commitment is crucial for achieving microsecond-level latency.
- Virtual Contiguity Simplifies Development: By presenting a contiguous virtual address space, CONTINUUM allows unmodified, vendor-optimized kernels (like cuBLAS) to operate on dynamically managed memory, eliminating the need for specialized, complex kernels.
- Zero-Copy Aliasing is Powerful: The ability to share physical pages via MMU-level aliasing is a game-changer for dynamic workloads, enabling efficient state sharing and branching without costly data copies.
- Microsecond Latency Unlocks New Possibilities: The dramatic reduction in mapping latency makes fine-grained, on-demand memory management practical for the critical path of AI inference.
Key Results
- Mapping Latency Reduction: CONTINUUM reduces memory mapping costs from milliseconds to microseconds, achieving up to a 671.3x speedup over standard CUDA VMM APIs.
- Throughput Improvements:
- In Multi-LoRA serving, CONTINUUM outperforms vLLM by up to 3.29x, especially under high adapter oversubscription, by elastically mapping adapters on demand.
- For Engram (a sparse retrieval-augmented architecture), CONTINUUM achieves significantly higher throughput compared to traditional frameworks due to its virtual contiguity approach.
- In complex reasoning patterns (Tree-of-Thoughts), CONTINUUM achieves significant speedups (up to 7.65x) over vLLM at moderate branching intervals by using zero-copy aliasing.
- Portability: CONTINUUM has been successfully ported to NVIDIA's Hopper H20 architecture, demonstrating cross-generational portability without redesign.
Limitations and Future Work
Limitations:
- Device-Resident Memory Only: CONTINUUM currently focuses on optimizing GPU memory. It does not actively manage host memory (CPU RAM) for oversubscription or paging. This means it will report an Out-of-Memory (OOM) error if GPU capacity is saturated.
- Sub-Page Allocation: CONTINUUM inherits the GPU MMU's minimum page size (4KB), which can lead to internal fragmentation for very small tensors.
Future Work:
- Distributed and Disaggregated Serving: Extend CONTINUUM to support distributed systems and RDMA-attached memory, generalizing the Elastic Tensor abstraction.
- Host Memory Oversubscription: Implement host-memory offloading for cold tensor pages to expand effective capacity.
- Cross-Vendor Portability: Explore porting CONTINUUM to other hardware architectures like AMD/ROCm or emerging NPUs, leveraging its conceptually platform-agnostic design.
- Synergy with PyTorch Allocator: Combine CONTINUUM's elastic virtualization with PyTorch's sub-page packing allocator for a comprehensive memory management solution.
Summary updated