interplane.Get Omega
Read in your language

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

branch main Branches Tags History

aien-train / tests / omegallm / tok / build.sh

27 lines · 1629 bytes Raw Blame History
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).
10set -eu
11here=$(cd "$(dirname "$0")" && pwd)
12root=$(cd "$here/../../.." && pwd)
13src="$root/native/omegallm/tok"
14OMC=${OMC:-$root/../omega-mv/seed/out/omc}
15OUT=${OUT:-$root/../build}
16CORES=${CORES:-18-19}
17PIN=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f
18[ -x "$OMC" ] || { echo "tok/build: omc not found at $OMC (set OMC)" >&2; exit 2; }
19got=$(sha256sum "$OMC" | cut -d' ' -f1)
20[ "$got" = "$PIN" ] || { echo "tok/build: omc sha256 $got is not the pin $PIN" >&2; exit 2; }
21mkdir -p "$OUT"
22cat "$src/tkcore.om" "$src/tkio.om" "$src/tkfit.om" "$src/tkcli.om" > "$OUT/ollm-tok.om"
23taskset -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"; }
25chmod 755 "$OUT/ollm-tok.part"
26mv "$OUT/ollm-tok.part" "$OUT/ollm-tok"
27echo "tok/build: $OUT/ollm-tok sha256 $(sha256sum "$OUT/ollm-tok" | cut -d' ' -f1) omc $PIN"