Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/blob/main/om/qwen-native/flash/main.om # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core-mv / om / qwen-native / flash / main.om` 138 lines ยท 2139 bytes Raw Blame History 1 note flash-engine 38 MODEL_DIR CAP [MODE [DEVICE [SLOTS]]], rendered UTF-8 prompt on stdin. 2 note 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, 3 note 4 writes the BF16 residual streams after every layer of every token. 4 note DEVICE 0 runs matrix products on GB10, 1 computes them on the host. SLOTS bounds resident routed experts. 5 fn fdumpbits bits uint to void 6 tkpc ulong and bits 255 7 tkpc ulong shr bits 8 8 end 9 10 fn fdump to void 11 for j ulong 2560 12 fdumpbits shr bitcast uint get fx j 16 13 end 14 for j ulong 248320 15 fdumpbits shr bitcast uint get fout j 16 16 end 17 tkpfl 18 end 19 20 fn femit id ulong to void 21 mode = get qidmode 0 22 if eq mode 1 23 qprintid id 24 end 25 if eq mode 2 26 qsessiontoken id 27 end 28 if eq mode 3 29 fdump 30 end 31 end 32 33 fn qgenerate count ulong cap ulong to void 34 id = ulong 0 35 for j ulong count 36 id = qtoken ulong get qids j j eq add j 1 count 37 end 38 for j ulong cap 39 put qrun 3 0 40 put qrun 4 add j 1 41 femit id 42 if or eq id 248044 eq id 248046 43 put qrun 3 1 44 ret 45 end 46 if eq get qidmode 0 0 47 if ge id len sizes 48 qwfail 57 49 end 50 if eq get sizes id 0 51 qwfail 57 52 end 53 emitword id 54 tkpfl 55 end 56 if lt add j 1 cap 57 id = qtoken id add count j true 58 end 59 end 60 end 61 62 fn main to int 63 if or lt argcnt 4 gt argcnt 7 64 ret 2 65 end 66 if ne qnumericarg 1 38 67 ret 2 68 end 69 cap = qnumericarg 3 70 if or eq cap 0 gt cap 1024 71 ret 2 72 end 73 slots = ulong 8320 74 if ge argcnt 5 75 mode = qnumericarg 4 76 if gt mode 5 77 ret 2 78 end 79 put qidmode 0 mode 80 if eq mode 4 81 put fdebug 0 1 82 end 83 if eq mode 5 84 put fdebug 0 2 85 end 86 end 87 if ge argcnt 6 88 dev = qnumericarg 5 89 if gt dev 1 90 ret 2 91 end 92 put qecfg 0 dev 93 end 94 if eq argcnt 7 95 slots = qnumericarg 6 96 if or lt slots 16 gt slots 26624 97 ret 2 98 end 99 end 100 put qecfg 1 slots 101 loadmodel 102 if ne get qtidentity 0 27 103 qwfail 59 104 end 105 unicodeinit 106 qwload 2 48 107 qprofile 48 108 put qrun 0 38 109 if eq get qecfg 0 0 110 qgpuopen 111 end 112 if eq get qidmode 0 2 113 qsession cap 114 else 115 encodeinput inputsize 116 count = get qnids 0 117 if eq count 0 118 qwfail 56 119 end 120 if eq get qidmode 0 5 121 for j ulong count 122 fstatnum ulong get qids j 123 end 124 end 125 if gt add count sub cap 1 2048 126 qwfail 56 127 end 128 qgenerate count cap 129 end 130 tkpfl 131 fstats 132 if eq get qecfg 0 0 133 if not lqclose 134 ret 58 135 end 136 end 137 ret 0 138 end