Abstract
RAGDoll is a resource-efficient serving system designed to enable high-performance Retrieval-Augmented Generation (RAG) on single consumer-grade GPUs. By decoupling retrieval and generation into parallel pipelines and implementing a self-adaptive hierarchical memory strategy, RAGDoll addresses the memory crunch and resource underutilization typical in constrained environments. Evaluation shows up to a 3.6× speedup in average latency compared to standard serial RAG implementations, successfully serving 70B parameter models on hardware with as little as 12GB of VRAM.
Introduction
Retrieval-Augmented Generation (RAG) is the gold standard for reducing LLM hallucinations by grounding responses in external knowledge. However, running RAG on a single, consumer-grade GPU (like an RTX 3090 or 4090) presents significant challenges. First, the Memory Crunch: both the LLM (especially 70B+ models) and the massive vector databases used for retrieval compete for limited VRAM and system RAM, often leading to memory thrashing. Second, Resource Underutilization: traditional RAG workflows are serial—the system retrieves data (CPU-intensive) and then generates text (GPU-intensive). While one component is active, the other sits idle, potentially leaving hardware underutilized up to 80% of the time.
Methods
RAGDoll reimagines the RAG workflow through several core innovations aimed at maximizing hardware efficiency:
- Multi-Pipeline Parallelism: RAGDoll decouples retrieval and generation into independent, parallel pipelines. While the GPU generates a response for one batch, the CPU simultaneously retrieves documents for the next, reducing idle time significantly.
- Asynchronous Prefetching: Building on offloading frameworks, RAGDoll uses a dedicated thread pool to prefetch model layers into VRAM before they are needed, hiding PCIe transfer latencies.
- Backlog-Aware Batching: The system monitors the request queue in real-time and dynamically adjusts batch sizes to balance the trade-off between throughput and individual query latency.
- Hierarchical Memory Placement: RAGDoll employs a joint placement scheme that dynamically manages data across GPU VRAM, system RAM, and Disk. It intelligently offloads less-critical LLM tensors or database partitions based on current generation needs.
Datasets and Experimental Setup
The system was evaluated using the TriviaQA dataset, a large-scale reading comprehension benchmark with over 650,000 question-answer pairs. The knowledge base consisted of a 256 GB vector database partitioned into 32 segments. Testing was conducted on Llama 3.1 models (8B and 70B parameters) across two hardware profiles: "PF-High" (A30 GPU, 24GB VRAM) and "PF-Low" (A5000 GPU, 12GB VRAM).
Key Insights: The Resource Race
A critical finding of this work is that retrieval and generation are direct competitors for hardware resources. Increasing the batch size for generation improves throughput but increases the KV cache size, which may force the vector database out of RAM and onto slower disk storage, severely impacting retrieval performance.
RAGDoll demonstrates that performance gains in resource-constrained settings come primarily from overlapping these steps rather than just speeding up individual components. Furthermore, adaptive batching is non-linear; the optimal size depends heavily on the current request backlog and memory constraints.
Key Results
- Significant Speedup: RAGDoll achieved up to 3.6× faster average latency compared to vLLM-based RAG and up to 11.7× faster than Hugging Face Accelerate.
- Workload Resilience: Under heavy loads (e.g., 16 requests per minute), RAGDoll maintained stable latencies, avoiding the "latency explosions" seen in baseline systems.
- Large Model Accessibility: RAGDoll successfully served the Llama-3.1-70B model on a single 12GB VRAM GPU, a task typically requiring multiple high-end enterprise GPUs.
Limitations and Future Work
While RAGDoll optimizes single-GPU setups, it faces bottlenecks when using on-disk indices (like DiskANN) due to disk I/O speeds. Future research will explore scaling these parallel pipelines to multi-GPU environments and integrating advanced quantization (4-bit or 2-bit) to support even larger models, such as the 400B parameter variants, on consumer hardware.
Summary updated