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 / common.om

89 lines · 1431 bytes Raw Blame History
1note Argument, token-list and counter helpers shared by the command-line engine and the server.
2global qids uint 8192
3global qnids ulong 1
4global qidmode ulong 1
5global qintbuf uchar 32
6fn qnumber buf view uchar * n ulong to ulong
7if or eq n 0 gt n 7
8qwfail 56
9end
10v = ulong 0
11for i ulong n
12c = get buf i
13if or lt c 48 gt c 57
14qwfail 56
15end
16v = add mul v 10 sub ulong c 48
17end
18ret v
19end
20
21fn qnumericarg a ulong to ulong
22b = new uchar 8 0
23n = argread a b 0 8
24if le n 0
25qwfail 56
26end
27ret qnumber b ulong n
28end
29
30fn outid id ulong to void
31n = get qnids 0
32if or ge n len qids ge id len sizes
33qwfail 56
34end
35put qids n uint id
36put qnids 0 add n 1
37end
38
39fn qprintid id ulong to void
40v = id
41p = ulong 31
42put qintbuf p 10
43while true bound 8
44p = sub p 1
45put qintbuf p uchar add 48 rem v 10
46v = div v 10
47if eq v 0
48break
49end
50end
51while lt p 32 bound 32
52w = write 1 qintbuf p sub 32 p
53if le w 0
54qwfail 57
55end
56p = add p ulong w
57end
58end
59
60text fstat0 "expert loads "
61text fstat1 " evictions "
62text fstat2 " device launches "
63fn fstatnum v ulong to void
64b = new uchar 24 0
65p = ulong 23
66x = v
67put b p 32
68while true bound 22
69p = sub p 1
70put b p uchar add 48 rem x 10
71x = div x 10
72if eq x 0
73break
74end
75end
76r = write 2 b p sub 24 p
77end
78
79fn fstats to void
80r = write 2 fstat0 0 len fstat0
81fstatnum get qecfg 4
82r = write 2 fstat1 0 len fstat1
83fstatnum get qecfg 5
84r = write 2 fstat2 0 len fstat2
85fstatnum get qecfg 6
86b = new uchar 1 10
87r = write 2 b 0 1
88end
89