Can the Apple M4 (16GB) run Gemma 2 9B?

Apple M4 (16GB) × Gemma 2 9B8K context
YesRuns fully on the GPU
Memory at Q5_K_M10 GB of 10.7 GB
Weights 6.6 GBKV cache 2.8 GBRuntime 0.6 GB
QuantQ5_K_MVery good
Memory10 GBof 10.7 GB usable
Speed~11tokens per second
  1. FP16
  2. Q8_0
  3. Q6_K
  4. Q5_K_M
  5. Q4_K_M
  6. Q3_K_M
  7. Q2_K

Yes. The Apple M4 (16GB) can run Gemma 2 9B fully in unified memory at Q5_K_M (very good), using about 10 GB of the 10.7 GB available, at roughly 11 tokens/second.

Run it with Ollama

With Ollama installed, one command downloads and starts Gemma 2 9B:

ollama run gemma2:9b

Ollama's default download is Q4_K_M (about 9 GB here). You have room for Q5_K_M, which is very good: pick that GGUF in LM Studio or from Hugging Face.

Run it in the cloud

No Apple M4 (16GB)? Run Gemma 2 9B in the cloud.

Rent a cloud GPU by the hour. No upfront cost, stop any time.

Memory needed by quantization

At 8,192 tokens of context. The black line marks the 10.7 GB the Apple M4 (16GB) can use. macOS lets the GPU use about 10.7 GB of the 16 GB unified memory by default.

QuantQualityMemoryFits?Speed
FP16Full quality21.9 GBToo big—
Q8_0Near-lossless13.2 GBToo big—
Q6_KExcellent11 GBToo big—
Q5_K_MVery good10 GBFits~11 tok/s
Q4_K_MGood, most popular9 GBFits~13 tok/s
Q3_K_MNoticeably degraded7.9 GBFits~16 tok/s
Q2_KHeavily degraded6.9 GBFits~21 tok/s

Frequently asked questions

Can Apple M4 (16GB) run Gemma 2 9B?

Yes. The Apple M4 (16GB) can run Gemma 2 9B fully in unified memory at Q5_K_M (very good), using about 10 GB of the 10.7 GB available, at roughly 11 tokens/second.

How much VRAM does Gemma 2 9B need?

About 9 GB at Q4_K_M with 8,192 tokens of context, and about 21.9 GB at full FP16 precision.

How fast is Gemma 2 9B on the Apple M4 (16GB)?

Roughly 11 tokens per second at Q5_K_M, estimated from the Apple M4 (16GB)'s 120 GB/s memory bandwidth.