gemma4_bf16: the 12B's image and audio embedders

rad_block_gemma4_unified.h: LayerNorm, the dense with its bias,
LayerNorm, the column's and the row's position rows, LayerNorm (eps
1e-5), the weightless RMS norm and the projection; for audio the norm
and the projection. The position table is read as its two taps of
dimension 1, which a recipe stores (gemma4-12b-bf16, -i8g).
This commit is contained in:
keptn42 committed 2026-11-04 07:20:29 +01:00
1 parent a00e5e7094
commit 81be3cb63d
6 files changed
+439 -7

No files matched your search

+5 -1
View File
@@ -70,6 +70,7 @@ struct RecMap {
int mode = 0;
std::vector<std::string> src;
int concat_dim = 0;
std::vector<int> src_index; /* RadNameMap::src_index, one per source */
};
struct RecKV { std::string name; RadKVGroupDecl d{}; bool zero = false; bool replicated = false;
bool dense = false; };
@@ -278,7 +279,10 @@ extern "C" int rad_decl_name_map(RadBuilder* b, const RadNameMap* m) {
r.declared = m->declared;
r.mode = m->mode;
r.concat_dim = m->concat_dim;
for (int i = 0; i < m->n_src; ++i) r.src.push_back(m->src[i]);
for (int i = 0; i < m->n_src; ++i) {
r.src.push_back(m->src[i]);
r.src_index.push_back(m->src_index[i]);
}
b->maps.push_back(r);
return RAD_OK;
}