Ranked #19 of 25 on Wednesday, November 4
llama.cpp merges Gemma 4 graph optimizations with large prompt-processing gains for E2B and E4B
A llama.cpp pull request marked merge-ready optimizes the Gemma 4 graph by pruning unused prompt rows before KV-shared layers, cropping attention masks, and folding PLE scaling into RMSNorm weights, with large prompt-processing gains for the E2B and E4B…
Ranked #19 of 25 on Wednesday, November 4
Why it matters
Running small Gemma 4 models locally gets noticeably faster for long prompts.
What happened
1 min readA llama.cpp pull request marked merge-ready optimizes the Gemma 4 graph by pruning unused prompt rows before KV-shared layers, cropping attention masks, and folding PLE scaling into RMSNorm weights, with large prompt-processing gains for the E2B and E4B variants. It also adjusts MTP speculative decoding so the gains survive with a shared KV cache. A downstream fork notes that dropping `ggml_cont()` inflates cross-backend copies on multi-GPU layer splits and restored it.
Our analysis
The gains are specific to Gemma 4's KV-shared layer design and gated to single-sequence use. The text doesn't give benchmark numbers, and measurements were on unified-memory hardware; multi-GPU users should watch the `ggml_cont()` issue a fork raised.