RAG Benchmarking methodology

The Retrieval benchmarking methodology defines the following metrics, use cases, performance goals, benchmarks to pursue:
- Metrics - What are the metrics and KPI that are significant for RAG Retrieval: First Token Latency p90 (ms), Output throughput (TPS) and User Throughput (TPS)
- Usecases (ISL/OSL combinations) - Usecases that are crucial for Enterprise RAG: Chat 128/128, Summarization (4096/512), Analysis (128/2048)
- Balanced Performance - Define Balanced Performance for RAG; how to maximize Output Throughput (TPS) X User throughput (TPS)
- RAG Benchmarks - Define the Speed of Light (SOL) benchmarks to validate RAG performance: RAG-ON, RAG-OFF and RAG-OFF with RAG-ISL (SOL)
- RAG Scaling Guidelines - Define latency thresholds for each RAG Retrieval components: LLM, Retriever (Embedding NIM and Milvus VDB), Reranking NIM. Using tracing data to analyze latency for individual RAG components
- Test Plan - define the test cases to run for each Enterprise RA scaling Unit (1SU, 2SU, 3SU, 4SU). Define the key parameters to vary LLM Scale 1X, 2X, 4X, 8X, along with component scale; Reranker ON/OFF, VDB TopK and Reranker TopK. For each test case scale the users or Concurrent requests from 1-100 for each active LLM.
- Test tool - Define performance benchmarking test tools GenAI-Perf and create any automation scripts required for benchmarking
RAG Benchmarking Test Plan
Component scaling
The NIM LLM is the main component affecting performance. Scale LLM along with other individual components based on the RAG Linear scaling ratios defined above and the RAG Linear Scaling Table defined above.
VDB TopK and Reranker TopK
Vary the TopK for LLM Scale 1X, 2X, 4X, 8X, 10X, 16X, 20X, 32X, 64X, 96X.
VDP TopK/ Reranker TopK:
- 10/4 (1 collection) - VDB TopK=10, Reranker TopK=4; retrieve 10 chunks from 1 Milvus collection and Reranker filters down to 4 chunks to send to LLM
- 5/4 (2 collections) - VDB TopK=5, Reranker TopK=4; retrieve 5 chunks from each Milvus collection (10 total chunks) and Reranker filters down to 4 chunks to send to LLM
- 20/10 - VDB TopK=20, Reranker TopK=10; retrieve 20 chunks from 1 Milvus collection and Reranker filters down to 10 chunks to send to LLM
- 10/10 (2 collections) - VDB TopK=10, Reranker TopK=10; retrieve 10 chunks from each Milvus collection (20 total chunks) and Reranker filters down to 10 chunks to send to LLM
Usecases: Chat: 128/128; Summarization: 1024/512, Generation: 128/2048
Benchmarks: RAG-ON, RAG-OFF and RAG-OFF with RAG-ISL (SOL)
For each test case scale the users or Concurrent requests from 1-100 for each active LLM.
Milvus VDB Collection Size: 10M+ vector embeddings:
- Collection1: ~10M vectors from Wikipedia dataset (Text Chunk Size 256/50)
- Collection2: ~100K vectors from Wikipedia partial (Text Chunk Size 512/150)
- Collection3: 5K - 9K vectors Shakespeare works PDF (Text Chunk Size 256/50)
- Collection4: 77K vectors - Multimodal dataset bo767 digital corpora 767
Chunk Size: 256/50 which is 256 tokens with 50 token overlap. Average chunk size from the tracing data is 243 tokens
Concurrent Requests: Vary concurrent users (CCU) or Concurrent Requests (CR) from 1 to 120 and measure benchmarks for different CR.
LLM Scale 1X Concurrent Requests: [1, 2, 4, 8, 10, 16, 20, 24, 32, 40, 48, 56, 64, 72, 80, 96, 100]
When scaling the LLM, scale the corresponding Concurrent Requests, for example: LLM Scale 2X Concurrent Requests: [2, 4, 8, 20, 32, 40, 48, 64, 80, 96, 112, 128, 144, 160, 192, 200] etc.
Iterations: run 3 iterations for each Concurrency (CR) and weed out any outliers.
Delay between tests: add delay of 30s between tests to clear KV-Cache between runs.
The test plan table below defines the RAG Scale where RAG Scale refers to the LLM scale since the LLM is the key component that accounts for 90% of the Latency and will be scaled out for each testcase. The table below provides a complete list of test cases and test count that will be run along with all component scale and parameter variations.
Table 19. RAG Benchmarking Test cases
AIPerf Tool for Benchmarking RAG
NVIDIA’s AI-Perf is an AI inference benchmarking tool that was used to benchmark Enterprise RAG Retrieval performance. GenAI Perf is deployed on a Linux server outside the Kubernetes cluster and generates load on the RAG server and LLM endpoints. Use either Ingress, Load Balancer or DNS to access the endpoints. GenAI Perf is a client-side tool that generates synthetic user queries (based on specified ISL) and talks to the NVIDIA Triton-server running on the LLM NIM to measure the throughput and latency metrics.
NVIDIA’s AI-Perf will be leveraged to provide these metrics to benchmark Enterprise RAG Retrieval performance.
Table 20. Gen-AI Perf Key Metrics for RAG Benchmarking
To benchmark the RAG service, GenAI perf will create multiple concurrent user requests using synthetic input prompts and these are sent to RAG server Kubernetes service endpoint. Gen-AI perf will process the responses received to calculate the metrics defined above for each user request.
For generating the user prompts it is important to use the right tokenizer to match the LLM model otherwise the metrics reported by GenAI perf may be incorrect e.g. input ISL sent and OSL received may not match the configured ISL/OSL.
For LLM model nvidia/llama-3.3-nemotron-super-49b-v1.5, use the matching
tokenizer nvidia/Llama-3_3-Nemotron-Super-49B-v1_5 from hugging face.
Download the tokenizer from hugging face and point to local tokenizer to reduce overhead of webcall and improve tokenizing performance.
Follow instructions in the Enterprise RAG Deployment guide to install and then run AIPerf sample script.
Install the AI-perf client in Python venv (3.10+) on Ubuntu 24.04 server using pip. Install AI perf on Ubuntu 24.04 node in python venv and run from outside cluster.
Run a sample script below with synthetic data.
Add prompt.jsonl with valid questions to append to synthetic data.
See sample GenAI-perf command below and basic script: