aien-train
AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.
Brought by drakestapleton
aien-train / tests / omegallm / tok / build.sh
| 1 | #!/bin/sh |
| 2 | # Build ollm-tok, the standalone own-BPE tokenizer program (tests/omegallm/tok/FORMAT.md), from |
| 3 | # native/omegallm/tok/*.om with the pinned seeded omc (omega-mv e5b32567, aarch64 Linux). |
| 4 | # Usage: sh tests/omegallm/tok/build.sh |
| 5 | # Env: OMC (default ../omega-mv/seed/out/omc beside this clone), OUT (default ../build beside it), |
| 6 | # CORES (taskset core list, default 18-19; omc runs at nice 10). |
| 7 | # Units, in this order (a global must come before its first use): tkcore (format, chunker, encoder, |
| 8 | # decoder; host-free, small enough for a model unit to concatenate), tkio (the Linux platform unit |
| 9 | # and fn main), tkfit (merge learner, about 441 MiB of globals) and tkcli (the commands). |
| 10 | set -eu |
| 11 | here=$(cd "$(dirname "$0")" && pwd) |
| 12 | root=$(cd "$here/../../.." && pwd) |
| 13 | src="$root/native/omegallm/tok" |
| 14 | OMC=${OMC:-$root/../omega-mv/seed/out/omc} |
| 15 | OUT=${OUT:-$root/../build} |
| 16 | CORES=${CORES:-18-19} |
| 17 | PIN=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f |
| 18 | [ -x "$OMC" ] || { echo "tok/build: omc not found at $OMC (set OMC)" >&2; exit 2; } |
| 19 | got=$(sha256sum "$OMC" | cut -d' ' -f1) |
| 20 | [ "$got" = "$PIN" ] || { echo "tok/build: omc sha256 $got is not the pin $PIN" >&2; exit 2; } |
| 21 | mkdir -p "$OUT" |
| 22 | cat "$src/tkcore.om" "$src/tkio.om" "$src/tkfit.om" "$src/tkcli.om" > "$OUT/ollm-tok.om" |
| 23 | taskset -c "$CORES" nice -n 10 "$OMC" < "$OUT/ollm-tok.om" > "$OUT/ollm-tok.part" || { |
| 24 | rc=$?; rm -f "$OUT/ollm-tok.part"; echo "tok/build: omc exit $rc" >&2; exit "$rc"; } |
| 25 | chmod 755 "$OUT/ollm-tok.part" |
| 26 | mv "$OUT/ollm-tok.part" "$OUT/ollm-tok" |
| 27 | echo "tok/build: $OUT/ollm-tok sha256 $(sha256sum "$OUT/ollm-tok" | cut -d' ' -f1) omc $PIN" |