aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / docs / native / pi5-8 / orchestrator-exam / pi_estimate.sh
| 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # ESTIMATE of Pi 5 speed, scaled from the measured Pi numbers in PI5-8-MODEL-CHOICE.md (SDOT path, per-token time is proportional to the weight bytes read per token). |
| 18 | # Calibration (measured): TinyLlama 631.9 MB read per token (file minus the unread embedding table) -> 683,917 us; danube3 290.2 MB -> 309,842 us; Llama yardstick 807.7 MB -> 832,559 us. |
| 19 | # That is 1.03 to 1.08 ms per MB; this script uses 1.05 ms per MB. Not measured for any model here. Q5_0/Q8_0 tensors would use kernels the engine does not have, so their speed is unknown. |
| 20 | # usage: pi_estimate.sh <downloads.tsv> <emb.tsv> <tokens.tsv> |
| 21 | P3=822083584 |
| 22 | join -t$'\t' <(sort "$1" | cut -f1,2) <(sort "$2" | cut -f1,2,3) | join -t$'\t' - <(tail -n +2 "$3" | sort | cut -f1,2) | |
| 23 | awk -F'\t' -v p3=$P3 'BEGIN{print "model\tfile_bytes\tpct_of_p3\tfits\tactive_MB\test_ms_per_tok\test_tok_s\test_cold_prefix_s\test_s_per_decision_cached"} |
| 24 | {act=($4=="untied")?$2-$3:$2; ms=act/1e6*1.05; printf "%s\t%d\t%.0f\t%s\t%.0f\t%.0f\t%.2f\t%.0f\t%.1f\n",$1,$2,$2*100/p3,($2<=p3)?"yes":"NO",act/1e6,ms,1000/ms,$5*ms/1000,(8+16)*ms/1000}' | sort |