You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Metal backend outputs garbage at --bits 3 / --bits 2 on M4 (CPU is fine) #816
On an M4 Mac mini, Gemma 4 E2B at --bits 3 and --bits 2 gives junk on the Metal backend. The same weights on --backend cpu are fine. cq4 on Metal is fine too.
cactus run google/gemma-4-E2B-it --bits 3 --backend metal --no-cloud-tele --no-cloud-handoff --max-new-tokens 32 --prompt "What is the capital of France?"
-> " inspires the capital of France is **Paris**."
cactus run google/gemma-4-E2B-it --bits 3 --backend cpu --no-cloud-tele --no-cloud-handoff --max-new-tokens 32 --prompt "What is the capital of France?"
-> "The capital of France is **Paris**."
--bits 2 does the same thing (" inspires the question: ..." on Metal, Paris on CPU). Leaving --backend off acts like Metal, and the Python binding does the same.
It's not just a stray first token. On a 40-question exact-answer set we use (arithmetic, short facts, JSON formatting), I got:
cq4 Metal 37/40
cq3 Metal 5/40, cq3 CPU 37/40
cq2 Metal 0/40, cq2 CPU 20/40
One more hint: cq3 and cq2 prefill on Metal is about 550 tok/s, basically the same as CPU, while cq4 on Metal does about 1,030. So it looks like only the 4-bit path is actually running on the GPU, and the lower-bit Metal path is doing something wrong.
Setup: cactus 2.2.0 from the brew tap, Gemma 4 E2B bundles v2.0.1, Apple M4 with 24 GB, macOS 26.5.1. Saw it first on 2026-09-23 and it still reproduces tonight on the same install.
Activity