Archived
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:
1 parent
a00e5e7094
commit
81be3cb63d
6 files changed
+439
-7
No files matched your search
@@ -0,0 +1,9 @@
|
||||
# gemma4-12b-bf16.recipe -- Gemma 4 12B ("unified": text, images, audio, Google's assistant head) at bf16.
|
||||
# Every weight stays as the release holds it. The image embedder's position table, [npos, 2, width], is read
|
||||
# as its two taps of dimension 1 (the column's rows and the row's), computed at convert and stored bf16 here.
|
||||
#
|
||||
# rad-convert <gemma-4-12B-it> --draft-model <gemma-4-12B-it-assistant> \
|
||||
# --recipe data/recipes/gemma4-12b-bf16.recipe \
|
||||
# --set quantization_config.quant_method=compressed-tensors -o gemma4-12b-bf16.rad
|
||||
|
||||
v.pos_*.weight cast dtype=bf16
|
||||
@@ -0,0 +1,18 @@
|
||||
# gemma4-12b-i8g.recipe -- Gemma 4 12B ("unified": text, images, audio, Google's assistant head) from its bf16
|
||||
# release: every trunk linear int8 with a bf16 scale per 128 columns, served at i8a8, the trunk's and the
|
||||
# assistant's lm_heads int8; the assistant's layers and the image and audio embedders bf16, the position
|
||||
# table's two taps stored bf16 (gemma4-12b-bf16.recipe).
|
||||
#
|
||||
# rad-convert <gemma-4-12B-it> --draft-model <gemma-4-12B-it-assistant> \
|
||||
# --recipe data/recipes/gemma4-12b-i8g.recipe \
|
||||
# --set quantization_config.quant_method=compressed-tensors -o gemma4-12b-i8g.rad
|
||||
|
||||
blk.*.attn_qkv.weight rtn codes=i8 group=128 scale=bf16
|
||||
blk.*.attn_o.weight rtn codes=i8 group=128 scale=bf16
|
||||
blk.*.ffn_down.weight rtn codes=i8 group=128 scale=bf16
|
||||
blk.*.ffn_gate_up.weight rtn codes=i8 group=128 scale=bf16
|
||||
|
||||
output.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
mtp.output.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
|
||||
v.pos_*.weight cast dtype=bf16
|
||||
Reference in new issue
Block a user