interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / core / sovereign-core / om / qwen-native / flash / profile.om

311 lines · 7590 bytes Raw Blame History
1note Fixed architecture of the Qwen3.8-Flash-Next-FP8 text checkpoint. Every text tensor is bound before first use.
2note Layer roles: 2-10 linear attention, 11-16 full attention, 20-24 router and shared expert,
3note 25-28 attention hyper-connection, 29-32 expert hyper-connection, 33-35 indexer, 36-45 lexical layer,
4note 64+3e gate, up and down of routed expert e.
5global qcfg ulong 12
6global qrole uint 76800
7global qscale uint 196608
8global qbound uchar 196608
9global qglob uint 8
10global qngram uint 128
11text qlayerprefix "model.language_model.layers."
12text qexpertprefix "mlp.experts."
13text qsep "."
14text qscalesuffix "_scale_inv"
15text qembed "model.language_model.embed_tokens.weight"
16text qlm "lm_head.weight"
17text qmixn "model.language_model.hyper_connection_mixer.hc_norm.weight"
18text qmixd "model.language_model.hyper_connection_mixer.input_mix_weight_down.weight"
19text qmixu "model.language_model.hyper_connection_mixer.input_mix_weight_up.weight"
20fn qappend buf edit uchar * pos ulong frag view uchar * to ulong
21for i ulong len frag
22put buf add pos i get frag i
23end
24ret add pos len frag
25end
26
27fn qdecimal buf edit uchar * pos ulong x ulong to ulong
28p = pos
29if ge x 100
30put buf p uchar add 48 div x 100
31p = add p 1
32end
33if ge x 10
34put buf p uchar add 48 rem div x 10 10
35p = add p 1
36end
37put buf p uchar add 48 rem x 10
38ret add p 1
39end
40
41fn qresolven frag view uchar * n ulong to ulong
42buf = new uchar 256 0
43p = ulong 0
44l = get qcfg 7
45if lt l 64
46p = qappend buf p qlayerprefix
47p = qdecimal buf p l
48p = qappend buf p qsep
49e = get qcfg 8
50if gt e 0
51p = qappend buf p qexpertprefix
52p = qdecimal buf p sub e 1
53p = qappend buf p qsep
54end
55end
56for i ulong n
57put buf add p i get frag i
58end
59ret qwid buf add p n
60end
61
62fn qresolve frag view uchar * to ulong
63ret qresolven frag len frag
64end
65
66fn qbindid id ulong dtype ulong to void
67if or ne ulong get qwdtype id dtype ne get qbound id 0
68qwfail 40
69end
70put qbound id 1
71end
72
73fn qbind slot ulong frag view uchar * dtype ulong to ulong
74id = qresolve frag
75qbindid id dtype
76put qrole add get qcfg 9 slot uint id
77ret id
78end
79
80fn qrank2 id ulong rows ulong cols ulong to void
81if ne get qwrank id 2
82qwfail 41
83end
84base = mul id 4
85if or ne get qwshape base rows ne get qwshape add base 1 cols
86qwfail 41
87end
88end
89
90fn qlinkscale id ulong rows ulong cols ulong to void
91buf = new uchar 256 0
92p = ulong get qwnpos id
93n = ulong get qwnlen id
94for j ulong n
95put buf j get qwname add p j
96end
97n = qappend buf n qscalesuffix
98s = qwid buf n
99qbindid s 2
100qrank2 s div add rows 127 128 div add cols 127 128
101put qscale id uint s
102end
103
104fn qmatrix slot ulong frag view uchar * rows ulong cols ulong dtype ulong to void
105id = qbind slot frag dtype
106qrank2 id rows cols
107if eq dtype 1
108qlinkscale id rows cols
109end
110end
111
112fn qvecshape id ulong size ulong to void
113if or ne get qwrank id 1 ne get qwshape mul id 4 size
114qwfail 43
115end
116end
117
118fn qvector slot ulong frag view uchar * size ulong to void
119id = qbind slot frag 2
120qvecshape id size
121end
122
123fn qvector64 slot ulong frag view uchar * size ulong to void
124id = qbind slot frag 8
125qvecshape id size
126end
127
128fn qconv slot ulong frag view uchar * to void
129id = qbind slot frag 2
130a = mul id 4
131if or ne get qwrank id 3 ne get qwshape a 10240
132qwfail 44
133end
134if or ne get qwshape add a 1 1 ne get qwshape add a 2 4
135qwfail 44
136end
137end
138
139text qp2 "linear_attn.A_log"
140text qp3 "linear_attn.dt_bias"
141text qp4 "linear_attn.in_proj_a.weight"
142text qp5 "linear_attn.in_proj_b.weight"
143text qp6 "linear_attn.in_proj_qkv.weight"
144text qp7 "linear_attn.in_proj_z.weight"
145text qp8 "linear_attn.norm.weight"
146text qp9 "linear_attn.out_proj.weight"
147text qp10 "linear_attn.conv1d.weight"
148fn qgdnweights to void
149qvector 2 qp2 48
150qvector 3 qp3 48
151qmatrix 4 qp4 48 2560 2
152qmatrix 5 qp5 48 2560 2
153qmatrix 6 qp6 10240 2560 2
154qmatrix 7 qp7 6144 2560 2
155qvector 8 qp8 128
156qmatrix 9 qp9 2560 6144 2
157qconv 10 qp10
158end
159
160text qp11 "self_attn.q_norm.weight"
161text qp12 "self_attn.k_norm.weight"
162text qp13 "self_attn.q_proj.weight"
163text qp14 "self_attn.k_proj.weight"
164text qp15 "self_attn.v_proj.weight"
165text qp16 "self_attn.o_proj.weight"
166text qp33 "self_attn.indexer.index_qk_proj.weight"
167text qp34 "self_attn.indexer.k_layernorm.weight"
168text qp35 "self_attn.indexer.q_layernorm.weight"
169fn qattnweights to void
170qvector 11 qp11 256
171qvector 12 qp12 256
172qmatrix 13 qp13 12288 2560 2
173qmatrix 14 qp14 512 2560 2
174qmatrix 15 qp15 512 2560 2
175qmatrix 16 qp16 2560 6144 2
176qmatrix 33 qp33 640 2560 2
177qvector 34 qp34 128
178qvector 35 qp35 128
179end
180
181text qp20 "mlp.gate.weight"
182text qp21 "mlp.shared_expert_gate.weight"
183text qp22 "mlp.shared_expert.gate_proj.weight"
184text qp23 "mlp.shared_expert.up_proj.weight"
185text qp24 "mlp.shared_expert.down_proj.weight"
186fn qrouterweights to void
187qmatrix 20 qp20 512 2560 2
188qmatrix 21 qp21 1 2560 2
189qmatrix 22 qp22 640 2560 2
190qmatrix 23 qp23 640 2560 2
191qmatrix 24 qp24 2560 640 2
192end
193
194text qp25 "attn_hyper_connection.hc_norm.weight"
195text qp26 "attn_hyper_connection.input_mix_weight_down.weight"
196text qp27 "attn_hyper_connection.input_mix_weight_up.weight"
197text qp28 "attn_hyper_connection.block_inject_weight.weight"
198text qp29 "mlp_hyper_connection.hc_norm.weight"
199text qp30 "mlp_hyper_connection.input_mix_weight_down.weight"
200text qp31 "mlp_hyper_connection.input_mix_weight_up.weight"
201text qp32 "mlp_hyper_connection.block_inject_weight.weight"
202fn qhyperweights to void
203qvector 25 qp25 10240
204qmatrix 26 qp26 320 10240 2
205qmatrix 27 qp27 10240 320 2
206qmatrix 28 qp28 4 10240 2
207qvector 29 qp29 10240
208qmatrix 30 qp30 320 10240 2
209qmatrix 31 qp31 10240 320 2
210qmatrix 32 qp32 4 10240 2
211end
212
213text qp36 "ple.conv1d.weight"
214text qp37 "ple.key_proj.weight"
215text qp38 "ple.norm_conv.weight"
216text qp39 "ple.norm_key.weight"
217text qp40 "ple.norm_query.weight"
218text qp41 "ple.value_proj.weight"
219text qp42 "ple.ple_embedding.layer_multipliers"
220text qp43 "ple.ple_embedding.ngram_heads_offsets"
221text qp44 "ple.ple_embedding.ngram_heads_vocab_sizes"
222text qp45 "ple.ple_embedding.ngram_embedding.weight_scale"
223text qngpre "ple.ple_embedding.ngram_embedding.shard_"
224text qngsuf ".weight"
225fn qlexicalweights to void
226qconv 36 qp36
227qmatrix 37 qp37 10240 2560 2
228qvector 38 qp38 10240
229qvector 39 qp39 10240
230qvector 40 qp40 10240
231qmatrix 41 qp41 2560 2560 2
232qvector64 42 qp42 3
233qvector64 43 qp43 16
234qvector64 44 qp44 16
235qvector 45 qp45 1
236frag = new uchar 64 0
237for s ulong 128
238n = qappend frag 0 qngpre
239n = qdecimal frag n s
240n = qappend frag n qngsuf
241id = qresolven frag n
242qbindid id 1
243qrank2 id 2500012 160
244put qngram s uint id
245end
246end
247
248text qeg "gate_proj.weight"
249text qeu "up_proj.weight"
250text qed "down_proj.weight"
251fn qlayerweights layer ulong to void
252put qcfg 7 layer
253put qcfg 8 0
254put qcfg 9 mul layer 1600
255if eq rem layer 4 3
256qattnweights
257else
258qgdnweights
259end
260qrouterweights
261qhyperweights
262if eq layer 1
263qlexicalweights
264end
265for e ulong 512
266put qcfg 8 add e 1
267slot = add 64 mul e 3
268qmatrix slot qeg 640 2560 1
269qmatrix add slot 1 qeu 640 2560 1
270qmatrix add slot 2 qed 2560 640 1
271end
272end
273
274fn qglobal slot ulong name view uchar * dtype ulong to ulong
275id = qwid name len name
276qbindid id dtype
277put qglob slot uint id
278ret id
279end
280
281fn qprofile layers ulong to void
282if ne layers 48
283qwfail 45
284end
285put qcfg 0 layers
286put qcfg 1 2560
287put qcfg 2 2048
288put qcfg 3 6144
289put qcfg 4 6144
290put qcfg 5 512
291put qcfg 6 640
292for l ulong layers
293qlayerweights l
294end
295put qcfg 7 64
296put qcfg 8 0
297put qcfg 9 0
298qrank2 qglobal 0 qembed 2 248320 2560
299qrank2 qglobal 1 qlm 2 248320 2560
300id = qglobal 2 qmixn 2
301if or ne get qwrank id 1 ne get qwshape mul id 4 10240
302qwfail 43
303end
304qrank2 qglobal 3 qmixd 2 320 10240
305qrank2 qglobal 4 qmixu 2 10240 320
306for i ulong get qwstate 1
307if eq get qbound add i 1 0
308qwfail 46
309end
310end
311end