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 / crates / aien-omega-q38 / om / plan.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note A piece shorter than the native prefill minimum costs one decode pass per token. |
| 3 | fn pf_work n ulong chunk ulong min ulong to ulong |
| 4 | if lt n min |
| 5 | ret n |
| 6 | end |
| 7 | if ne rem n chunk 0 |
| 8 | ret add div n chunk 1 |
| 9 | end |
| 10 | ret div n chunk |
| 11 | end |
| 12 | note Preserve short decode pieces; otherwise choose the latest batched cut without extra passes. |
| 13 | note Zero means no checkpoint. All-ones means invalid arguments. |
| 14 | fn native_pfcut from ulong header ulong total ulong chunk ulong min ulong to ulong |
| 15 | if or eq min 0 gt min 16384 |
| 16 | ret 18446744073709551615 |
| 17 | end |
| 18 | if or lt chunk mul min 2 gt chunk 32768 |
| 19 | ret 18446744073709551615 |
| 20 | end |
| 21 | if or gt from header ge header total |
| 22 | ret 18446744073709551615 |
| 23 | end |
| 24 | note Preserve the original scalar-decode versus batched-prefill arithmetic for short pieces. |
| 25 | if lt sub total header min |
| 26 | ret header |
| 27 | end |
| 28 | if and gt sub header from 0 lt sub header from min |
| 29 | ret header |
| 30 | end |
| 31 | whole = pf_work sub total from chunk min |
| 32 | left = pf_work sub header from chunk min |
| 33 | right = pf_work sub total header chunk min |
| 34 | if le add left right whole |
| 35 | ret header |
| 36 | end |
| 37 | ret add from mul div sub header from chunk chunk |
| 38 | end |