Archived
docs, recipes, compose: TranslateGemma 27B
The gemma3 section of ARCHITECTURES.md (geometry, traps, KV groups, linears, calibration, measurements, the DFlash2 drafter), the calibration variable and the conversion of record in GUIDE.md, the README's models table. Recipes: the int8 calibration container (KL 0.003), MXFP4 + GPTQ (KL 0.042, 56 tok/s a stream on two R9700s), and with a drafter. The compose file serves a plain Gemma 3 template: TranslateGemma's own refuses the startup render's plain turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a91a2837ff
commit
f2c0468335
8 files changed
+194
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# translategemma-27b-i8a8.recipe -- TranslateGemma 27B (arch/gemma3) for calibration: every linear
|
||||
# int8 with a bf16 scale a 128 columns, served at i8a8 over an int8 activation scaled per (row, 128).
|
||||
# KL 0.003 against the bf16 model, and it fits two 32 GB cards with room for the tap's Grams.
|
||||
#
|
||||
# rad-convert <translategemma-27b-it> --recipe data/recipes/translategemma-27b-i8a8.recipe \
|
||||
# -o translategemma-27b-i8a8.rad
|
||||
|
||||
blk.*.attn_q.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
blk.*.attn_k.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
blk.*.attn_v.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
blk.*.attn_o.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
blk.*.ffn_down.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
blk.*.ffn_gate_up.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
output.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
@@ -0,0 +1,25 @@
|
||||
# translategemma-27b-mxfp4-gptq-df2.recipe -- translategemma-27b-mxfp4-gptq.recipe with a DFlash2
|
||||
# drafter (rad-convert --draft-model). The drafter's linears are MXFP4 (read whole every draft pass;
|
||||
# drafts are verified, so this changes only what is proposed) and its head a 2-bit copy of the tied
|
||||
# embedding, rescored against output.weight, as q38-27b-quark-mxfp4-df2.recipe makes Qwen's.
|
||||
# `--reuse` of a container made by the recipe above copies its trunk.
|
||||
#
|
||||
# CALIB=<dir> rad-convert <translategemma-27b-it> --draft-model <drafter> \
|
||||
# --recipe data/recipes/translategemma-27b-mxfp4-gptq-df2.recipe -o translategemma-27b-mxfp4-gptq-df2.rad
|
||||
|
||||
blk.*.attn_q.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.attn_k.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.attn_v.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.attn_o.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.ffn_down.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.ffn_gate_up.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
output.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
|
||||
dflash.draft_head.weight rtn codes=u2 zero=u8 group=128 scale=f16 rule=search
|
||||
dflash.fc.weight rtn codes=fp4_e2m1 group=32 scale=e8m0
|
||||
dflash.blk.*.attn_q.weight rtn codes=fp4_e2m1 group=32 scale=e8m0
|
||||
dflash.blk.*.attn_k.weight rtn codes=fp4_e2m1 group=32 scale=e8m0
|
||||
dflash.blk.*.attn_v.weight rtn codes=fp4_e2m1 group=32 scale=e8m0
|
||||
dflash.blk.*.attn_output.weight rtn codes=fp4_e2m1 group=32 scale=e8m0
|
||||
dflash.blk.*.ffn_gate_up.weight rtn codes=fp4_e2m1 group=32 scale=e8m0
|
||||
dflash.blk.*.ffn_down.weight rtn codes=fp4_e2m1 group=32 scale=e8m0
|
||||
@@ -0,0 +1,16 @@
|
||||
# translategemma-27b-mxfp4-gptq.recipe -- TranslateGemma 27B (arch/gemma3): every linear MXFP4 by
|
||||
# GPTQ against the Grams a calibration run wrote (CALIB, see docs/ARCHITECTURES.md), served at
|
||||
# mxfp4a8 over an E4M3 activation scaled per (row, 128). The tied lm_head is int8 a 128 columns:
|
||||
# block fp8 cannot be split at --tp 2, where a rank holds 131104 vocabulary rows. Norms and the
|
||||
# embedding stay bf16. KL 0.042 against the bf16 model.
|
||||
#
|
||||
# CALIB=<dir> rad-convert <translategemma-27b-it> \
|
||||
# --recipe data/recipes/translategemma-27b-mxfp4-gptq.recipe -o translategemma-27b-mxfp4-gptq.rad
|
||||
|
||||
blk.*.attn_q.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.attn_k.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.attn_v.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.attn_o.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.ffn_down.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
blk.*.ffn_gate_up.weight gptq codes=fp4_e2m1 group=32 scale=e8m0 calib=$CALIB
|
||||
output.weight rtn codes=i8 group=128 scale=bf16 clamp=sym
|
||||
Reference in new issue
Block a user