Skip to content

server: identical multimodal embeddings differ with default unified KV cache #42

Description

@am17an

Upstream: ggml-org#28656

Two identical multimodal inputs in one /embeddings request return different vectors under the server's default unified KV cache.

Environment: Linux aarch64, NVIDIA GB10 / CUDA 13, current main 434ddbbc0e30522e897670681e503b797c12b7c1; ggml-org/tinygemma3-GGUF Q8_0 plus its mmproj and the repo's tools/mtmd/tests/test-1-positive.png.

LLAMA_MEDIA_MARKER='<__media__>' llama-server \
  -m tinygemma3-Q8_0.gguf --mmproj mmproj-tinygemma3.gguf \
  -ngl 99 --embeddings -c 4096 -b 512 --seed 42 --no-jinja

Send one POST /embeddings whose content contains the same item twice:

{"prompt_string":"What is this: <__media__>\n","multimodal_data":["<same base64 PNG>"]}

Observed: default kv_unified=true gives max|delta|=0.0705835, cosine 0.99989352. Adding -np 4 selects kv_unified=false and both vectors are bit-identical.

This isolates the failure to CUDA multimodal embeddings with the unified KV path; text-only and CPU are reported unaffected. Introducing commit not identified.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions