r/Vllm
•
u/Mr_Moonsilver
•
8h ago
Experimental vLLM overlay: KV Cache offload to RAM works with Qwen 3.8 Flash Next
A while back I read a post that floated the idea to offload KV cache to RAM with the new architecture proposed in 3.8 FN. I didn't find anything in stock vLLM that would easily allow to do this, but I was really interested in getting this working. I own a 4x3090 rig with 256GB DDR4, so I thought I'll give it a shot.
For this project I used Claude Code entirely, as I was purely trying to see if it would work. After a few weeks and a few thousand commits on more than 1000 test branches, and many engine starts later, I got a stable version running on this ampere setup. To anyone with more skill than me, this might look like a trainwreck, yet it runs stable and shows nice numbers too. Maybe this can help form a basis for a more standardized approach.
I configured TP2xPP2, enabled P2P, I'm using nvlink for the two pairs and been using Intel's W4A16 Autoround quant. It runs at around 480tk/s aggregate on 8 streams, each with a 200k context and about 6.2k tk/s prefill. It also has its limitations. For example the vision encoder needs to sit on a 5th 3090 in my network, it's likely to only run on ampere cards and it is pinned to one vLLM release which isn't the newest either.
Many engines already exist that let you run a model that doesn't fit in VRAM, but not a lot of approaches exist where you barely fit the model in VRAM but offload the KV cache to RAM. Happy to hear your ideas about it, and hopefully this will work for a hopefully soon released Qwen 4 120b-ish model too.
