I saw a test of a 4-bit Qwen mixture-of-experts model using about 3.4 GB of GPU memory by keeping its experts in system RAM. How practical is that setup, and how much RAM would it need?
Can I run a quantized 35B Qwen model with only a few GB of VRAM?
Answers
It looks workable if you have enough system RAM. The reported test used a V100 and got about 34 tokens per second with experts in RAM, roughly half the reported speed when the model was mostly on the GPU. That doesn't mean a smaller card will get the same speed, though. The rest of the system matters too.
The 3.4 GB figure is for that particular configuration, not a general VRAM requirement for every context size or inference setup.
Reply to this answer
Plan for a lot more than 16 GB of system RAM. The reported setup used about 27.5 GB of RAM, with 32 GB available. That was for one 4-bit quant and configuration, so treat it as a rough reference rather than a guaranteed minimum.
Kai:
So 16 GB RAM plus 8 GB VRAM isn't a safe bet based on that test?
Apron:
Right. There was a suggestion that keeping a lookup table on SSD might reduce RAM use, but the estimate was still around 17 GB and it would likely be slower. That wasn't established as a tested minimum.
Reply to this answer
Check the exact model file and runtime settings before comparing results. The reported quant was UD-Q4_K_XL, and the shared llama.cpp configuration used a 12,288-token context and one parallel sequence. Other quants, context sizes and offload choices can change both memory use and speed.
Reply to this answer
There's a quality tradeoff as well as a memory tradeoff. The limited testing described the 4-bit version as usable, but that isn't a thorough quality evaluation. If you need it for a particular task, test that task before settling on the quant.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Sunnyvale Road:
Context length matters too. Leave some GPU memory for the context cache and other runtime allocations rather than planning around the model figure alone.