Views
No views yet
google/gemma-4-E4B-it,
re-exported so that prefix (KV) caching works.OpenVINO/gemma-4-E4B-it-int8-ov,
cannot use openvino_genai's continuous-batching backend, so it gets no prefix
caching at all:No ScaledDotProductAttention operation observed in the graph,
cannot perform the SDPAToPagedAttention transformation.ScaledDotProductAttention nodes
into PagedAttention. Intel's language model was traced with decomposed
attention, so there is nothing to rewrite. The tell is static — no GPU, no
model load:1grep -c 'ScaledDotProductAttention' openvino_language_model.xml
2# OpenVINO/gemma-4-E4B-it-int8-ov -> 0 (42 SoftMax instead)
3# this repo -> 42 (one per layer)gemma-4-E2B-it-int4-ov, gemma-4-26b-a4b-it-int4-ov)
are fine, so this is a per-build defect rather than anything about Gemma 4.
optimum-intel pins the attention implementation only for models listed in
FORCE_ATTN_MODEL_CLASSES (phi3_v, gemma2, llama4); gemma4 is not
among them, so the export environment decides.| turn 1 | turn 2 | turn 3 | |
|---|---|---|---|
OpenVINO/gemma-4-E4B-it-int8-ov | 2.63 s | 3.06 s | 3.03 s |
| this repo | 5.92 s | 1.16 s | 1.16 s |
1pip install "optimum-intel[openvino] @ git+https://github.com/huggingface/optimum-intel.git"
2pip install "transformers==5.5.4" # last, so it overrides optimum's pin
3
4optimum-cli export openvino \
5 --model google/gemma-4-E4B-it \
6 --task image-text-to-text \
7 --weight-format int8 \
8 gemma-4-E4B-it-int8-ovopenvino_tokenizer.xml at export time, so editing chat_template.jinja
afterwards does nothing. Google's template uses Python-style implicit string
concatenation inside raise_exception(...) — valid in Jinja2, rejected by
openvino_genai's C++ Jinja parser with "Expected closing parenthesis in call
args" at warmup. Replace the template in the source directory before
exporting. The template here is the runtime-parseable one from Intel's
export, with thanks.1import openvino_genai as ovg
2sc = ovg.SchedulerConfig(); sc.enable_prefix_caching = True; sc.cache_size = 4
3pipe = ovg.VLMPipeline("gemma-4-E4B-it-int8-ov", "GPU", scheduler_config=sc)
4print(pipe.generate("What is in this image?", images=[img], max_new_tokens=100))google/gemma-4-E4B-it; all rights
and restrictions of the original apply unchanged.