Download tt_kernel_manifest.json from changh95/embeddinggemma-2: direct link, hf CLI and curl.
- Browser
- Download file 25.8 kB
-
https://huggingface.co/changh95/embeddinggemma-2/resolve/main/tt_kernel_manifest.json
- Command line
-
hf download hf://changh95/embeddinggemma-2/tt_kernel_manifest.json
-
curl -L -o tt_kernel_manifest.json https://huggingface.co/changh95/embeddinggemma-2/resolve/main/tt_kernel_manifest.json
25.8 kB
| { | |
| "schema_version": "5.1", | |
| "name": "embeddinggemma-2", | |
| "tt_metal_version": "0.65.2.dev11169+g44d66500520", | |
| "arch": "blackhole", | |
| "device_count": 1, | |
| "producer": { | |
| "tt_kernel_version": "0.1.0", | |
| "created_at": "2026-12-01T02:58:34.586038+00:00", | |
| "hostname": "hchang-bh" | |
| }, | |
| "weights": { | |
| "repo_id": "google/embeddinggemma-2", | |
| "revision": "f9972ac22e696a105c482202646979e33e4b5a1e", | |
| "allow_patterns": [ | |
| "model.safetensors", | |
| "config.json", | |
| "tokenizer.json", | |
| "tokenizer_config.json", | |
| "tokenizer.model", | |
| "chat_template.jinja", | |
| "preprocessor_config.json", | |
| "processor_config.json", | |
| "config_sentence_transformers.json", | |
| "sentence_bert_config.json", | |
| "modules.json", | |
| "1_Pooling/config.json", | |
| "2_Normalize/config.json", | |
| "README.md" | |
| ], | |
| "ignore_patterns": null, | |
| "repo_type": "model" | |
| }, | |
| "auxiliary_weights": [], | |
| "mesh": null, | |
| "entrypoint": null, | |
| "resources": null, | |
| "capabilities": null, | |
| "env": {}, | |
| "bundled": null, | |
| "deps": null, | |
| "container": { | |
| "image": { | |
| "registry": "hf", | |
| "repository": "embeddinggemma-2", | |
| "tag": "tt-model/embeddinggemma-2:d8978e0fd173", | |
| "digest": "sha256:d8978e0fd1732e1e25d50cff97c9ce17f0b876e54121527194deea67d4f40969" | |
| }, | |
| "kind": "tt-dit-server", | |
| "runtime": { | |
| "app": "tt_embgemma.server.app:app", | |
| "mesh_shape_env": "TT_MESH_SHAPE", | |
| "packages": [ | |
| "numpy>=1.24.4,<2", | |
| "safetensors==0.8.0", | |
| "huggingface_hub==1.16.1", | |
| "tokenizers==0.22.2", | |
| "orjson==3.12.0", | |
| "scipy==1.17.1", | |
| "soundfile==0.14.0", | |
| "fastapi==0.142.2", | |
| "uvicorn==0.54.0" | |
| ], | |
| "lock": "requirements.lock" | |
| }, | |
| "serve": { | |
| "hardware": "p150", | |
| "mesh_device": "P150", | |
| "port": 20000, | |
| "max_model_len": null, | |
| "max_num_seqs": null, | |
| "block_size": null, | |
| "server_timeout": null, | |
| "capabilities": null, | |
| "additional_config": {}, | |
| "args": [], | |
| "env": { | |
| "TT_WEIGHTS_REVISION": "f9972ac22e696a105c482202646979e33e4b5a1e", | |
| "TT_METAL_VISIBLE_DEVICES": "0", | |
| "TT_DEVICE_ID": "0", | |
| "HF_HUB_DISABLE_IMPLICIT_TOKEN": "1", | |
| "EMBGEMMA_DISPATCH": "eth", | |
| "EMBGEMMA_NUM_CQS": "1", | |
| "EMBGEMMA_MODALITIES": "text,image,video,audio", | |
| "EMBGEMMA_TEXT_ENGINE": "ttnn", | |
| "EMBGEMMA_VISION_ATTN": "sdpa", | |
| "EMBGEMMA_MAX_BATCH": "32", | |
| "EMBGEMMA_MAX_INPUTS": "2048", | |
| "EMBGEMMA_MAX_IMAGES": "64", | |
| "EMBGEMMA_MAX_SEQ_LEN": "2048", | |
| "EMBGEMMA_IMAGE_TOKENS_MAX": "280", | |
| "EMBGEMMA_VIDEO_MAX_FRAMES": "32", | |
| "EMBGEMMA_AUDIO_MAX_SECONDS": "30", | |
| "EMBGEMMA_WEIGHTS": "bf16", | |
| "EMBGEMMA_FIDELITY": "HiFi4", | |
| "EMBGEMMA_BATCH_WINDOW_MS": "2", | |
| "EMBGEMMA_QUEUE_DEPTH": "256", | |
| "EMBGEMMA_QUEUE_TIMEOUT_S": "120" | |
| } | |
| }, | |
| "serve_profiles": [ | |
| { | |
| "hardware": null, | |
| "mesh_device": null, | |
| "port": null, | |
| "max_model_len": null, | |
| "max_num_seqs": null, | |
| "block_size": null, | |
| "server_timeout": null, | |
| "capabilities": null, | |
| "additional_config": {}, | |
| "args": [], | |
| "env": {}, | |
| "name": "default", | |
| "description": null | |
| } | |
| ], | |
| "default_profile": null, | |
| "code_dir": "code", | |
| "verify": [ | |
| "assert 'single_chip_arch_1cq_no_dispatch_s' in open('/opt/tt-metal/tt_metal/impl/dispatch/topology.cpp').read()", | |
| "assert 'dual_kernel_min_dram_dest_page_bytes' in open('/opt/tt-metal/ttnn/cpp/ttnn/operations/data_movement/reshape_view/device/reshape_rm_program_factory.cpp').read()", | |
| "from tt_embgemma.ttaw.device import eth_dispatch_patch_present as p; assert p(), 'ttaw does not see the ETH patch'", | |
| "import sys, tt_embgemma.server.app as a; assert a.app and 'ttnn' not in sys.modules and 'torch' not in sys.modules, 'the server module must import without ttnn / torch'", | |
| "from tt_embgemma.server.app import load_config; c = load_config({'EMBGEMMA_MAX_BATCH': '32', 'EMBGEMMA_MAX_SEQ_LEN': '2048', 'EMBGEMMA_IMAGE_TOKENS_MAX': '280', 'EMBGEMMA_DISPATCH': 'eth'}); assert (c.max_batch, c.max_seq_len, c.image_tokens_max, c.dispatch, c.vision_buckets) == (32, 2048, 280, 'eth', (864, 1440, 2592)), c", | |
| "from tt_embgemma.server.app import load_config as L\nfor bad in ({'EMBGEMMA_TEXT_ENGINE': 'mk'}, {'EMBGEMMA_VISION_ENGINE': 'cpu'}, {'EMBGEMMA_WEIGHTS': 'bfp8'}, {'EMBGEMMA_MAX_IMAGES': '0'}, {'EMBGEMMA_MAX_BATCH': '64'}, {'EMBGEMMA_MAX_SEQ_LEN': '9000'}, {'EMBGEMMA_IMAGE_TOKENS_MAX': '300'}, {'EMBGEMMA_MODALITIES': 'text,smell'}, {'EMBGEMMA_DISPATCH': 'pcie'}, {'TT_MESH_SHAPE': '1x2'}):\n try:\n L(bad)\n except RuntimeError:\n continue\n raise AssertionError(bad)", | |
| "from tt_embgemma import model_spec as S; assert S.audio_tokens_for_samples(16000) == 25 and S.audio_tokens_for_samples(10**7) == 750", | |
| "from PIL import Image; from tt_embgemma.preprocess.image import to_rgb_pil; assert to_rgb_pil(Image.new('RGBA', (4, 4), (0, 0, 0, 0))).getpixel((0, 0)) == (255, 255, 255), 'transparency must composite onto white'", | |
| "from pathlib import Path; d = Path('/opt/tt-metal/tt_embgemma/licenses'); assert 'Apache License' in (d / 'LICENSE-APACHE-2.0.txt').read_text() and 'embeddinggemma-2' in (d / 'NOTICE.md').read_text()", | |
| "import json; from pathlib import Path; r = json.loads(Path('/opt/tt-metal/tt_embgemma/samples/smoke_reference.json').read_text()); assert len(r['texts']) >= 6 and len(r['text_embeddings'][0]) == 768", | |
| "from pathlib import Path; assert all(Path('/opt/tt-metal', p).is_file() for p in ('tt_embgemma/server/smoke_test.py', 'tt_embgemma/server/client.py', 'tt_embgemma/samples/transparent.png', 'scripts/container_smoke.sh', 'scripts/bench.py', 'PYTHON.md'))", | |
| "import numpy; assert int(numpy.__version__.split('.')[0]) < 2, numpy.__version__", | |
| "import safetensors, huggingface_hub, fastapi, uvicorn, tokenizers, orjson, scipy, soundfile", | |
| "import torch; assert torch.__version__.startswith('2.11.0'), torch.__version__", | |
| "import ttnn; assert all(hasattr(ttnn, a) for a in ('DispatchCoreConfig', 'begin_trace_capture', 'end_trace_capture', 'execute_trace', 'release_trace', 'copy_host_to_device_tensor', 'gather', 'conv2d'))" | |
| ], | |
| "built": { | |
| "image": "tt-model/embeddinggemma-2:d8978e0fd173", | |
| "repo": "changh95/embeddinggemma-2", | |
| "tt_model_version": "0.1.0", | |
| "created_at": "2026-12-01T02:46:55+00:00", | |
| "tt_metal": { | |
| "sha": "44d66500520fda9f2c7060c0f6b41ec48f7ab37e", | |
| "describe": "v0.80.0-dev20261006-78-g44d6650052-dirty", | |
| "dirty": true, | |
| "scm_version": "0.65.2.dev11169+g44d66500520", | |
| "mode": "local", | |
| "remote": "https://github.com/tenstorrent/tt-metal.git", | |
| "branch": "main", | |
| "pushed": true | |
| }, | |
| "code_sha256": "6d7ca0f18a248ea585f0cf0aedf0380a11b79832557fec0a8c36e6031770345e", | |
| "image_digest": "sha256:d8978e0fd1732e1e25d50cff97c9ce17f0b876e54121527194deea67d4f40969" | |
| }, | |
| "card": { | |
| "description": "EmbeddingGemma 2 maps text (100+ languages and code), images, video, audio and interleaved mixtures of them into one 768-dimensional embedding space for retrieval, classification, clustering and similarity; vectors can be truncated to 512, 256 or 128 dimensions (Matryoshka) and re-normalized. A 24-layer bidirectional Gemma-4 encoder (hidden size 512, per-layer embeddings, 270 M parameters with the token table) reads the text tokens and the soft tokens of a 16-layer vision tower (images at 70 to 1120 tokens, video at one frame per second) and a 12-layer conformer audio tower (25 tokens per second), and the token outputs are mean-pooled and L2-normalized, exactly `SentenceTransformer.encode`. On the device every stage runs in tt-nn operations with one trace per shape bucket; the sequences of a batch are packed end to end (no padding) with block-diagonal attention. Tokenization, image resizing, the log-mel front end, the token-table lookup and the final normalization run on the host CPU and are bit-exact with the official processors. The server speaks the OpenAI embeddings API for text and a native API for every modality, and merges concurrent requests into shared device launches.", | |
| "attribution": "Derived from [google/embeddinggemma-2](https://huggingface.co/google/embeddinggemma-2) (Google DeepMind), with unmodified weights downloaded from that repository. Official code: the `embedding_gemma2` model of Hugging Face [transformers](https://github.com/huggingface/transformers) and [sentence-transformers](https://github.com/UKPLab/sentence-transformers). This is a third-party port, not affiliated with or endorsed by Google. See the original model card for training details, the evaluation and the Gemma Prohibited Use Policy.", | |
| "prerequisites": "- About 1.6 GB of free disk for the weights (fetched once into the Hugging Face cache), plus the container image\n- Time for the first start: it compiles about 2,200 device kernels (18 min measured on a busy 8-core host, less on\n an idle one); they are cached, and later starts are ready in about 1 minute\n", | |
| "quickstart": "On the port `tt serve` reported:\n\n```bash\ncurl -s localhost:20000/v1/embeddings -H 'Content-Type: application/json' \\\n -d '{\"input\": [\"What causes the northern lights?\"], \"prompt_name\": \"SearchQuery\", \"dimensions\": 256}' | head -c 300\nIMG=$(base64 -w0 photo.jpg)\ncurl -s localhost:20000/embed -H 'Content-Type: application/json' \\\n -d \"{\\\"inputs\\\": [{\\\"image\\\": \\\"$IMG\\\"}, {\\\"text\\\": \\\"a photo of a cat\\\"}]}\" | head -c 300\n```\n", | |
| "architecture": null, | |
| "status": null, | |
| "intended_use": "Embedding text, code, images, video and audio on one Tenstorrent p150 for multimodal semantic search, retrieval-augmented generation, classification, clustering and similarity, from single low-latency queries to batches of documents.", | |
| "out_of_scope_use": null, | |
| "usage": "`POST /v1/embeddings` is OpenAI-compatible for text (`input`, `model`, `encoding_format` `float` | `base64`,\n`dimensions` 768 | 512 | 256 | 128, `user`; extensions `prompt_name` / `prompt`); `POST /embed` takes every\nmodality; `POST /similarity` scores `targets` against `source`; `GET /health`, `GET /info` (engines, device,\nconfiguration, limits, the 20 task prompts), `GET /v1/models`.\n\nThe model is trained with task prefixes for text: queries `task: search result | query: ...`\n(`prompt_name: SearchQuery`), documents `title: none | text: ...` (`Document`), and `Classification`,\n`Clustering`, `SentenceSimilarity`, `QuestionAnswering`, `FactChecking`, `CodeRetrieval`, ... (`GET /info`\nlists all). Images, video and audio are sent without a prefix.\n\n| request field (`/embed`) | values | default | meaning |\n| --- | --- | --- | --- |\n| `inputs` | list of up to `EMBGEMMA_MAX_INPUTS` inputs: a string, or an object with `text`, `image` (base64 file), `audio` (base64 WAV, or `{\"array\": [...], \"sampling_rate\": sr}`), `video` (`{\"frames\": [base64 images], \"fps\": f}`) keys (lists allowed; key order = sequence order), or `{\"content\": [{\"type\": \"text\", \"text\"}, {\"type\": \"image\", \"image\"}, ...]}` | required | one embedding per input; placeholders `<\\|image\\|>` / `<\\|audio\\|>` / `<\\|video\\|>` in the text place the media |\n| `prompt_name` / `prompt` | a task name / any text | none | task prefix |\n| `dimensions` | 768, 512, 256, 128 | 768 | Matryoshka truncation, re-normalized |\n| `normalize` | `true`, `false` | `true` | `false`: the model's normalized 768-d output truncated without re-normalization |\n| `output` | `sentence`, `tokens` | `sentence` | `tokens`: one 768-d vector per token |\n| `max_length`, `truncate` | 3 .. `EMBGEMMA_MAX_SEQ_LEN`; `right`, `error` | max; `right` | text-only inputs longer than `max_length` keep their first tokens (+ `<eos>`); media inputs are never cut (400) |\n| `image_tokens` | 70, 140, 280 (560, 1120 when enabled) | 280 | soft tokens per image (resolution) |\n| `video_fps`, `video_max_frames`, `video_tokens` | > 0; 1 .. 32; 70 .. 280 | 1, 32, 140 | frame sampling and per-frame budget |\n| `encoding_format` | `float`, `base64` | `float` | `base64`: little-endian float32 |\n\n- Errors: 400 with the reason, 413 too many inputs / body above `EMBGEMMA_MAX_BODY_MB`, 422 unknown fields, 429\n when `EMBGEMMA_QUEUE_DEPTH` launches wait, 503 if start-up failed or while shutting down, 500 on a device\n failure. The port accepts connections once the server is ready (`tt serve` waits for that).\n- Images with transparency (RGBA, LA, palette) are composited onto white, like the official processor.\n- A Python API with the same options (`tt_embgemma.api.EmbeddingGemma2.embed`) is described in\n [`code/PYTHON.md`](code/PYTHON.md); it needs a tt-metal build with the two patches in [`patches/`](patches/).\n\n### Configuration\n\nThe server compiles and traces its device programs when it starts: the first start compiles about 2,200 device\nkernels (18 min measured on a busy 8-core host), which are cached, so later starts take about 1 minute. Change\nthese with environment variables in the container's launch command. `GET /info` reports them. Batch size, sequence length, image size and audio length are\nnot configuration: every request runs at its real size on the compiled buckets.\n\n| item | environment variable | values | default |\n| --- | --- | --- | --- |\n| modalities loaded | `EMBGEMMA_MODALITIES` | subset of `text,image,video,audio` (text always) | all |\n| engine of every stage (text, vision, audio) | `EMBGEMMA_TEXT_ENGINE` | `ttnn`, `cpu` (float32 reference, no device) | `ttnn` |\n| vision attention of one-image launches | `EMBGEMMA_VISION_ATTN` | `sdpa` (tt-nn), `mk` (custom attention kernel) | `sdpa` |\n| sequences per text launch | `EMBGEMMA_MAX_BATCH` | 1 .. 32 | 32 |\n| inputs per request | `EMBGEMMA_MAX_INPUTS` | 1 .. 65536 | 2048 |\n| images + video frames per request | `EMBGEMMA_MAX_IMAGES` | 1 .. 4096 (~8 MB of host memory each) | 64 |\n| tokens per input | `EMBGEMMA_MAX_SEQ_LEN` | 32 .. 8192 | 2048 |\n| largest image budget | `EMBGEMMA_IMAGE_TOKENS_MAX` | 70, 140, 280, 560, 1120 | 280 |\n| video frames | `EMBGEMMA_VIDEO_MAX_FRAMES` | 1 .. 64 | 32 |\n| audio length cap | `EMBGEMMA_AUDIO_MAX_SECONDS` | 0.5 .. 30 | 30 |\n| buckets | `EMBGEMMA_TEXT_BUCKETS`, `EMBGEMMA_LONG_BUCKETS`, `EMBGEMMA_AUDIO_BUCKETS` | multiples of 32 (128 for audio frames) | `32,...,2048`; `1024,2048`; `512,1024,2048,3072` |\n| weights, matmul fidelity | `EMBGEMMA_WEIGHTS`, `EMBGEMMA_FIDELITY` | `bf16`; `HiFi4`, `HiFi3`, `HiFi2` | `bf16`, `HiFi4` |\n| default text prompt of `/v1/embeddings` | `EMBGEMMA_DEFAULT_PROMPT` | a prompt name | none |\n| merging window, queue | `EMBGEMMA_BATCH_WINDOW_MS`, `EMBGEMMA_QUEUE_DEPTH`, `EMBGEMMA_QUEUE_TIMEOUT_S` | ms, launches, s | 2, 256, 120 |\n\n### Example output\n\n\n\nCross-modal retrieval, served by this package's container on a p150. Eight images drawn by code for this demo\n(above the columns) and eight text queries are each embedded in one `POST /embed` request (the images at the\ndefault 280 soft tokens, the queries with `\"prompt_name\": \"SearchQuery\"`); the cells are cosine similarities of the\n768-d vectors. Every query finds its own image (8 of 8): matched pairs score 0.760 on average, the other pairs\n0.582.\n\n\n\nThe same with eight audio clips: four synthetic speech clips made with\n[changh95/Qwen3-TTS](https://huggingface.co/changh95/Qwen3-TTS), queried with their transcripts in their own\nlanguage, and four synthetic sounds, queried with a description. Seven of eight queries find their clip; \"a clock\nticking\" scores the white-noise clip above the clicks.\n\n| clip | what it is | query | best match (cosine) |\n| --- | --- | --- | --- |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_speech_en.wav\"></audio> [WAV](media/demo_audio_speech_en.wav) | synthetic speech, English | Hello! I'm Ryan, one of the nine preset voices. Every word you hear was generated on a single accelerator card, faster than real time. | this clip (0.908) |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_speech_zh.wav\"></audio> [WAV](media/demo_audio_speech_zh.wav) | synthetic speech, Chinese | \u4f60\u597d\uff0c\u6211\u662f\u8587\u8587\u5b89\u3002\u8fd9\u6bb5\u8bed\u97f3\u662f\u5728\u4e00\u5f20\u52a0\u901f\u5361\u4e0a\u5b9e\u65f6\u751f\u6210\u7684\u3002 | this clip (0.773; next: the English speech clip, 0.751) |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_speech_ko.wav\"></audio> [WAV](media/demo_audio_speech_ko.wav) | synthetic speech, Korean | \uc548\ub155\ud558\uc138\uc694, \uc800\ub294 \uc18c\ud76c\uc608\uc694. \uc774 \ubaa9\uc18c\ub9ac\ub294 \ud150\uc2a4\ud1a0\ub80c\ud2b8 \uce74\ub4dc\uc5d0\uc11c \uc2e4\uc2dc\uac04\uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc84c\uc5b4\uc694. | this clip (0.851) |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_clone_en.wav\"></audio> [WAV](media/demo_audio_clone_en.wav) | synthetic speech, English (a cloned voice) | This voice was cloned from a seven second reference clip, and now it reads a sentence it has never heard before. | this clip (0.898) |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_tone.wav\"></audio> [WAV](media/demo_audio_tone.wav) | 880 Hz sine, 2 s | a steady high-pitched beep | this clip (0.726) |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_siren.wav\"></audio> [WAV](media/demo_audio_siren.wav) | a harmonic tone sweeping 650-1450 Hz, 5 s | a wailing siren | this clip (0.725; next: the beep, 0.706) |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_ticking.wav\"></audio> [WAV](media/demo_audio_ticking.wav) | clicks, two per second, 5 s | a clock ticking | **the white-noise clip** (0.689; this clip 0.651) |\n| <audio controls src=\"https://huggingface.co/changh95/embeddinggemma-2/resolve/main/media/demo_audio_noise.wav\"></audio> [WAV](media/demo_audio_noise.wav) | Gaussian white noise, 2 s | white noise | this clip (0.678) |\n\nWith `\"dimensions\"` 512, 256 or 128 in the same requests (Matryoshka truncation), every image query keeps its\nbest match at every size; the audio queries keep 7 of 8 at 512 and 6 of 8 at 256 and 128, where \"a wailing siren\"\nmoves to the beep. The official sentence-transformers model in float32 on the CPU picks the same best match for\nevery query, including the ticking clip's miss; no score differs from it by more than 0.002 for the images and\n0.0035 for the audio clips, and the lowest embedding cosine to float32 is 0.99996 for the images and 0.9996 for\nthe audio clips (the click track; 0.9998 or more for the others). One text query sent alone to `/v1/embeddings`\ntook 16.8 ms on loopback (p50 of 20 requests; 10.2 ms in the server), one image 108 ms (102 ms in the server,\nincluding the image decoding and resizing on the host) and the 9.8 s English speech clip 92 ms (79 ms), on a\nshared 8-core host. The exact requests, scores and timings are in [`media/demos.json`](media/demos.json);\n[`media/make_demo.py`](media/make_demo.py) draws the images, synthesises the sounds and repeats the requests\nagainst a running server.\n", | |
| "performance": "Agreement with the official sentence-transformers float32 code on the CPU (same weights and inputs; embedding\ncosine to float32), next to the official model run in bfloat16:\n\n| eval | this package | official bfloat16 |\n| --- | --- | --- |\n| Text, 40 inputs of 2 to 2,047 tokens (task prompts, code, 6 languages, emoji): lowest / mean 1 - cosine | 0.99992 / 4.1e-5 | 0.99991 / 3.8e-5 |\n| Retrieval, 8 queries x 24 documents: top-1 agreement, largest similarity change | 8/8, 0.0025 | 8/8, 0.0020 |\n| Matryoshka 512 / 256 / 128 dimensions: retrieval top-1 agreement | 8/8 at every size | 8/8 |\n| Images, 8 at 70 / 140 / 280 tokens: lowest / mean 1 - cosine | 0.99972 / 9.1e-5 | 0.99980 / 7.1e-5 (4 images) |\n| Image vs caption similarity: top-1, largest change | 6/6, 0.0010 | 3/3, 0.0011 (measured on 3 images) |\n| Audio, 10 clips of 0.1 to 52.8 s: lowest / mean 1 - cosine | 0.99991 / 3.7e-5 | 0.99981 / 5.5e-5 (5 clips) |\n| Audio vs transcript similarity: top-1, largest change | 9/9, 0.0018 | 5/5, 0.0015 (measured on 5 clips) |\n| Video (2 clips) / interleaved text + images (2): lowest cosine | 0.99991 / 0.99991 | 0.99997 / 0.99992 |\n| Same input alone vs packed with other inputs in one device launch, lowest cosine (300 random packings; every packed result stays within the float32 gate, lowest 0.99985) | 0.99979 | 0.99988 (padded batch) |\n| 100 repeated runs per modality | bitwise identical | - |\n\n| speed (warm, traced; engine call incl. host packing and readback) | ms |\n| --- | --- |\n| text, 1 input of 16 / 32 / 128 / 512 tokens | 5.6 / 5.5 / 8.0 / 12.9 |\n| text, 1 input of 1,024 / 2,048 tokens | 28.7 / 68.1 |\n| text, 32 inputs x 16 tokens / 32 x 64 / 8 x 256 | 12.4 (2,570 inputs/s) / 41.2 (777/s) / 36.8 (218/s) |\n| image encoder, 70 / 140 / 280 tokens | 15.5 / 28.0 / 61.5 |\n| 4 images x 70 tokens in one launch | 41.1 |\n| audio encoder, 1 / 5 / 10 / 30 s | 16.7 / 16.5 / 25.1 / 60.4 |\n| served `/v1/embeddings`, one query, client round trip on loopback (p50) | 15.7 |\n\nMeasured with `code/scripts/bench.py` and `code/tt_embgemma/server/smoke_test.py` on one p150 with ETH dispatch\n(12 x 10 grid); an image or audio request adds the text pass over its soft tokens and host preprocessing (image\nresize ~30 ms for a 1600 x 900 photo, log-mel ~60 ms for 30 s).\n", | |
| "limitations": "- The official pipeline never truncates; this package caps an input at `EMBGEMMA_MAX_SEQ_LEN` tokens (2,048 by\n default, up to the model's 8,192 context). Audio is truncated at 30 s per clip like the official feature\n extractor; video keeps at most 32 frames (1 frame per second by default).\n- Video files need PyAV, which the container does not include: send decoded frames (`{\"frames\": [...], \"fps\"}`).\n- Image budgets 560 and 1120 tokens are opt-in (`EMBGEMMA_IMAGE_TOKENS_MAX`): they cost 2.6 and 7.4 TFLOP per\n image and large attention buffers.\n- Precision: bfloat16 weights and activations with float32 accumulation and float32 softmax; embeddings differ\n from the float32 model about as much as the official bfloat16 run does (table above). A result also depends\n slightly on what else shares its device launch (lowest cosine 0.99979 between an input alone and packed with\n others), like the official bfloat16 model's padding (0.99988).\n- Up to 32 sequences share one text launch; larger and concurrent requests are split / merged automatically. One\n p150 only (ETH dispatch).\n- The text path in this version is the tt-nn engine: the 24-layer text encoder runs as ~700 traced tt-nn\n operations, so a short query is bound by operation count, not by arithmetic. Measured (warm, traced): 5.6 ms\n for one input of 16 tokens, 5.5 ms at 32, 8.0 ms at 128, 12.9 ms at 512, 28.7 ms at 1,024 and 68.1 ms at\n 2,048 tokens; 12.4 ms for 32 inputs of 16 tokens. A single-program text encoder (megakernel) is planned for a\n later version; it is not part of this one.\n- Every other stage also runs in tt-nn operations under traces; a custom attention kernel for one-image vision\n launches is opt-in (`EMBGEMMA_VISION_ATTN=mk`, 7 % faster at 280 tokens).\n", | |
| "risks": null, | |
| "licensing": "- Weights (not redistributed here; `tt serve` downloads them at this commit), Apache-2.0 per the model card:\n [google/embeddinggemma-2](https://huggingface.co/google/embeddinggemma-2) `f9972ac2`. Use is subject to the\n [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy) referenced by the card.\n Notices: [`code/tt_embgemma/licenses/NOTICE.md`](code/tt_embgemma/licenses/NOTICE.md).\n- This package is a derivative work: the inference code is written anew (tokenizer framing, image / audio / video\n front ends, the three encoders, pooling and normalization follow the official code's behaviour), and the\n weights are loaded unmodified.\n- Port, server and scripts (`code/`) and the tt-metal patches in [`patches/`](patches/): Apache-2.0.\n- The demo in `media/` (figures, audio clips, `demos.json`, `make_demo.py`): Apache-2.0. Its images and sounds\n were generated by code for this package, its speech clips are synthetic speech made with\n [changh95/Qwen3-TTS](https://huggingface.co/changh95/Qwen3-TTS) (Qwen3-TTS weights, Apache-2.0; no recording of\n a person), and its queries were written for this package. Attributions:\n [`media/ATTRIBUTION.md`](media/ATTRIBUTION.md).\n", | |
| "related": "- [changh95/all-MiniLM-L6-v2](https://huggingface.co/changh95/all-MiniLM-L6-v2): sentence embeddings on p150.\n- [changh95/DepthPro2](https://huggingface.co/changh95/DepthPro2): metric depth on p150.\n", | |
| "license": { | |
| "id": "apache-2.0", | |
| "name": null, | |
| "link": null | |
| }, | |
| "pipeline_tag": "feature-extraction", | |
| "base_model": [ | |
| "google/embeddinggemma-2" | |
| ] | |
| } | |
| } | |
| } | |