CUDA OOM in Multi-Agent LoRA Serving: How to cap vLLM --max-lora-rank and CPU swap space when serving 40+ tenant adapters concurrently?
We serve 45 tenant-specific LoRA adapters (specialized for SQL generation, compliance extraction, and code review) on a single NVIDIA A100 80GB node using vLLM's --enable-lora S-LoRA / Punica backend.
Launch Configuration
bashpython3 -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-3.1-8B-Instruct --enable-lora --max-loras 16 --max-lora-rank 64 --max-cpu-loras 48 --gpu-memory-utilization 0.92
The Production Crash
Under normal load, everything runs smoothly. During morning traffic spikes when 12+ distinct LoRA adapters are requested inside the same continuous batch:
texttorch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 512.00 MiB. GPU 0 has a total capacity of 79.15 GiB of which 142.12 MiB is free.
Even though 16 active LoRA adapters at 80MB each should only take ~1.3GB of VRAM, why is vLLM running out of GPU memory during concurrent adapter swaps? And how should we tune --max-loras vs --gpu-memory-utilization so KV-cache allocation doesn't starve the LoRA staging buffers?