Can I run GLM-4.7 Flash on an RTX 4070 12GB?
With --n-cpu-moe 24: the Q4_K_M GGUF keeps 11.8 GB on the RTX 4070 and 7.93 GB in system RAM, with the experts of 24 of its 47 layers moved there. Whole, GLM-4.7 Flash needs about 21.7 GB at Q4_K_M with 32K tokens of context, 9.67 GB more than the RTX 4070 12GB holds. The smallest setup here that holds GLM-4.7 Flash at Q4_K_M with 32K is RTX 3090 (24 GB).
With offload the Q4_K_M GGUF with --n-cpu-moe 24 and 32K tokens of context
- On the card
- 11.8 GB
- RTX 4070
- 12 GB, 504 GB/s
- In RAM
- 7.93 GB
- Tokens/s
- 22–38 tokens/s
With the Q4_K_M GGUF, --n-cpu-moe 24 and 32K tokens of context it writes about 22–38 tokens/s for one request on an RTX 4070 12GB and dual-channel DDR5-5600.
GLM-4.7 Flash on the RTX 4070 as the context fills
One request, FP16 KV cache, 0.5 GB plus 10% overhead; a minus sign is memory missing, and tight is less than 0.5 GB free.
| Context | Q4_K_M | Free | Tokens/s | Q8_0 | Free | Tokens/s |
|---|---|---|---|---|---|---|
| 4K | 20.1 GB | −8.08 GB | — | 34.7 GB | −22.7 GB | — |
| 8K | 20.3 GB | −8.31 GB | — | 34.9 GB | −22.9 GB | — |
| 16K | 20.8 GB | −8.76 GB | — | 35.4 GB | −23.4 GB | — |
| 32K | 21.7 GB | −9.67 GB | — | 36.3 GB | −24.3 GB | — |
| 64K | 23.5 GB | −11.5 GB | — | 38.1 GB | −26.1 GB | — |
| 128K | 27.1 GB | −15.1 GB | — | 41.8 GB | −29.8 GB | — |
| 198K (full) | 31.1 GB | −19.1 GB | — | 45.7 GB | −33.7 GB | — |
--n-cpu-moe for GLM-4.7 Flash on the RTX 4070
With --n-cpu-moe 24 the Q4_K_M GGUF keeps 11.8 GB on the RTX 4070 and 7.93 GB in RAM, about 22–38 tokens/s with DDR5-5600. Measured Q4_K_M file, 1 GB of buffers; tokens/s by system RAM speed.
GLM-4.7 Flash on more than one RTX 4070
| Cards | Best at 32K | Tokens/s | Q4_K_M longest | Q4_K_M tokens/s |
|---|---|---|---|---|
| 2× (24 GB) | Q4_K_M | 65–119 | 55K | 65–119 |
| 4× (48 GB) | Q8_0 | 85–161 | 198K (full) | 106–206 |
Tensor parallel with the combined bandwidth, as in vLLM; llama.cpp splits layers by default and runs at about one card's speed.
Other options
- The next smaller setting, Q3_K_M, takes 18.0 GB at 32K, 5.95 GB over the RTX 4070; it does not fit with 0.5 GB to spare even with 1K tokens.
- Smallest setup for Q4_K_M at 32K: RTX 3090 (24 GB).
Run GLM-4.7 Flash on the RTX 4070 with llama-server
llama-server -hf unsloth/GLM-4.7-Flash-GGUF:Q4_K_M -c 32768 -ngl 99 --n-cpu-moe 24 GLM-4.7-Flash-Q4_K_M.gguf, 18.3 GB, from unsloth/
Questions
Can I run GLM-4.7 Flash on an RTX 4070 12GB?
With --n-cpu-moe 24: the Q4_K_M GGUF keeps 11.8 GB on the RTX 4070 and 7.93 GB in system RAM, with the experts of 24 of its 47 layers moved there. Whole, GLM-4.7 Flash needs about 21.7 GB at Q4_K_M with 32K tokens of context, 9.67 GB more than the RTX 4070 12GB holds. The smallest setup here that holds GLM-4.7 Flash at Q4_K_M with 32K is RTX 3090 (24 GB).
How fast is GLM-4.7 Flash on an RTX 4070 12GB?
With the Q4_K_M GGUF, --n-cpu-moe 24 and 32K tokens of context it writes about 22–38 tokens/s for one request on an RTX 4070 12GB and dual-channel DDR5-5600.
Does GLM-4.7 Flash need --n-cpu-moe on an RTX 4070 12GB?
With --n-cpu-moe 24 the Q4_K_M GGUF keeps 11.8 GB on the RTX 4070 and 7.93 GB in RAM, about 22–38 tokens/s with DDR5-5600.
What does a second RTX 4070 12GB change for GLM-4.7 Flash?
Two RTX 4070 12GB cards (24 GB in one tensor-parallel group) hold GLM-4.7 Flash at Q4_K_M with 32K, and Q4_K_M up to 55K tokens, at about 65–119 tokens/s.
Try other settings in the VRAM calculator, the speed calculator or the MoE offload planner. See also GLM-4.7 Flash VRAM requirements, what LLMs an RTX 4070 12GB can run and every pair, or detect your own GPU. Model data checked .