interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / om / qwen-native / flash / main.om

138 lines · 2139 bytes Raw Blame History
1note flash-engine 38 MODEL_DIR CAP [MODE [DEVICE [SLOTS]]], rendered UTF-8 prompt on stdin.
2note MODE 0 writes text, 1 prints token IDs, 2 serves the framed pipe, 3 writes the BF16 final hidden row and logits of each step,
3note 4 writes the BF16 residual streams after every layer of every token.
4note DEVICE 0 runs matrix products on GB10, 1 computes them on the host. SLOTS bounds resident routed experts.
5fn fdumpbits bits uint to void
6tkpc ulong and bits 255
7tkpc ulong shr bits 8
8end
9
10fn fdump to void
11for j ulong 2560
12fdumpbits shr bitcast uint get fx j 16
13end
14for j ulong 248320
15fdumpbits shr bitcast uint get fout j 16
16end
17tkpfl
18end
19
20fn femit id ulong to void
21mode = get qidmode 0
22if eq mode 1
23qprintid id
24end
25if eq mode 2
26qsessiontoken id
27end
28if eq mode 3
29fdump
30end
31end
32
33fn qgenerate count ulong cap ulong to void
34id = ulong 0
35for j ulong count
36id = qtoken ulong get qids j j eq add j 1 count
37end
38for j ulong cap
39put qrun 3 0
40put qrun 4 add j 1
41femit id
42if or eq id 248044 eq id 248046
43put qrun 3 1
44ret
45end
46if eq get qidmode 0 0
47if ge id len sizes
48qwfail 57
49end
50if eq get sizes id 0
51qwfail 57
52end
53emitword id
54tkpfl
55end
56if lt add j 1 cap
57id = qtoken id add count j true
58end
59end
60end
61
62fn main to int
63if or lt argcnt 4 gt argcnt 7
64ret 2
65end
66if ne qnumericarg 1 38
67ret 2
68end
69cap = qnumericarg 3
70if or eq cap 0 gt cap 1024
71ret 2
72end
73slots = ulong 8320
74if ge argcnt 5
75mode = qnumericarg 4
76if gt mode 5
77ret 2
78end
79put qidmode 0 mode
80if eq mode 4
81put fdebug 0 1
82end
83if eq mode 5
84put fdebug 0 2
85end
86end
87if ge argcnt 6
88dev = qnumericarg 5
89if gt dev 1
90ret 2
91end
92put qecfg 0 dev
93end
94if eq argcnt 7
95slots = qnumericarg 6
96if or lt slots 16 gt slots 26624
97ret 2
98end
99end
100put qecfg 1 slots
101loadmodel
102if ne get qtidentity 0 27
103qwfail 59
104end
105unicodeinit
106qwload 2 48
107qprofile 48
108put qrun 0 38
109if eq get qecfg 0 0
110qgpuopen
111end
112if eq get qidmode 0 2
113qsession cap
114else
115encodeinput inputsize
116count = get qnids 0
117if eq count 0
118qwfail 56
119end
120if eq get qidmode 0 5
121for j ulong count
122fstatnum ulong get qids j
123end
124end
125if gt add count sub cap 1 2048
126qwfail 56
127end
128qgenerate count cap
129end
130tkpfl
131fstats
132if eq get qecfg 0 0
133if not lqclose
134ret 58
135end
136end
137ret 0
138end