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
aien-sovereign-core-mv / om / qwen-native / tokenizer / tokio.om
| 1 | note SPDX-License-Identifier: AGPL-3.0-only |
| 2 | global tkso uchar 4096 |
| 3 | global tksn ulong 1 |
| 4 | fn tkpfl to void |
| 5 | n = get tksn 0 |
| 6 | p = ulong 0 |
| 7 | while lt p n bound 4097 |
| 8 | w = write 1 tkso p sub n p |
| 9 | if le w 0 |
| 10 | exit 70 |
| 11 | end |
| 12 | p = add p ulong w |
| 13 | end |
| 14 | put tksn 0 0 |
| 15 | end |
| 16 | |
| 17 | note one byte to stdout |
| 18 | fn tkpc c ulong to void |
| 19 | n = get tksn 0 |
| 20 | if ge n 4096 |
| 21 | tkpfl |
| 22 | n = ulong 0 |
| 23 | end |
| 24 | put tkso n uchar c |
| 25 | put tksn 0 add n 1 |
| 26 | end |
| 27 | |
| 28 | global tcdg uchar 24 |
| 29 | fn tcpu v ulong to void |
| 30 | n = ulong 0 |
| 31 | x = v |
| 32 | dn = false |
| 33 | while not dn bound 24 |
| 34 | put tcdg n uchar add 48 rem x 10 |
| 35 | n = add n 1 |
| 36 | x = div x 10 |
| 37 | if eq x 0 |
| 38 | dn = true |
| 39 | end |
| 40 | end |
| 41 | for k ulong n |
| 42 | tkpc ulong get tcdg sub sub n 1 k |
| 43 | end |
| 44 | end |