File size: 1,353 Bytes
9037c05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
EmbeddingGemma 2 for the Axera AX650 / AX8850 NPU (LLM-8850 card)

This repository contains a modified version of google/embeddinggemma-2
(https://huggingface.co/google/embeddinggemma-2), Copyright Google LLC, released under the
Apache License, Version 2.0.

Modifications:
  * The text, vision and audio encoders were re-implemented with export-friendly operations,
    exported to ONNX with static shapes and compiled with Axera Pulsar2 7.0-patch1 into axmodels
    (16-bit activation / 8-bit weight quantization, 3 NPU cores).
  * The text encoder is compiled for 128, 512 and 1024 tokens; the vision encoder is split into
    three graphs (layers 0-7, 8-11, 12-15); parts of the computation (token embedding lookup,
    vision patch position embeddings / RoPE / pooling matrix, the final vision normalization and
    projection, audio log-mel features, L2 normalization) run on the host.
  * embed_tokens.bf16.bin, vision_pos_table.npy, vision_inv_freq.npy, vision_proj.npy,
    audio_window.npy and audio_mel_filters.npy are taken from or computed from the original
    checkpoint and processor configuration; tokenizer.json is the original tokenizer.

The host-side Python code in this repository (eg2_host.py, axcl_session.py, eg2_cli.py,
eg2_server.py, selftest.py) and the shell scripts are also released under the Apache License,
Version 2.0.