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-train/blob/main/docs/omegallm/README.md # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-train / docs / omegallm / README.md` 569 lines · 49937 bytes Raw Blame History Rendered 1 # Omega LLM v0 (aien-train#52) 2 3 Omega LLM v0 is a proof of concept. It is a byte-level, decoder-only transformer with 119,104 4 parameters: 5 6 - V 256, T 64, D 64, H 4, F 256, L 2, B 16. 7 - It is trained from random initialization entirely in seeded `.om` (omc, omega-mv `e5b32567`). 8 - Training runs single-threaded on the DGX Spark Grace CPU, with no GPU. 9 10 The normative spec is [CONTRACT.md](CONTRACT.md). The receipts are under 11 `evidence/OMEGALLM/core/` (the `.om` lane) and `evidence/OMEGALLM/oracle/` (the Python-stdlib referee). 12 13 ## v1 (aien-train#54) 14 15 v1 adds a byte-pair tokenizer in `.om` (`bpe.om`, concatenated between `ckpt.om` and `cli.om`), 16 shapes up to V 4096, T 256, D 256, L 8, B 64, gradient blocks G and K worker processes with 17 byte-identical results for every valid K, and the `OLLMCK02` checkpoint. The spec is 18 [CONTRACT-V1.md](CONTRACT-V1.md); v0 commands and files keep their bytes. 19 20 ```sh 21 ollm bpefit TEXT MERGES V [MAXBYTES] # fit merges: M V types chunks fitbytes 22 ollm bpeenc MERGES V TEXT TOKS # encode to u16 tokens: K bytes tokens 23 ollm bpedec MERGES TOKS OUT # decode: D tokens bytes 24 ollm init CK V T D H F L B SEED TOTAL LRMICRO [G] 25 ollm train CK TOKS UNTIL EVERY [K] # K worker processes, G mod K = 0 (Linux only) 26 ollm eval CK HELD W MERGES # MERGES required when V > 256 27 ollm sample CK SEED N TEMPMILLI PROMPT MERGES 28 ollm tune CK OUT TOTAL LRMICRO # fine-tune: keep weights, step 0, new TOTAL and lr, Adam m = v = 0 29 ``` 30 31 | What | Status | Receipt | 32 |---|---|---| 33 | rung 3: config b (V4096 T128 D192 H6 F768 L4 B40, G = K = 20, P 2,582,208), 9000 steps | EXERCISED, 2026-11-02, 41,814 s on the Grace CPU; held-out `E 9000 4486 `1823975` 680427` (0.680427 bpb over 0.99988 of `held.tok`) | `evidence/OMEGALLM/v1/` | 34 | v0 receipt suite on the v1 binary `b9b4e02d`, aarch64 | EXERCISED, 48/48 PASS (2026-11-04) | `evidence/OMEGALLM/v1/checks/core-aarch64/` | 35 | v1 referee checks, mutants d and e, K = 1/2/4 and config-a K = 1/4 identity | EXERCISED (2026-11-04) | `evidence/OMEGALLM/v1/checks/reruns.txt` | 36 37 v0's 1.463036 bpb scores 4096 × 64 bytes, 0.11803 of the same held text; v1's 0.680427 scores 38 nearly all of it, so the two are not measured on the same positions. 39 40 ## Depth growth 41 42 `ollm grow INPUT OUTPUT LAYERS TOTAL LRMICRO` adds trainable layers while 43 keeping learned tensors. See [growth behavior and verification](GROW.md). 44 Growth increases capacity; it is not a measured quality improvement. 45 46 ## Status 47 48 Evidence for every row is in `evidence/OMEGALLM/core/summary.tsv` (48/48 as expected). Every receipt 49 names the binary and source sha256 it ran; `core-receipts.sh` builds all six binaries first 50 (`build.txt`): 51 52 - `ollm` `b729cc35faa6b3543ff1893c64e8a6feafc224feba7b99f7f13353e1d2179f22`, source `47c27b0b`; 53 - mutants: a `69825ec6`, b `c7ddea4c`, c `41c85250`; gcheck step variants: h5 `0ba9e2c6`, h7 `2c1e9b3b`. 54 55 | What | Status | Receipt (`evidence/OMEGALLM/core/`) | 56 |---|---|---| 57 | `prep` on TinyStoriesV2-GPT4-valid.txt | EXERCISED | `prep.txt`: `P 27630 24867 2763 `19883834` `2220914`` | 58 | `base` unigram/bigram bpb | EXERCISED | `base.txt`: `B `4415645` `3295113`` (4.415645 / 3.295113 bpb) | 59 | `init` v0 | EXERCISED | `init-v0.txt`: `I 119104` | 60 | `train`, 50 v0 steps | EXERCISED | `train-v0-50.txt`: loss 5.429638 at step 5 to 3.110411 at step 50 nats; ln 256 = 5.545177 | 61 | resume is bit-identical | EXERCISED | `resume-cmp.txt`: steps 0→40 in one run and 0→20→40 in two runs give the same checkpoint; `cmp` rc 0 | 62 | checkpoint refusal | EXERCISED | `refuse-truncated.txt` (rc 10), `refuse-flip-magic.txt` (rc 11), `refuse-shape.txt` (D = 0, rc 12), `refuse-count.txt` (P byte changed, rc 13), `refuse-flip-payload.txt` (rc 14), `refuse-long.txt` (one byte appended, rc 15) | 63 | largest shape | EXERCISED | `init-max.txt`: `I 217664`, a `5224048`-byte checkpoint; `eval-max.txt` (W 2): `E 0 2 `5566611` `8030922`` | 64 | overflow refusals | EXERCISED | `refuse-eval-hugew.txt`: W = 2^58 → rc 23; `refuse-grad-hugeoff.txt`: 16 offsets of 2^64 − 1 → rc 22 | 65 | `eval` | EXERCISED | `eval-v0.txt`: `E 50 256 `3049318` `4399237`` | 66 | `sample` | EXERCISED (runs; output is not cross-checked) | `sample-v0-argmax.txt`, `sample-v0-t800.txt` | 67 | gradient self-check (smoke; the gate is the oracle's `xgrad`) | EXERCISED | `gcheck.txt` (small shape) maxrel 3.08146e-4; `gcheck-v0-init.txt` (v0, seed 1) 1.05146e-4; `gcheck-v0-step50.txt` (v0, 50 steps) 5.15267e-4; 76 indices each, 0 retries | 68 | gcheck step size | EXERCISED | `var-h5-*` (h = 1e-5) and `var-h7-*` (h = 1e-7) fail with rc 40 on both v0 checkpoints; see "Self-check constants" | 69 | Adam self-check (smoke; the gate is the oracle's `xstep`) | EXERCISED | `adamck.txt`: `A 5 `3cd046ce38e38e38` 0` | 70 | exp/log against Wolfram | EXERCISED | `mathck.txt`: exp at most 1 ulp, log at most 2 ulp | 71 | mutants a (dK sign), c (no bias correction) | EXERCISED, killed | `mut-a-gcheck.txt` and `mut-a-gcheck-v0.txt` (rc 40, maxrel 2.0), `mut-c-adamck.txt` (rc 41, maxrel 0.639088) | 72 | mutant b (targets shifted) | killed by the oracle only | `mut-b-gcheck.txt` passes the self-check, as expected; the kill is in `evidence/OMEGALLM/oracle/` | 73 | cross-check against the referee | EXERCISED by the oracle lane, on `b729cc35` and the three mutants | `evidence/OMEGALLM/oracle/` and `tests/omegallm/ORACLE.md` | 74 | the v0 run, 20000 steps (`tests/omegallm/v0-run.sh`) | EXERCISED: 2026-11-01T15:24:54Z to 19:23:57Z on core 9, binary `a9b5f3ec`, unit `Result=success`; held-out 1.463036 bpb at W=4096 | `evidence/OMEGALLM/v0/run/` (see "v0 result") | 75 | `a9b5f3ec` and `b729cc35` compute the same v0 run | EXERCISED | `evidence/OMEGALLM/v0/equiv-`a9b5f3ec`-`b729cc35`.txt`: same `E 2000` line from the run's step-2000 checkpoint, byte-identical checkpoint after 10 more steps; control `equiv-control-mut-b.txt` differs | 76 | `ollm` as an x86-64 Linux program (`TARGET=x86linux`, omega-mv main ``ba5559d9``) | EXERCISED, EMULATED (qemu-x86_64 8.2.2 user mode) | `evidence/OMEGALLM/x86/`: the whole receipt suite, 48/48 PASS, every receipt equal to the AArch64 one apart from hashes, paths and wall time; the v0 checkpoint's final eval `E 20000 4096 `1014099` `1463036`` reproduced | 77 | `ollm` as a UEFI application (`TARGET=x86efi`, compiler from omega-mv #1015, merged as main ``d3d1b1bc``) | EXERCISED, EMULATED (QEMU 8.2.2 TCG + OVMF) | `evidence/OMEGALLM/efi/`: the 11 commands of `tests/omegallm/efi-job.txt` read from `\OLLM\JOB.TXT`; the OUT.TXT body matches the AArch64 reference after efi-check.sh strips the banner, J (timing) and DONE lines; TR.BIN, HE.BIN and S.CK written on the FAT volume identical; mutant b differs at byte 375; corrupted checkpoint, 65535- and 65536-byte job controls pass | 78 | the same image on one physical machine (names iMac18,3 and Core i5-7500 are from earlier aienux evidence; this run does not record them) | EXERCISED on physical hardware (one machine) | `evidence/OMEGALLM/imac/`: the OUT.TXT body matches the AArch64 reference after efi-check.sh strips the banner, J (timing) and DONE lines; TR.BIN, HE.BIN and S.CK identical, `OLLM DONE 11 186521`; negative controls in `check.txt` DIFFERENT; FAT clean after the firmware's writes | 79 | `ollm` as an AArch64 UEFI application (`TARGET=a64efi`, omega-mv `target a64efi`, docs/A64-EFI.md there) | EXERCISED, virtualized (QEMU virt + EDK2, KVM on a GB10 core) | `evidence/OMEGALLM/a64efi/`: `tests/omegallm/a64efi-receipts.sh`: the 11 commands of `efi-job.txt`; the OUT.TXT body matches the AArch64 Linux reference; TR.BIN, HE.BIN and S.CK identical; `fsck.vfat -n` clean; mutant b differs | 80 | an a64efi image on one physical machine, a DGX Spark, with no operating system, so no NVIDIA operating-system driver (nvidia.ko) loaded (the machine's own UEFI firmware, its display support included, starts the image and stays beneath it: console, keyboard, files, key-poll waits; the clock is the processor's own counter) | EXERCISED on physical hardware (one machine, one boot, 2026-11-12) | `evidence/OMEGALLM/a64efi/dgx-spark/`: started by the machine's firmware from its EFI system partition; `OLLM DONE 11 13594`; the OUT.TXT body matches the reference; TR.BIN, HE.BIN and S.CK identical. The image is not build.sh's: it is this directory's sources at ``bb19fba9`` plus a unit that read the GPU's identity registers through the firmware. `evidence/OMEGALLM/a64efi/dgx-spark/BUILD.txt` records its sha256, the sha256 and composition of its source, the compiler that built it and the committed compiler that rebuilds the same bytes. The 15.8M-parameter checkpoint on that machine without an operating system is NOT_RUN: its file is larger than the machine's EFI system partition (sizes measured in `evidence/OMEGALLM/a64efi/dgx-spark/SIZES.txt`) | 81 | typed conversation (`ask`) on that DGX Spark's own keyboard and screen, no operating system (keyboard and screen through the machine's firmware) | EXERCISED on physical hardware (one machine, one session, 2026-11-12, the v0 checkpoint) | `evidence/OMEGALLM/a64efi/dgx-spark-ask/RESULT.txt`: build.sh's a64efi image; two typed lines; each answer equals the AArch64 Linux build's `sample` for the same line and seed; `OLLM DONE 1 679444`; the machine restarted itself. The transcript holds the operator's words and is not published (its sha256 is) | 82 83 `b729cc35` differs from `a9b5f3ec` only in bounds handling. The source diff shows it: the concatenated 84 source goes from ``cb80250d`…` (`a9b5f3ec`, recorded in commit `da910097`'s `init-v0.txt`) to ``47c27b0b`…` 85 (`build.txt`), and the only code changes are `OCKCAP` in `native/omegallm/ckpt.om` and the two range 86 checks in `native/omegallm/cli.om` (`ooffrow`, `cmdeval`); the rest are note lines. 87 `evidence/OMEGALLM/v0/bounds-ab.txt` (core 7, 20 s timeout) shows the behaviour. On a valid 88 largest-shape `init`, `a9b5f3ec` exits 103 (bounds trap). On `eval` with W = 2^58, where `W·T + 1` 89 wraps, it was still running at 20 s and the timeout killed it (rc 124). On a huge `grad` offset it 90 exits 103. `b729cc35` sizes the checkpoint buffer for the largest shape (`I 217664`, rc 0) and refuses 91 the other two with 23 and 22; `eval-edge-w3`/`refuse-eval-edge-w4` and 92 `grad-edge-o128`/`refuse-grad-edge-o129` pin the exact boundaries. On in-range inputs the two give 93 identical output (the equivalence receipt). `evidence/OMEGALLM/v0/provenance.txt` ties the running 94 unit to the compared files: the sha256 of the run directory's `ollm`, `run.sh` and `ck-2000.bin` 95 against `frozen/ollm` and the copied checkpoint, and the unit's start time and command line. 96 97 ## Build 98 99 ```sh 100 sh tests/omegallm/build.sh # -> ../build/ollm (AArch64 Linux) 101 sh tests/omegallm/build.sh --mutant a # also b, c: -> ../build/ollm-mut-X 102 sh tests/omegallm/build.sh --variant h5 # also h7: -> ../build/ollm-var-hX 103 sh tests/omegallm/build.sh --variant bx # small bank-A capacities (CONTRACT-V3 check 3): -> ../build/ollm-var-bx 104 sh tests/omegallm/build.sh --mutant y # bx plus the wrong bank-B layer (four lines): -> ../build/ollm-mut-y 105 TARGET=x86linux sh tests/omegallm/build.sh # x86-64 Linux ELF 106 TARGET=x86efi sh tests/omegallm/build.sh # -> ../build/ollm.efi, a UEFI x86-64 application 107 TARGET=a64efi sh tests/omegallm/build.sh # -> ../build/ollm-aa64.efi, a UEFI AArch64 application 108 TARGET=gb10 sh tests/omegallm/build.sh # -> ../build/ollm-gb10, CPU ollm plus the GB10 GPU commands 109 TARGET=gb10 sh tests/omegallm/build.sh --mutant g # also h, m, f, k, s, p, t, r, x, q, w: -> ../build/ollm-mut-X-gb10 110 TARGET=gb10 sh tests/omegallm/build.sh --variant r0 # GEMM FFMAs without reuse: -> ../build/ollm-var-r0-gb10 111 ``` 112 113 The build script does four things: 114 115 1. It checks the sha256 of the target's omc (`OMC`, defaulting to a sibling checkout): 116 - aarch64: ``2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`` 117 (omega-mv ``e5b32567``, `../omega-mv`); 118 - x86linux: ``be8c51301307555254fc59e351d281aae1aa096d91521777e33a41c8b446448a`` 119 (omega-mv main ``ba5559d9``, `../omega-mv-x86`); 120 - x86efi: ``3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194`` 121 (omega-mv PR #1022 commit ``cf9fbda1``: main ``d3d1b1bc``, where #1015's x86efi backend merged 122 on 2026-11-04, plus efi 14, `../omega-efi`); the receipts in `evidence/OMEGALLM/efi` and `imac` 123 were built earlier with omc ``b4f45121`` from #1015's commit ``5ce9ecaa``; 124 - a64efi: ``17657be4842e08d2ccb3b5c6f65b5f7209e584ad73274518cbdf0263d1fcb182`` (omega-mv with 125 `target a64efi`, `../omega-mv-a64efi`); `seed/a64efi/efirt.om` of that checkout (sha256 126 ``04dcb32a82cd2817125a4d76a9fade4f70c1de102c60b14aca4cb3583da5f5b0``, also checked) is placed 127 after the first line. 128 2. It concatenates `math.om data.om`, the pool unit (`lpool.om` on Linux, `epool.om` on UEFI; 129 CONTRACT-V3 §2), `model.om adam.om ckpt.om bpe.om cli.om` and the platform unit 130 (`lio.om` for Linux, `eio.om` for UEFI; CONTRACT §9). The x86 targets put the line 131 `target x86linux` or `target x86efi` first, a64efi `target a64efi`. 132 3. For a mutant, it changes exactly one line of the concatenated copy (`OMUTA`, `OMUTB`, `OMUTC`; 133 mutant y changes four: bx's three capacities and `OMUTY`). A variant sets both gcheck steps `GCH` 134 and `GCH2` to 1e-5 (h5) or 1e-7 (h7) and must change exactly those two lines (bx: the three 135 bank-A capacities); any other count stops the build with exit 4. 136 4. It compiles under `taskset -c $CORE nice -n 19` and prints 137 `BUILD_OK source_sha256 `. 138 139 ## Run 140 141 ```sh 142 B=../build/ollm; R="taskset -c 6 nice -n 19" 143 $R $B prep TinyStoriesV2-GPT4-valid.txt train.bin held.bin 144 $R $B base train.bin held.bin 145 $R $B init v0.ck 256 64 64 4 256 2 16 SEED TOTAL LRMICRO 146 $R $B train v0.ck train.bin UNTIL EVERY 147 $R $B eval v0.ck held.bin 256 148 $R $B sample v0.ck SEED 200 800 "Once upon a time" 149 ``` 150 151 Never commit the data or the `.bin` and `.ck` files. Every receipt in the table can be reproduced 152 with `sh tests/omegallm/core-receipts.sh`; set `CORE`, `BUILD`, `DATA` or `WORK` to override the 153 defaults. The exit codes are listed in CONTRACT §7. 154 155 ## Serve (DRA-119) 156 157 ```sh 158 ollm serve PORT CK MERGES [MAXCONN] [tplmax=N] [test=1] # AArch64 Linux; prints "MODEL id", then "PORT n" once listening 159 ollm-gb10 gserve PORT CK MERGES [MAXCONN] [tplmax=N] [test=1] # the same server, logits from the GB10 160 ollm-gb10 gserveb PORT CK MERGES [MAXCONN] [tplmax=N] [test=1] # mixed BF16, see CONTRACT-BF16.md 161 ``` 162 163 `serve.om` (aarch64 and gb10 builds; the x86 targets get `noserve.om`, which exits 2) answers 164 OpenAI-style chat requests on 127.0.0.1:PORT with omega-mv's `seed/net/http.om` and 165 `seed/json/{json,jsonw}.om`, vendored byte for byte from omega-mv ``e5b32567`` into 166 `native/omegallm/net/`. `build.sh` checks their sha256 (`NET_PIN_MISMATCH`, exit 3) and puts `om2` 167 first. One request at a time and one request per connection (`Connection: close`), so a pooled 168 idle client cannot hold the listener. A connection is served only once its first bytes arrive: 169 one that sends nothing within 20 ms of its accept waits in one of 8 pending slots (polled with 170 the listener; when all 8 are taken, new connections wait in the listen backlog) and is closed 171 unanswered 10 s after its accept. Once bytes arrive the head must complete within 10 s and the 172 body within 60 s, so a client that starts a request and stalls holds an idle server up to that 173 bound. `tplmax=N` (256 to 983040, default 65536) caps the chat template in bytes. `test=1` 174 enables the test-only members `ollm_test_output` (a string whose encoding replaces the drawn 175 tokens, then token 0) and `ollm_test_delay_ms` (0 to 10000, how long the server waits for 176 connections before each token); without it they are 400. 177 178 - `GET /health` → `{"status":"ok","in_flight":0,"busy":false}`; `GET /v1/models` → one model, whose id is read 179 from the loaded checkpoint's header: `ollm-ck0M-vV-tT-dD-hH-lL-stepS-fnvX` (checkpoint format M, 180 shapes, step field and the payload FNV-1a 64 that the load has just verified). The rung-10 181 ck60000 checkpoint (sha256 ``a53ced7265818c8f6197449315e9ca4082721665022fec4f81d4538e8d6c2d0f``) 182 is `ollm-ck02-v4096-t256-d384-h12-l8-step60000-fnv0a3ae8e8c031f163`. Every completion and chunk 183 carries the same id in `model`. 184 `in_flight` is the number of chat completions generating, 0 or 1 (one slot), and `busy` is 185 `in_flight == 1`; connections waiting in pending slots or the backlog are not counted. 186 - One generation slot. Between tokens the listener and the pending connections are served: 187 `GET /health` answers `{"status":"ok","in_flight":1,"busy":true}`, `GET /v1/models` the list, 188 and every other request 503 `server_busy` with `Retry-After: 1`. These side requests get a 189 250 ms head and 1 s body deadline, so one that starts and stalls costs the generation at most 190 about 1.3 s; a silent connection costs it 20 ms once. 191 - Between tokens the generating request's socket is peeked (`MSG_PEEK | MSG_DONTWAIT`). End of 192 stream or a socket error means the client left: generation stops, nothing more is sent, the 193 slot frees and the log line has status 499 and finish 4. A client that half-closes its 194 sending side after the request counts as gone. A stream also ends when a chunk cannot be sent. 195 - `POST /v1/chat/completions`: `messages` (content a string, null, or an array of 196 `{"type":"text","text":...}` parts joined with no separator; other part types are 400), 197 `max_tokens` or `max_completion_tokens` (1 to 999999), `temperature` (0 to 2, no exponent; 0 is 198 argmax), `seed`, `top_k` (-1 to 999999; -1, 0 and K ≥ V are off), `top_p` (0 to 1, no 199 exponent, resolution 0.000001; 0 keeps only the most probable token, 1 is off), `stop` (a 200 string or an array of at most 8 strings of 1 to 128 bytes), `tools`, `tool_choice` (`none`, 201 `auto`, `required` or an object), `stream`, 202 `stream_options.include_usage`, `n` = 1; other members are ignored (`model`). JSON or SSE 203 (`data:` chunks: role, content, tool calls, finish, optional usage, `[DONE]`). 204 - Interim template, until DRA-123 fixes a shared one: when `tools` is non-empty, `tools: ` and 205 the tools JSON exactly as sent, then `\n`; then `role: content\n` per message, an assistant's 206 `tool_calls` appended to its content as `{"name":NAME,"arguments":ARGS}` 207 (ARGS the decoded string or the object's JSON text as sent); then `assistant: `. At most 208 `tplmax` bytes. The context is token 0 plus the template's encoding; when that reaches T the 209 answer is 400 `context_length_exceeded`, stating the prompt's tokens and T (the 14,364-byte 210 allen-chat system prompt gets this against a T = 256 checkpoint). Output is at most 211 min(max_tokens, T − prompt tokens) tokens drawn with `sample`'s step (`osstep`), so the same 212 SEED and TEMPMILLI give `sample`'s bytes; with `top_k`/`top_p` on, the kept tokens are the most 213 probable (ties to the lower id), up to K and until their mass reaches `top_p`, drawn by the same 214 uniform scaled to the kept mass. Token 0 ends with `stop`, the limit with `length`, the earliest 215 stop string with `stop` (content cut before it; a stream never sends bytes a stop could still 216 claim). Bytes are sent as UTF-8; an ill-formed sequence becomes U+FFFD. 217 - Tool calls (tools non-empty, `tool_choice` not `none`): when the content from the first 218 `` on is 1 to 8 blocks `{"name":N,"arguments":A}` with only 219 whitespace between and after, each N a declared tool, the answer carries `tool_calls` (ids 220 `call__`, `arguments` the object's JSON text or the string) with `finish_reason` 221 `tool_calls` and content the text before (null when empty); otherwise the text is plain content. 222 A stream holds back a possible marker and sends the calls in one delta chunk. Role `tool` 223 messages are rendered like any other role. Whether the model emits such blocks is a model 224 matter; the checks script the output with `ollm_test_output`. 225 - `POST /v1/completions` (raw prompt, for the Omega Node edit→verify→review workflow): `prompt` 226 (a non-empty string) is the whole template: the context is token 0 plus the prompt's encoding, 227 with no role lines and no `assistant: ` prefix, so the same SEED and TEMPMILLI give 228 `ollm sample CK SEED N TEMPMILLI PROMPT MERGES`'s bytes. The scalar members are chat's 229 (`max_tokens`, `temperature`, `seed`, `top_k`, `top_p`, `stop`, `n` = 1). JSON only: 230 `{"id":"cmpl-ollm-N","object":"text_completion","created":..,"model":ID,"choices":[{"index":0,"text":..,"finish_reason":"stop"|"length"}],"usage":{..}}`. 231 400 `invalid_request` for `stream` true, for `messages`, `tools` or `tool_choice` present, and 232 for a missing, non-string or empty `prompt`; `tplmax` and `context_length_exceeded` apply as on 233 chat. Busy 503, client-left 499 and the log line are shared with chat. 234 - Refusals are JSON `{"error":{...}}`: 400 (`invalid_json`, `invalid_request`, 235 `context_length_exceeded`), 404, 405, 503 `server_busy`, and 413 `request_too_large` for a body 236 over 983040 bytes (refused at the head) or over 65532 JSON tokens (the JSON parser's tape). 237 - stdout gets one line per response: `C status prompt_tokens completion_tokens finish ms` 238 (finish 0 none, 1 stop, 2 length, 3 tool_calls, 4 client left). 239 240 `tests/omegallm/serve-check.sh` starts two servers under taskset/nice/bwrap (defaults on PORT, 241 `tplmax=4000 test=1` on TPORT), referees them with `serve-check.py` (the content oracle 242 is the same binary's `sample`, decoded with Python's `errors="replace"`; the 499 log lines are read 243 from `server-test.log` via `SERVE_TLOG`; `cmpl_*`/`t_cmpl_*` cover `/v1/completions`) and stops the PIDs it started. The checks added since 244 DRA-119's first 27 come with control checks (`*_control`, `*_is_sample`, 245 `sample_differs_from_greedy`, `t_ctl_*`, `t_forced_plain`): the same request with one input 246 changed, expecting the other outcome. A refusal (`refuse_*`) is controlled by the accepted 247 request it varies. 248 Four `parity_` checks compare the sha256 of the served text with the sha256 of `sample`'s raw 249 stdout for the same prompt, seed, temperature and token count and keep both files in `OUT/parity`; 250 the model id oracle reads the checkpoint header itself, and the gate also requires the first 251 server's `MODEL` line to equal that id and both servers to listen on 127.0.0.1 alone. 252 `tests/omegallm/serve-mutants.sh` is the negative control: it builds the seven serve mutants of 253 `build.sh` (smeth, spath, sbig, sjson, sloop, sseed, smid: the 405, 404, 413 and malformed-JSON 254 refusals removed, a 0.0.0.0 bind, a shifted seed, the old fixed id) and requires serve-check.sh to 255 fail each one on the check written for it, each run inside a private network namespace. Receipts: 256 `evidence/OMEGALLM/serve/`. 257 258 ## iMac 259 260 `tests/omegallm/efi-receipts.sh` leaves the boot image at `$WORK/ollm.img` (`scratch-efi/ollm.img`; 261 the image of the receipted run is sha256 ``2b9a420a93486a4d37ed78141a45861427090535502243ecbb67fa4008b6c162``). 262 It is a GPT disk with one EFI system partition, FAT label ALLEN, holding: 263 264 - `EFI/BOOT/BOOTX64.EFI`, the `ollm.efi` application; 265 - `OLLM/JOB.TXT` (a copy of `tests/omegallm/efi-job.txt`), `OLLM/CK.BIN` (the v0 checkpoint), 266 `OLLM/STORIES.TXT` (TinyStoriesV2-GPT4-valid.txt) and `OLLM/MATHREF.TXT`. 267 268 Write it whole to a USB stick and start the Intel iMac from the stick (hold Option at the chime and 269 pick "EFI Boot"). `ollm` runs the 11 jobs, shows each job's output on the console and appends it to 270 `\OLLM\OUT.TXT`. After the last job the console shows `OLLM DONE 11 `, and `ollm` waits up to 271 300 s for a key before returning to the firmware. A refusal ends the application at once; OUT.TXT 272 then ends with that job's output. Copy `OLLM/OUT.TXT` (and `TR.BIN`, `HE.BIN`, `S.CK`) off the stick 273 and check them against the Linux reference. `678` is the byte size of `tests/omegallm/efi-job.txt`, 274 which the banner must equal: 275 276 ```sh 277 sh tests/omegallm/efi-check.sh OUT.TXT evidence/OMEGALLM/efi/ref.out 11 678 278 (cd && sha256sum TR.BIN HE.BIN S.CK) | diff - evidence/OMEGALLM/efi/ref-files.txt 279 ``` 280 281 Status: EXERCISED on physical hardware (one machine) (`evidence/OMEGALLM/imac/`, run 2026-11-01). Apple's 282 firmware ran all 11 jobs and its FAT driver accepted the writes: the OUT.TXT body matches the AArch64 283 reference after efi-check.sh strips the banner, J (timing) and DONE lines, the three written files match 284 `ref-files.txt`, and `fsck.vfat -n` finds the volume clean. The firmware clock gave 186521 ms in total, 285 against `1004245` ms under TCG on one GB10 core. The run itself does not record machine identity. 286 Whether the console showed the `efi 13` text was not recorded. 287 288 Reading the stick back: after the run, macOS 26 refused to mount the stick's partition, even 289 read-only, although a `dd` copy of the same bytes mounts as a file and checks clean. Copy the raw 290 partition (`sudo dd if=/dev/rdiskNs1 of=STICK.img bs=1m`) and take the files out with 291 `MTOOLS_SKIP_CHECK=1 mcopy -i STICK.img ::/OLLM/OUT.TXT …`. 292 293 ## DGX Spark and other Arm machines, without an operating system 294 295 `TARGET=a64efi` gives `ollm-aa64.efi`, which a 64-bit Arm UEFI firmware starts as 296 `\EFI\BOOT\BOOTAA64.EFI` (or from a firmware boot entry). It reads `\OLLM\JOB.TXT` and writes 297 `\OLLM\OUT.TXT` exactly as the iMac image does. When `\OLLM\REBOOT.TXT` exists the image restarts 298 the machine when the job is done (after its wait for a key); without it, it returns to the firmware. 299 300 ``` 301 sh tests/omegallm/a64efi-receipts.sh # virtualized: QEMU virt + EDK2, compared with a Linux build 302 ``` 303 304 On a machine that already runs Linux from the same disk, one boot without touching the boot order: 305 copy the image to the EFI system partition (for example `\EFI\OMEGA\OLLM.EFI`) and the job files to 306 `\OLLM`, create a firmware entry for it (`efibootmgr -c ... -l '\EFI\OMEGA\OLLM.EFI'`), put the boot 307 order back as it was, and select the entry for the next boot only (`efibootmgr -n ENTRY`). After the 308 restart, compare `\OLLM\OUT.TXT` with `efi-check.sh` as above. Status and receipts: the Status table. 309 The model runs on the processor only: the GPU commands need the Linux NVIDIA driver and are not in 310 this image. 311 312 ### Typing to the model on the bare machine 313 314 A job line `ask CK SEED N TEMPMILLI [MERGES]` in `\OLLM\JOB.TXT` turns the machine's own keyboard and 315 screen into a conversation: the image prints `You: `, you type a line and press Enter, and the model 316 continues it with N tokens (the same computation as `sample CK SEED+turn N TEMPMILLI LINE [MERGES]`). 317 Backspace removes a character. An empty line, Esc, or ten minutes without a key ends it, and the 318 image goes on as after any job. Everything typed and answered is also in `\OLLM\OUT.TXT`. Both UEFI 319 images have it (x86efi and a64efi); the Linux programs do not, and no recorded job file uses it. 320 `tests/omegallm/a64efi-receipts.sh` types two lines on the virtual console and requires both answers 321 to equal the Linux build's `sample` output (row `ask`). On a physical keyboard: one session on a DGX 322 Spark (a64efi, 2026-11-12, two typed lines, both answers equal to `sample`'s: 323 `evidence/OMEGALLM/a64efi/dgx-spark-ask/RESULT.txt`); the x86efi image on a physical keyboard is NOT_RUN. 324 325 ## Throughput 326 327 All timings ran on Spark GB10 Grace core 6. `host.txt` records its `midr_el1` (0x410fd851, Arm part 328 0xd85, Cortex-X925) and a 3900 MHz maximum clock. The process ran single-threaded under `nice -n 19` 329 on a shared host, so the step time depends on what else runs on that core. Each figure below is one 330 run, not a distribution. 331 332 - `train-v0-50.txt`: 50 steps took 35.`315644994` s wall, including 10 checkpoint saves. 333 - Per step: WolframLanguageEvaluator `35.`315644994`/50` → 0.70631 s. 334 - Throughput: `50*1024/35.`315644994`` → 1449.78 training bytes/s. 335 - `resume-a-0-40.txt`: 40 steps with one save took 28.`143739881` s. Per step: `28.`143739881`/40` → 336 0.70359 s. `100*(sps-s40)/s40` → 0.39%: this run's per-step time with a save every 5 steps was 337 0.39% above the one-save run. With one sample of each, that is not a measured cost of saving. 338 - `gcheck-v0-init.txt`: 44.7 s for 76 indices. 339 - A checkpoint is `112+24*119104` → 2,858,608 B. 340 341 ## The v0 run 342 343 `tests/omegallm/v0-run.sh` is the script of the first full run. It is the init line of the receipts 344 with seed 1 and TOTAL 20000, trained in 1000-step chunks; each chunk is followed by a held-out eval 345 at W=256 and a saved checkpoint. Chunking does not change the result, because resume is 346 bit-identical (`resume-cmp.txt`). After the last chunk it runs one eval at W=4096 and writes three 347 samples at TEMPMILLI 800 and one argmax sample, each 400 bytes after the prompt "Once upon a time". 348 349 The run directory holds `v0-run.sh` copied as `run.sh` (sha256 ``4898aae5`…`), the binary as 350 `ollm`, `train.bin` and `held.bin`. On 2026-11-04 a four-line usage comment (lines 2-5) was added 351 to `tests/omegallm/v0-run.sh`; `sed 2,5d tests/omegallm/v0-run.sh | sha256sum` still gives 352 ``4898aae5`…`, so the run's `run.sh` is the script without that comment. It was started with 353 354 ```sh 355 systemd-run --user --unit=ollm-v0 --collect -p CPUAffinity=9 -p Nice=19 -p MemoryMax=1G \ 356 /bin/sh /run.sh 357 ``` 358 359 The unit keeps systemd's default working directory (the home directory); `run.sh` begins with 360 `cd "$(dirname "$0")"`, so every file it names is in the run directory. `provenance.txt` records 361 the unit's `ExecStart`, `CPUAffinity`, `Nice`, `MemoryMax`, `WorkingDirectory` and start time, and the 362 sha256 of the running `ollm`, `run.sh`, `ck-2000.bin` and data against the copies the equivalence 363 receipts used. 364 365 The running binary is `a9b5f3ec`, built before the bounds fix. On in-range inputs it gives the same 366 output as `b729cc35`: `evidence/OMEGALLM/v0/equiv-`a9b5f3ec`-`b729cc35`.txt` evaluates and trains 10 steps 367 from the run's own step-2000 checkpoint with both binaries, and the two checkpoints are byte-equal 368 (`equiv-control-mut-b.txt` is the negative control). `bounds-ab.txt` shows where they differ: init at 369 the largest shape and the two overflow refusals. 370 371 Planned length, WolframLanguageEvaluator with sps = 0.70631 s/step from `train-v0-50.txt`: 372 373 - Duration: `20000*sps/3600` → 3.92 h of training on one X925 core at nice 19 on a shared host, 374 plus the evals. (The launch estimate, from an earlier run of the same receipt at 0.70749 s/step, 375 was 3.93 h.) 376 - Data seen: `20000*16*64/`19883834`` → 1.03 passes over the training bytes, in expectation. 377 - LRMICRO 3000 is the only learning rate exercised. 378 379 ## v0 result 380 381 All figures below come from `evidence/OMEGALLM/v0/run/` (core 9, Cortex-X925, nice 19, binary 382 `a9b5f3ec`, data ``101b41c6`…`/``729e0a4a`…` in `shas.txt`). Arithmetic is WolframLanguageEvaluator, 383 quoted with each result. 384 385 - The unit ended `Result=success`, `ExecMainStatus=0` (`unit.txt`). It ran from 15:24:54Z to 386 19:23:57Z, 14343 s: `14343/20000` → 0.717 s/step, including 21 evals and 20 checkpoint copies. 387 - Final checkpoint `ck.bin` = `ck-20000.bin`, sha256 ``ddf790fc`…`, 2,858,608 B (not committed). 388 - Held-out loss, first 256 windows (`evals.txt`), bits per byte: 389 390 | step | 0 | 1000 | 2000 | 5000 | 10000 | 15000 | 19000 | 20000 | 391 |---|---|---|---|---|---|---|---|---| 392 | bpb | 7.991001 | 2.163609 | 1.929394 | 1.693245 | 1.563117 | 1.491841 | 1.440312 | 1.432839 | 393 394 Still falling at the end: 19000→20000 is `100*(1.432839-1.440312)/1.440312` → −0.519%, 395 18000→19000 → −0.947%. This run does not show where it stops falling. 396 - Final eval (`final-eval.txt`): `E 20000 4096 `1014099` `1463036``, 1.463036 bpb over 4096 windows, 397 `4096*64/`2220914`` → 11.8% of the held-out positions (the W=256 series covers 0.74%). 398 `final-eval-`b729cc35`.txt` recomputes this line from `ck-20000.bin` with the bounds-fixed binary. 399 - Against the byte baselines in `base.txt`: `100*(1-1.463036/3.295113)` → 55.6% below bigram, 400 `100*(1-1.463036/4.415645)` → 66.9% below unigram. The baselines score every byte transition of 401 the held-out file, the eval only the first 4096 windows, so this compares different position sets. 402 - Training loss of the last step (`train.txt`, one batch): `T 20000 917244` → `0.917244/ln 2` → 403 1.3233 bits per byte. Single-batch values swing (19500: 0.937854, 19750: 1.003060 nats), so the 404 gap to held-out is not measured here. 405 - Samples (`sample-*.txt`, 400 bytes after "Once upon a time"; not cross-checked by the oracle): 406 the model writes TinyStories-shaped text with names, quotes and sentence structure, plus misspelled 407 and invented words ("chisting", "spinnat"). The argmax sample falls into a loop ("The bird said, \"I 408 will help you to the park.\"" repeats from about byte 100). 409 410 This is a 119,104-parameter byte model trained once with one learning rate on one seed. The run 411 shows that the `.om` trainer learns on real data end to end; it does not establish quality against 412 any other implementation's training run of the same shape. 413 414 ## Self-check constants 415 416 - `MCTOL 1e-15`: the allowed relative error of first-party `fexp`/`flog` against the correctly rounded 417 Wolfram value. 418 - In ulps: WolframLanguageEvaluator `10.^-15/2.^-52` → 4.50 ulp-equivalents. 419 - Observed (`mathck.txt`): exp 2.70e-16 (`2.70*^-16/2.^-52` → 1.22) and log 3.37e-16 (→ 1.52). 420 - The margin is `10.^-15/3.37*^-16` → 2.97×. 421 - `tests/omegallm/mathref.txt` is the reference: 3017 `e` lines and 2122 `l` lines. 422 - Each RBITS value is the round-half-even f64 of a 60-digit Wolfram `Exp`/`Log` at the exact 423 XBITS value. The bits are constructed explicitly, including the subnormal, overflow and zero 424 cases. 425 - The exp grid covers k/1000 on [−1, 1], 1000 points on [−745, 709.78], and the 426 overflow/underflow thresholds. 427 - The log grid covers 1/2 + k/1000 up to 2, 10^k for k = −307..307, the subnormals, the largest 428 f64, and 1 ± 1 ulp. 429 - The generator is `tests/omegallm/mathref.wl` (sha256 430 ``fd94187c1e267c527f9876bb4dd076e5a0b7487d1ba82149375e09d199f3bf75``). Running it, then evaluating 431 `{StringLength[text], IntegerString[Hash[text,"SHA256"],16,64]}` in WolframLanguageEvaluator, 432 gives 185004 and ``3ecc26a3cdf64d640e098eb057e2adfbe390e78fef20b64d5f83e5fa907e961a``. That is the 433 same as `sha256sum tests/omegallm/mathref.txt`, so the committed file is exactly what the generator 434 writes. 435 - gcheck takes four indices per tensor instance, drawn by splitmix64, and computes the central 436 difference `(L(p+h)−L(p−h))/((p+h)−(p−h))` against the hand gradient. For each index, 437 `rel = |num−g|/max(|num|,|g|,GCFLOOR)`. GCFLOOR 1e-6 and GCTOL 1e-3 are unchanged. 438 - `GCH` was 1e-5. The h5 variant build reproduces that: on the v0 init checkpoint it fails (rc 40) 439 at index 34180, `c 34180 `284589607` `286581380`` (hand gradient and difference, ×1e-12), rel 440 6.`950114e`-3 (`var-h5-gcheck-v0-init.txt`); at step 50 it fails at index 82501, rel 2.`588816e`-3. 441 The real build (h = 1e-6) has `c 34180 `284589607` `284589241`` at the same index 442 (`gcheck-v0-init.txt`), so the hand gradient is unchanged and only the difference moved. The 443 oracle's `xgrad-v0` agrees with the hand gradient code to ≤ 3.3e-12 per tensor 444 (`evidence/OMEGALLM/oracle/README.md`). A difference that is wrong while the gradient is right is 445 the signature of `p ± h` moving a ReLU pre-activation across 0, where the loss has a kink: the 446 difference then measures a one-sided slope, not the gradient. 447 - WolframLanguageEvaluator `rel[g_,n_]:=Abs[n-g]/Max[Abs[n],Abs[g],10^6]` on the two lines → 448 6.`950113e`-3 (h = 1e-5) and 1.`286062e`-6 (h = 1e-6). 449 - `GCH` is now 1e-6. An index over GCTOL is redone once at `GCH2 = 2.5e-7`, and the smaller rel is 450 kept; the `C` line counts these retries. A smaller h narrows the band of pre-activations whose 451 kink it can cross. The cost is more f64 rounding noise in L(p±h)/h. 452 - Roundoff in the difference is about `eps·L/h` with eps = 2^-53 and L ≈ 5.545 (the init loss). 453 WolframLanguageEvaluator `With[{e=2.^-53,L=5.545},{e*L/10.^-6, e*L/(2.5*^-7), e*L/10.^-7}]` → 454 6.16e-10, 2.46e-9, 6.16e-9 absolute. Divided by GCFLOOR 1e-6 that is a worst-case rel of 6.2e-4, 455 2.5e-3 and 6.2e-3 for a gradient at the floor. 456 - The h7 variant build (h = 1e-7) fails on that roundoff, as the bound predicts: v0 init rel 457 1.`883774e`-3 at index 27146, `c 27146 -`6471488` -`6483702``; step 50 rel 3.`555355e`-3 at index 76993 458 (`var-h7-gcheck-v0-*.txt`). The real build has `c 27146 -`6471488` -`6471712`` there; `rel` above → 459 1.`883800e`-3 and 3.`461217e`-5. 460 - In the variant builds GCH2 equals GCH, so their retry count is a repeat at the same h, not a 461 second step size. 462 - The h/4 retry can exceed GCTOL from roundoff alone, but it only replaces rel when it is smaller, 463 so it cannot turn a pass into a fail, and a wrong gradient (mutant a, rel 2.0) fails at both step 464 sizes. 465 - Observed rels of the real build, all with 0 retries; margin WolframLanguageEvaluator 466 `10.^-3/{3.08146*^-4, 1.05146*^-4, 5.15267*^-4, 4.72375*^-4}` → {3.245, 9.511, 1.941, 2.117}: 467 small shape 3.08146e-4, v0 init 1.05146e-4, v0 at step 50 5.15267e-4, mutant-b small shape 468 4.72375e-4. 469 - Mutant a reaches 2.0, with 23 retries on the small shape and 38 at v0. It exits 40 on both. 470 - These constants are deterministic per checkpoint, so a pass is reproducible. The 1.94× margin at 471 a trained v0 checkpoint is the tightest; recheck it if the shapes change. 472 - gcheck and adamck are smoke checks of the binary against itself. The gate for the gradient and 473 the Adam step is the oracle's `xgrad`/`xstep` (`evidence/OMEGALLM/oracle/`). 474 475 ## Sizing 476 477 Every query is WolframLanguageEvaluator, 2026-11-01. 478 479 - **Pool (`OWN` `1400000` f64, model.om).** `geom` transcribes the layout of model.om 480 `ogeom`/`ogeom3`/`oastr`/`ogeom2`: 481 482 ``` 483 geom[{v_,t_,d_,h_,f_,l_}]:=Module[{lstr,lay0,gf,p,astr,hf,sf,z,pr,end}, lstr=4 d d+2 d f+2 d; lay0=v d+t d; gf=lay0+l lstr; p=gf+d; astr=8 t d+2 t+h t t+2 t f; hf=4 p+l astr; sf=hf+t d; z=sf+t; pr=z+t d; end=pr+t v+7 t d+t f+256; {p,end}] 484 ``` 485 486 `{geom[{256,64,64,4,256,2}], geom[{256,64,64,8,256,4}]}` → {{119104, 710464}, {217664, `1334336`}}: 487 P and the pool end for v0 and for the largest shape. Both end below `1400000`, and `ogeom` refuses 488 a layout past it (exit 12). `init-max.txt` prints `I 217664`. 489 - **Checkpoint buffer (`OCKCAP`, ckpt.om).** A checkpoint is 112 header bytes plus params, m and v: 490 `{112+24*217664, 112+24*119104}` → {`5224048`, `2858608`} B for the largest shape and v0. 491 `OCKCAP` is `5224048` + 1: the spare byte lets a read detect a file longer than any checkpoint 492 (exit 15). `init-max.txt` records the `5224048` B file. 493 v2 (2026-11-04 note, CONTRACT-V2): the v2 maximum (V 4096, T 256, D 384, H 12, F 1536, L 8, 494 P 15,833,472) has a 120-byte header (`OLLMCK02`), so a checkpoint is `120+24*`15833472`` → 495 `380003448` B and `OCKCAP` is `380003449`. `../../evidence/OMEGALLM/gpu-r7/cpu/ock-boundary.txt`: the 496 `380003448` B file loads, the file plus one or two bytes exits 15. The pool and the numbers above 497 are the v0/v1 sizing; the v2 storage split is in CONTRACT-V2 §2. 498 - **adamck under mutant c (adam.om).** Without bias correction the step-s update is the corrected 499 one times `r[s_]:=(1-(9/10)^(s+1))/Sqrt[1-(99/100)^(s+1)]`; `Table[r[s],{s,0,4}]` → {1, 1.346874, 500 1.572475, 1.732455, 1.849790}. With adamck's warmup lr `lr[s_]:=(1/1000)(s+1)/100`, epsilon 501 `e=10^-8` and its gradients |g| ∈ {1, 2, 3}·1e-4: 502 503 ``` 504 mut[g_]:=Sum[lr[s](1-(9/10)^(s+1)) g/(Abs[g] Sqrt[1-(99/100)^(s+1)]+e),{s,0,4}]; 505 ref[g_]:=Sum[lr[s] g/(Abs[g]+e),{s,0,4}]; rel[g_]:=Abs[mut[g]-ref[g]]/Abs[ref[g]]; 506 N[{rel[10^-4],rel[2 10^-4],rel[3 10^-4]},16] 507 ``` 508 509 → {0.`6386062690569244`, 0.`6389678457053756`, 0.`6390884175446797`}. The maximum agrees with 510 `mut-c-adamck.txt`, `A 5 `3fe473698d936acd` `639088417544678`` (maxrel × 1e15), to 14 significant 511 digits: WolframLanguageEvaluator decodes the bits to 0.`6390884175446786`, |Δ| → 1.143e-15, f64 512 rounding of the sum. 513 514 ## GB10 GPU training (rung 4) 515 516 `TARGET=gb10` builds `ollm-gb10`: the aarch64 `ollm` with its `fn main` renamed `ocpumain` and 517 `native/omegallm/gpu/` appended. `gk.om` (f32 GEMMs: 32×32 tiles as ids 0-7 plus the fused-epilogue 518 ids 25/26; 64×64 tiles as the even ids 40-54 plus the fused-epilogue ids 56/58, two slots each) and 519 `gr.om` (slots 9-24, with 12, 17 and 18 empty: embedding, RMS norm, column sums, causal softmax, 520 copy/zero, CE, the embedding-gradient CSR gather, the SQN sum of squares and ADAM) emit 521 SASS for sm_121 into a code image; `gg.om` plans 522 an arena, uploads, launches and reads back through `context.om`/`vector.om`/`launch.om`, vendored from 523 aien-dev/CUDApp `dcba8bb8`, on the raw NVIDIA driver. No CUDA runtime or toolkit is used to build or run 524 it; nvdisasm is a read-only oracle (`tests/omegallm/gpu-disasm.sh SLOT...`). 525 The `evidence/OMEGALLM/gpu-k*/run.sh` files are as-run window receipts with machine-local paths; the 526 reusable entry points are `tests/omegallm/build.sh` and `tests/omegallm/gpu-disasm.sh`. 527 528 ```sh 529 B=../build/ollm-gb10 530 $B gcmp CK DATA S # chip gradient vs CPU f64 ograd for batch S; GCMP PASS or exit 45 531 $B gcmp2 CK DATA S # branch-conditioned parity (ReLU flips split out); GCMP2 PASS or exit 47 532 $B gacmp CK DATA S # one step, on-chip f32 Adam vs CPU f64 oadam; GACMP PASS or exit 46 533 $B gtrain CK TRAIN UNTIL EVERY # train with the chip gradient, Adam on the CPU 534 $B gtrainf CK TRAIN UNTIL EVERY # train with weights and Adam state resident on the chip 535 $B geval CK HELD W [MERGES] # eval's forward on the chip in f32; prints eval's E line 536 $B gprof CK TRAIN N # N gtrainf steps, nothing saved; GP id gx gy gz m n k wait_ns per launch of the last step 537 ``` 538 539 Run them only inside a `spark-window`. The checkpoint format is unchanged, so CPU `eval`, `sample` and 540 `train` read what `gtrain`/`gtrainf` write. 541 542 | What | Status | Receipt (`evidence/OMEGALLM/gpu/`) | 543 |---|---|---| 544 | chip gradient matches the CPU f64 gradient within γ_R = R·2^-24 | EXERCISED (GB10, non-quiet) | `gc-small.txt` rel 2.35e-7, `gc-night.txt` rel 1.614e-4 < 3.05e-4; mutant g FAIL rc 45 on both | 545 | on-chip Adam matches `oadam` above f32 weight rounding (resid < 2^-16) | EXERCISED (GB10, non-quiet) | `ga-small.txt` resid 2.34e-7, `ga-night.txt` resid 1.28e-7; mutant h FAIL rc 46 on the night checkpoint (step 1000); on the step-0 checkpoint mutant h is invisible by construction | 546 | `gtrain` 1750→9000 on the v1 night shape | EXERCISED (GB10, non-quiet) | `gtrain1-3.txt`, 0.235-0.248 s/step | 547 | `gtrainf` 0→9000, the whole v1 schedule | EXERCISED (GB10, non-quiet) | `gtrainf-0-9000.txt`, 483.8 s, 0.0538 s/step; trajectory within 1.14% of `gtrain` at every shared save point | 548 | held-out eval of both step-9000 checkpoints (CPU `eval`, W 4486) | EXERCISED | `eval9000-gtrain.txt` 1.824653 nats, 0.680680 bpb; `eval9000-gtrainf.txt` 1.826877 nats, 0.681510 bpb | 549 | rung 5 (V 4096, T 256, D 256, L 8, P 7,409,920, B 64): `gcmp` fails on ReLU branch flips; `gcmp2` passes | EXERCISED (GB10, non-quiet) | `../gpu-max/gc-max.txt` FAIL rc 45; `../gpu-max/gc2-max-s7.txt`, `gc2-max-s11.txt`, `gc2-night-s7.txt`, `gc2-small-s3.txt` PASS; mutants g, m, f FAIL rc 47 | 550 | rung 5 `gtrainf` 0→9000 | EXERCISED (GB10, non-quiet) | `../gpu-max/gtrainf-0-250.txt`, `gtrainf-250-9000.txt`: 0.3808 s/step, 43,023 tokens/s; mean batch loss of the last four saves 1.4978 nats | 551 | held-out eval of rung-5 steps 2000 and 9000 (CPU `eval`, W 2243 at T 256) | EXERCISED | `../gpu-max/eval2000.txt` 1.789590 nats, 0.667600 bpb; `../gpu-max/eval9000.txt` 1.445466 nats, 0.539226 bpb | 552 | CE kernel sum fix: the plain f32 sum of exp over V 4096 ran ~1.04e-5 low; Kahan sum in `grce` | EXERCISED (GB10, non-quiet) | `../geval/plain/gd-*.txt` before, `../geval/gd-*.txt` after; the rung-4 and rung-5 runs above trained with the plain sum | 553 | `geval` matches CPU `eval` within 10 µnats | EXERCISED (GB10, non-quiet) | `../geval/ge-night-gtrainf.txt`, `ge-night-gtrain.txt`, `ge-max-2000.txt`, `ge-max-9000.txt`: the CPU E lines exactly, 8.47 s of chip time for the step-9000 eval against 7323 s of CPU; mutant k (plain sum) Δ −11 FAIL; the first build failed the gate (`../geval/plain/`). `geval` has no loss gate and exits 0 whenever it completes (the mutant k receipts too); the 10 µnat gate is the E-line comparison against CPU `eval`, applied by the reviewer | 554 | rung 6 `gtrainf` 0→30000 at the rung-5 shape in 18 spark-windows, `geval` after every leg | EXERCISED (GB10, non-quiet) | `../gpu-r6/`: every leg and `geval` rc 0; 0.37712 s/step, 43,445 tokens/s; held-out loss fell at every leg to E 30000 2243 `1338156` 499194 (1.338156 nats, 0.499194 bpb); CPU `eval` of `ck30000` gives the same E line (`eval30000.txt`) | 555 | k1 kernels: one-warp softmax rows, split-K weight gradients, spin wait; product passes `gcmp2`, `gacmp`, `geval` | EXERCISED (GB10, non-quiet) | `../gpu-k1/`: `geval` of rung 5 `ck9000` and rung 6 `ck30000` give the earlier E lines exactly; mutants s, p FAIL rc 47; 200 steps 1.182× faster than the softmax-only build | 556 | k2: 64×64 f32 GEMM tile (slots 32-39) when m and n are multiples of 64 | EXERCISED (GB10, non-quiet) | `../gpu-k2/`: `gcmp2`, `gacmp`, both `geval` E lines exact; mutant t FAIL rc 47; the checkpoint after 200 steps is bit-identical to k1's; 200 steps 1.061× faster than k1, GEMM wait −17.45% | 557 | k3: RMS norm kernels (ids 10, 11) one warp per row, coalesced, single pass | EXERCISED (GB10, non-quiet) | `../gpu-k3/`: `gcmp2`, `gacmp`, both `geval` E lines exact; mutant r FAIL rc 47 (small and max); RMS kernels 2.50× and 2.47× faster in the profile; 200 steps 1.058× faster than k2 in the same window | 558 | k4: cross-entropy kernel (id 21) one warp per row, coalesced, no stored e (3 reads + 1 write) | EXERCISED (GB10, non-quiet) | `../gpu-k4/`: `gcmp2`, `gacmp`, both `geval` E lines exact; mutant x FAIL rc 47 (small and max) and `geval` Δ −362083 µnats; `grce` 3.68× faster in the profile; 200 steps 1.041× faster than k3 in the same window | 559 | k5: causal attention GEMMs (ids 0, 1, 35 at batch 512) skip blocks and K tiles above the diagonal via arg words; `grsoftb` masks dp above it | EXERCISED (GB10, non-quiet) | `../gpu-k5/`: `gcmp2`, `gacmp`, both `geval` E lines exact; mutant q FAIL rc 47 (small and max); the checkpoint after 200 steps is bit-identical to k4's; the three attention GEMMs 1.35×, 1.52×, 1.42× faster in the profile; 200 steps 1.059× faster than k4 in the same window | 560 | k6: softmax kernels (ids 15, 16) load and store only the causal chunks of each row (predicated `LDG`/`STG`); `gkisge` predicate-field fix | EXERCISED (GB10, non-quiet) | `../gpu-k6/`: `gcmp2`, `gacmp`, both `geval` E lines exact; mutant w FAIL rc 47 (max; at the small shape its code equals the product's); the checkpoint after 200 steps is bit-identical to k5's; `grsoftf` 1.64× and `grsoftb` 1.68× faster in the profile; 200 steps 1.053× faster than k5 in the same window | 561 | k7: GEMM FFMAs (ids 0-7, 32-39) carry Ra operand reuse with control bit 109; accumulator columns remapped (j xor 1) off the b registers' banks | EXERCISED (GB10, non-quiet) | `../gpu-k7/`: `gcmp2`, `gacmp`, both `geval` E lines exact; mutant t FAIL rc 47 (small and max); the checkpoint after 200 steps is bit-identical to k6's; 64×64 GEMM wait 0.918× of k6's in the profile, all from reuse (remap-only variant r0 0.989×, inside the k6 spread); 200 steps 1.034× faster than k6 in the same window | 562 | k7b: the accumulator remap removed (`OKBNK`, `gkcol`, variant b0); Ra reuse with bit 109 kept, GPU code byte-equal to k7's reuse-only variant | EXERCISED (GB10, non-quiet) | `../gpu-k7b/`: `gcmp2`, `gacmp`, both `geval` E lines exact; mutant t FAIL rc 47 (small and max); the checkpoint after 200 steps is bit-identical to k6's and k7's; GEMM wait 0.955× of k6's over three rotated profile rounds (k7 0.934×, max k7b below min k6); 200 steps 1.0457× faster than k6 and equal to k7 (1.0003) in the same window | 563 | k8: 64×64 GEMM K loop double-buffered (ids 40-54, two slots each, `gkgpr` 168); QMD word 36 TARGET sized per kernel by `gksmw` (Mesa NAK policy); `gpu-disasm.sh` GPR guard (`gkgpr` ≥ highest GPR + 3) | EXERCISED (GB10, non-quiet) | `../gpu-k8/`: three windows kept. a1 hung (R158 under `gkgpr` 160); a2 bit-identical but 1.12× slower GEMM wait (NULL); a3 (new prereg): `gcmp2`, `gacmp`, both `geval` E lines exact, mutant t FAIL rc 47 (small and max), the checkpoint after 200 steps bit-identical to k7b's; 64×64 wait 0.913× of k7b's kernel under the same TARGET rule (max k8 below min k7b every round); GEMM wait 0.914×, 200 steps 0.969× of k7b's wall in the same window | 564 | k9: ReLU fused into the FFN GEMM epilogues (ep 1 ids 25/56 store FP and relu(FP); ep 2 ids 26/58 mask dF by FP > 0); `gr.om` RELUF/RELUB (ids 17/18) removed; `gkope` arms the next `gkmm`, `gkepok` refuses any other combination (-22); mutant m moves to the ep 2 threshold | EXERCISED (GB10, non-quiet) | `../gpu-k9/`: `gcmp2` (small, max, and an odd shape F = 96 on the 32×32 ids 25/26), `gacmp`, both `geval` E lines exact; mutant t FAIL rc 47 (small and max), mutant m FAIL rc 47 (small, max, odd); the checkpoint after 200 steps bit-identical to k8's; 48 fewer launches per profile (3 steps); summed GPU wait 0.924× of k8's (144.56 → 133.54 ms/step, max k9 below min k8 every round); 200 steps 0.942× of k8's wall in the same window | 565 | rung 7: the v2 shape (D 384, F 1536, H 12, P 15,833,472) `gtrainf` 0→30000 on rung 6's data, seed and schedule in 12 spark-windows, `geval` after every leg | EXERCISED (GB10, non-quiet) | `../gpu-r7/`: every leg and `geval` rc 0; chip `geval` E 30000 2243 `1254741` 468077 (1.254741 nats, rung 6 1.338156); CPU `eval` of `ck30000` (P5) prints the identical E line (`run/eval30000.txt`) | 566 567 The γ_R gate, the ReLU kink cases that the night shape exposes, the Adam residual, the windows and all 568 timings are in `evidence/OMEGALLM/gpu/README.md`. Not QUALIFIED: no quiet-machine timing, one chip, and 569 a bitwise comparison with the CPU path is not expected (f32 against f64).