Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/blob/main/om/qwen-native/flash/build.sh # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core-mv / om / qwen-native / flash / build.sh` 67 lines ยท 2912 bytes Raw Blame History 1 #!/bin/sh 2 # Usage: build.sh OUTPUT_DIRECTORY PINNED_FLASH_DIRECTORY. 3 # Build tool only; the executables are static seeded Omega programs bound to the attested shards. 4 set -eu 5 [ "$#" = 2 ] || { echo "usage: build.sh OUTPUT_DIRECTORY MODEL38" >&2; exit 2; } 6 mkdir -p "$1" 7 out=$(cd "$1" && pwd) 8 m38=$(cd "$2" && pwd) 9 src=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) 10 work=$(mktemp -d "$out/build.XXXXXXXX") 11 trap "rm -rf \"$work\"" EXIT 12 cd "$src" 13 OUT="$work/gpu" sh linear/build.sh >/dev/null 14 cc=$work/gpu/omc 15 store=${IPL_STORE:-$HOME/interplane-store-owner}/projects 16 omega=`c4bf9d002f7dc4aec66b2b719804d71316177ee4` 17 for f in http notls; do git --git-dir="$store/omega-mv/repo.git" show "$omega:seed/net/$f.om" > "$work/$f.om"; done 18 { 19 echo om2 20 cat tokenizer/tokio.om ../vendor/sha256.om flash/checkpoint-pins.om flash/attest.om 21 } > "$work/attest.om" 22 "$cc" < "$work/attest.om" > "$work/attest" || { echo "compile failed: attest" >&2; exit 4; } 23 chmod 755 "$work/attest" 24 pids="" 25 for p in 0:17 17:17 34:17 51:16 67:16 83:16 99:16 115:16; do 26 s=${p%:*} 27 c=${p#*:} 28 nice -n 19 "$work/attest" "$m38" "$s" "$c" > "$work/part-$s.om" & 29 pids="$pids $!" 30 done 31 fail=0 32 for pid in $pids; do 33 if ! wait "$pid"; then fail=1; fi 34 done 35 [ "$fail" = 0 ] || { echo "shard attestation failed" >&2; exit 4; } 36 { 37 echo "global qdiskpin ulong 917" 38 echo "fn qdisk38 to void" 39 for s in 0 17 34 51 67 83 99 115; do 40 cat "$work/part-$s.om" 41 rm "$work/part-$s.om" 42 done 43 echo "end" 44 } > "$work/install.om" 45 cat "$work/gpu/library.om" tokenizer/tokio.om ../vendor/json.om ../vendor/sha256.om \ 46 tokenizer/model.om tokenizer/unicode.om tokenizer/unicode-data.om tokenizer/tokenizer.om \ 47 blocks/math.om blocks/gdn.om blocks/attention.om "$work/install.om" flash/weights.om \ 48 flash/profile.om flash/diskcheck.om flash/project.om flash/graph.om flash/common.om > "$work/model.om" 49 cat "$work/model.om" flash/session.om flash/main.om > "$work/engine.om" 50 cat "$work/model.om" "$work/http.om" "$work/notls.om" flash/serve.om > "$work/serve.om" 51 for t in engine serve; do 52 "$cc" < "$work/$t.om" > "$work/flash-$t" || { echo "compile failed: $t" >&2; cp "$work/$t.om" "$out/$t.failed.om"; head -c 300 "$work/flash-$t" >&2; exit 4; } 53 chmod 755 "$work/flash-$t" 54 readelf -lWd "$work/flash-$t" > "$work/$t-elf.txt" 55 if grep -Eq "INTERP|DYNAMIC|NEEDED" "$work/$t-elf.txt"; then echo "foreign runtime dependency" >&2; exit 3; fi 56 done 57 rm "$work/model.om" "$work/http.om" "$work/notls.om" 58 (cd "$work" && sha256sum attest.om attest install.om engine.om serve.om flash-engine flash-serve engine-elf.txt serve-elf.txt > SHA256SUMS) 59 id=$(sha256sum "$work/flash-serve" | cut -c1-64) 60 if [ -d "$out/$id" ]; then 61 (cd "$out/$id" && sha256sum --quiet -c SHA256SUMS) 62 cmp "$work/SHA256SUMS" "$out/$id/SHA256SUMS" 63 else 64 rm -r "$work/gpu" 65 mv -T "$work" "$out/$id" 66 fi 67 printf "%s\n" "$out/$id"