Skip to content

model: support embeddinggemma2 (text+vision+audio) - #30054

Merged
ngxson merged 1 commit into
masterfrom
xsn/embd_gemma2
Oct 6, 2026
Merged

ngxson merged 1 commit into
masterfrom
xsn/embd_gemma2

Conversation

@ngxson

@ngxson ngxson commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Support https://huggingface.co/google/embeddinggemma-2

GGUF: https://huggingface.co/ggml-org/embeddinggemma-2-GGUF

Requirements

@ngxson
ngxson requested review from CISC and ggerganov as code owners October 6, 2026 16:02
@github-actions github-actions Bot added model Model specific testing Everything test related conversion labels Oct 6, 2026
@ngxson
ngxson merged commit 4fbc76d into master Oct 6, 2026
18 of 21 checks passed
@CISC CISC added the highlight Changes that will be highlighted in the next release notes label Oct 6, 2026
imaami pushed a commit to imaami/llama.cpp that referenced this pull request Oct 6, 2026
gagallo7 pushed a commit to gagallo7/qvac-fabric-llm.cpp that referenced this pull request Oct 8, 2026
[qvac-b11259: scale tokens after build_inp_embd, this base has no tok_scale parameter (ggml-org#29622)]

Assisted-by: Claude Code
(cherry picked from commit 4fbc76d)
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 8, 2026
CVeniamin added a commit to CVeniamin/ollama that referenced this pull request Oct 9, 2026
The pinned llama.cpp (b11351) predates ggml-org/llama.cpp#30054, which
adds the gemma-embedding2 architecture for EmbeddingGemma 2. Carry its
graph as an Ollama-owned source plus a small registration patch, the way
Laguna was carried. The only change from upstream is the input embedding
scale, written with the pinned build_inp_embd API as gemma4.cpp does.

Remove both files once LLAMA_CPP_VERSION includes that change.
aranlucas pushed a commit to aranlucas/LokalBot that referenced this pull request Oct 9, 2026
Pins the source build that adds EmbeddingGemma 2 support
(ggml-org/llama.cpp#30054). No v-tag after v0.6.0 contains it yet. The
source archive has no .git, so pass the build number explicitly and
--version reports build 11474.
brianreborn added a commit to brianreborn/familia that referenced this pull request Oct 10, 2026
graph.yaml declares runtimes (bin, tag, commit, load-tested archs). Each node names its runtime; the validator checks the binary reports the declared commit and fails if the node's GGUF arch was not verified on that runtime. Coder stays on b11374; embeddinggemma-2 (gemma-embedding2, unknown to b11374) runs on official b11539 (includes ggml-org/llama.cpp#30054), port 9951, --embeddings. Tested on miryam: 768-dim embeddings from the graph-rendered command while coder ran (RAM used 5.7/7.1 GiB).
thelittlefireman pushed a commit to thelittlefireman/llama.cpp that referenced this pull request Oct 12, 2026
Leo00703 added a commit to Leo00703/Local-LLM that referenced this pull request Oct 19, 2026
Submodule (app/src/main/cpp/llama.cpp):
- dbe4c3ed4 (b11393) -> abeada335 (b11455), the first tag that contains
  ggml-org/llama.cpp#30054 "model: support embeddinggemma2 (text+vision+audio)" (merged
  2026-10-06, commit 4fbc76de). Found by comparing the merge commit against tags with the
  GitHub compare API; b11450 does not contain it, b11455 does. The newest tag (b11736) is
  343 commits ahead and changes chat.h/common.h/sampling.h/llama.h; b11455 is 62 commits
  ahead and was chosen to keep the first bump small.

Public API diff b11393 -> b11455 (headers the app includes), read in full:
- include/llama.h: LLAMA_SESSION_VERSION 10 -> 11, LLAMA_STATE_SEQ_VERSION 3 -> 4,
  new LLAMA_VOCAB_TYPE_PLAMO3. Additive.
- common/common.h: tty_enable_ansi(), COMMON_DECISION_TYPE_PPLX_DECIDER, a filename overload
  of common_get_decision_type. common/log.h: common_log_get_colors. Additive.
- ggml-backend.h: ggml_backend_sched_set_copy_callback. Additive.
- chat.h, sampling.h, speculative.h, mtmd.h, mtmd-helper.h: unchanged. No native glue change
  was needed apart from the skip_audio parameter below.
- Behaviour: the persisted preamble KV files (llama_state_seq_save_file) change format
  with STATE_SEQ_VERSION 4; LlamaGenerationSession already treats a failed load as a miss,
  clears the KV and regenerates, so old cache files are rebuilt once.
- Qwen3.5 MTP graph now goes through crop_before/after_nextn and
  ASSERT_EMBD_OR_TOKEN (#29622, #30020); same tag, same speculative.cpp, but MTP was not
  exercised on a device here.

Patches:
- 0001 and 0002 verified to apply to b11455 (git apply --cached --check against a temporary
  index, then the real apply and reverse in the submodule).
- New 0003-mtmd-add-skip_audio-context-param: mtmd_context_params.skip_audio and
  clip_context_params.skip_audio (default false = upstream), the Gemma 3n special case kept.
  Replaces the CI sed that forced skip_audio = true for every caller. That sed was written
  for b9496, where the Gemma 4 audio projector types were unknown and clip hit
  GGML_ABORT("Unknown projector type"); PROJECTOR_TYPE_GEMMA4A / GEMMA4UA are handled in
  b11455 (clip.cpp), so the abort it avoided is gone. It also would have blocked the audio
  encoder of EmbeddingGemma 2 for the upcoming indexing feature.
- LlamaModel.cpp sets mparams.skip_audio = true, so chat behaviour is unchanged.
- The "Patch mtmd - skip audio encoder" step is removed from build-debug-apk.yml,
  pull-request-check.yml and deploy-internal.yml; the generic "Apply Android patches" loop
  already picks up 0003.

Docs: AGENTS.md (pin, patch list, how to check patches without a checkout, trailer now
Sonnet 5.5) and patches/README.md. Changelog 1.9.133 entry.

Not verified: compiles only in CI (no NDK locally); not run on a device.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion highlight Changes that will be highlighted in the next release notes model Model specific testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants