StillDeadcode commited on
Commit
0047dc7
·
verified ·
1 Parent(s): 7d5ba7a

Conversion recipe

Browse files
Files changed (2) hide show
  1. README.md +2 -1
  2. minicpm5-2b-dspark.recipe +29 -0
README.md CHANGED
@@ -70,7 +70,8 @@ docker run --rm -v ~/models:/models --entrypoint rad-convert radiance \
70
  -o /models/minicpm5-2b-fp8.rad
71
  ```
72
 
73
- The recipe (`rad-info --recipe minicpm5-2b-fp8.rad`):
 
74
 
75
  ```
76
  output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
 
70
  -o /models/minicpm5-2b-fp8.rad
71
  ```
72
 
73
+ The recipe file both commands name is in this repository as `minicpm5-2b-dspark.recipe`, with its
74
+ comments. Its rules, as the container records them (`rad-info --recipe minicpm5-2b-fp8.rad`):
75
 
76
  ```
77
  output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
minicpm5-2b-dspark.recipe ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # minicpm5-2b-dspark.recipe -- MiniCPM5-2B with the DSpark drafter, as the minicpm5-2b-dspark.rad
2
+ # container serves it (scripts/convdspark.sh).
3
+ #
4
+ # OpenBMB publishes MiniCPM5-2B in bf16 only, so every linear is made block fp8 here: one amax a
5
+ # 128x128 block, scale = amax/448 rounded to bf16. The checkpoint then serves through llama_dense_fp8
6
+ # with the graph llama_fp8 declares over an fp8 release. Also:
7
+ #
8
+ # - the lm_head, block fp8: the widest GEMM in the model at half the bytes
9
+ # - the drafter's linears, block fp8 from its bf16 release
10
+ # - the drafter's 2-bit copy of the target's head (u2 codes, an f16 scale and a u8 zero a group
11
+ # of 128), read by its draft passes only
12
+ #
13
+ # Every norm, the embedding and the drafter's Markov codebooks stay bf16.
14
+
15
+ output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
16
+ dspark.draft_head.weight rtn codes=u2 zero=u8 group=128 scale=f16
17
+
18
+ blk.*.attn_qkv.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
19
+ blk.*.attn_output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
20
+ blk.*.ffn_gate_up.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
21
+ blk.*.ffn_down.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
22
+
23
+ dspark.fc.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
24
+ dspark.blk.*.attn_q.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
25
+ dspark.blk.*.attn_k.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
26
+ dspark.blk.*.attn_v.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
27
+ dspark.blk.*.attn_output.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
28
+ dspark.blk.*.ffn_gate_up.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16
29
+ dspark.blk.*.ffn_down.weight rtn codes=fp8_e4m3 block=128x128 scale=bf16