interplane.Get Omega
Read in your language

omega-helix

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

omega-helix / scripts / quickstart-cpu.sh

77 lines · 2826 bytes Raw Blame History
1#!/bin/sh
2# End-to-end CPU smoke test for Omega Helix:
3# adamck -> init -> gcheck -> train -> eval -> sample ->
4# BPE roundtrip -> kvcmp (bit-exact KV cache) ->
5# DNA specialist chain (growpro/trainf/spext/spchainsamp) -> looped core (OLLMCK03)
6#
7# Usage:
8# sh scripts/quickstart-cpu.sh [path/to/ollm-binary]
9set -eu
10
11here=$(cd "$(dirname "$0")/.." && pwd)
12BIN=${1:-}
13
14if [ -z "$BIN" ]; then
15 if [ "$(uname -s)" = Darwin ]; then
16 BIN=$here/build/ollm-macos
17 [ -x "$BIN" ] || TARGET=macos sh "$here/scripts/build.sh"
18 elif [ "$(uname -m)" = x86_64 ] || [ "$(uname -m)" = amd64 ]; then
19 BIN=$here/build/ollm-x86linux
20 [ -x "$BIN" ] || TARGET=x86linux sh "$here/scripts/build.sh"
21 else
22 BIN=$here/build/ollm
23 [ -x "$BIN" ] || TARGET=aarch64 sh "$here/scripts/build.sh"
24 fi
25fi
26
27work=$(mktemp -d "${TMPDIR:-/tmp}/omega-helix-smoke.XXXXXX")
28trap 'rm -rf "$work"' EXIT
29
30# Build a small training/eval byte corpus from this repo's README and docs
31cat "$here/README.md" "$here/docs/LOOP.md" "$here/docs/CONTRACT.md" > "$work/corpus.txt"
32
33echo "=== 1. Adam self-check (adamck) ==="
34"$BIN" adamck
35
36echo "=== 2. Initialize tiny byte model (V=256, T=16, D=16, H=2, F=32, L=2, B=4) ==="
37"$BIN" init "$work/m.ck" 256 16 16 2 32 2 4 1 20 5000
38
39echo "=== 3. Finite-difference gradient check (gcheck) ==="
40"$BIN" gcheck "$work/m.ck" "$work/corpus.txt"
41
42echo "=== 4. Eval before training ==="
43"$BIN" eval "$work/m.ck" "$work/corpus.txt" 8
44
45echo "=== 5. Train 20 steps on CPU ==="
46"$BIN" train "$work/m.ck" "$work/corpus.txt" 20 5
47
48echo "=== 6. Eval after training ==="
49"$BIN" eval "$work/m.ck" "$work/corpus.txt" 8
50
51echo "=== 7. Sample 48 bytes ==="
52"$BIN" sample "$work/m.ck" 42 48 800 "Omega "
53echo ""
54
55echo "=== 8. BPE fit / encode / decode byte-exact roundtrip (V=300) ==="
56"$BIN" bpefit "$work/corpus.txt" "$work/m300.bin" 300
57"$BIN" bpeenc "$work/m300.bin" 300 "$work/corpus.txt" "$work/corpus.tok"
58"$BIN" bpedec "$work/m300.bin" "$work/corpus.tok" "$work/corpus.dec"
59cmp "$work/corpus.txt" "$work/corpus.dec"
60echo "BPE_ROUNDTRIP_OK"
61
62echo "=== 9. Bit-exact KV-cache parity check (kvcmp) ==="
63"$BIN" init "$work/bpe.ck" 300 16 16 2 32 2 4 1 20 5000 1
64"$BIN" kvcmp "$work/bpe.ck" 8 "Omega" "$work/m300.bin"
65
66echo "=== 10. DNA Merkle Specialist Chain (growpro -> trainf -> spext -> spchainsamp) ==="
67"$BIN" growpro "$work/bpe.ck" "$work/spec.ck" 3 10 1000
68"$BIN" trainf "$work/spec.ck" "$work/corpus.tok" 5 5 2
69"$BIN" spext "$work/bpe.ck" "$work/spec.ck" "$work/skill.sp"
70"$BIN" spchainsamp "$work/bpe.ck" 16 800 "Omega" 42 "$work/m300.bin" 1 "$work/skill.sp" >/dev/null
71echo "DNA_SPEC_CHAIN_OK"
72
73echo "=== 11. Looped-Core OLLMCK03 init & train (LP=1, LC=2, NP=2) ==="
74"$BIN" init "$work/loop.ck" 300 16 16 2 32 4 4 1 10 5000 1 1 2 2
75"$BIN" train "$work/loop.ck" "$work/corpus.tok" 2 2
76
77echo "QUICKSTART_CPU_OK"