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 / docs / omegallm / WSP-OPERATOR.md

142 lines · 6535 bytes Raw Blame History Rendered
1# Operator guide: checked weight edits for the Omega LLM
2
3Status: tools IMPLEMENTED and EXERCISED on CPU. No edited checkpoint is deployed anywhere. `wpatch` is a
4separate program that arrives in its own change (`tools/omegallm/wpatch/`, with `docs/omegallm/WSP-PATCH.md`);
5until that change is on main, steps 1 and 5 to 9 below cannot be run from this repository.
6
7This guide is for the person who looks after the model. It covers the life of one weight edit: find it,
8write it as a checked patch, check it, apply it, verify it, tie it to the program that will run it, roll it
9back, and the rules for promoting it. Every step runs on the CPU and only ever writes new files.
10
11Two Omega tools do the work:
12
13- `wprobe` (`tools/omegallm/wprobe/`) looks inside the model and tries an edit in memory. Its `save` command
14 writes the edited checkpoint as a new file.
15- `wpatch` (`tools/omegallm/wpatch/`) turns "base checkpoint plus edited checkpoint" into a small sealed
16 patch file, and checks, applies and reverses it exactly.
17
18Build both first (each README has the one-line build; `wpatch` needs its own change, see Status). Heavy commands take a pool core:
19`flock -w 3600 -o ~/handoffs/hive/queen/pool-19.lock taskset -c 19 nice -n 10 <command>`.
20
21## 1. Inspect
22
23```sh
24wpatch inspect BASE.ck
25```
26
27This prints the model's shape, its training step and, for every weight table, a fingerprint, its size and the
28count of broken (not-a-number) values. That count must be 0. Keep the base checkpoint's sha256: everything
29after this point is tied to it.
30
31## 2. Find what pushes the wrong answer
32
33```sh
34wprobe probe BASE.ck MERGES RECORDS > PROBE.out
35wprobe rank META PROBE.out
36```
37
38`probe` feeds each record's right answer and, at the first token the model gets wrong, splits the gap between
39the right and the wrong token into the share of every head, every MLP and its strongest neurons. `rank`
40averages those shares over the rows that fail on a digit and lists the parts that push hardest each way.
41META has one line per record, `idx role length kind`. Test a suspect before editing weights: hook kind 3
42turns a head up or down in memory only, and the right answers should move with it.
43
44## 3. Make the edit
45
46```sh
47wprobe save BASE.ck EDITED.ck K L I A [K L I A ...]
48```
49
50Hook kinds 1 (scale a head's output rows) and 2 (scale one neuron's output row) are weight edits. `save`
51refuses to overwrite a file (exit 63), refuses activation or decoding hooks (exit 2), and refuses a result
52with a broken or huge value (exit 64). It keeps the header and the optimizer state as they were.
53
54## 4. Check that the edit is specific
55
56```sh
57wprobe controls BASE.ck SEED K L I A [K L I A ...] # seeds 187101, 187102, 187103
58```
59
60For the same edit, `controls` picks other heads or neurons in the same layers and scales them so the change
61has the same size. Run the evaluation on each control arm it prints. If the controls help as much as the edit,
62the edit is not doing what the diagnosis says.
63
64## 5. Write the patch
65
66```sh
67wpatch diff BASE.ck EDITED.ck POLICY params.txt rationale.txt PATCHDIR/
68```
69
70`params.txt` holds the exact hook arguments; `rationale.txt` says in one paragraph why the edit exists and
71which receipts back it. POLICY says what happens to the optimizer's memory for the changed weights if
72training continues later: 0 keep, 1 clear the first moment, 2 clear both. Use 2 for an edit that will be
73fine-tuned further (stale momentum would push the edited weights back); use 0 when the checkpoint will only
74be served. The patch is named after its own sha256, so the name is its identity.
75
76## 6. Check before use
77
78```sh
79wpatch show PATCH.wp # what it changes, the parameters and the rationale, as JSON
80wpatch validate PATCH.wp BASE.ck
81```
82
83`validate` confirms the patch belongs to this exact base, every changed weight is in range and was what
84the patch expects before the change, the new values are finite, and the whole result, including its f32
85copy (the form the GPU runtime loads), hashes to what the patch promises.
86
87## 7. Apply and verify
88
89```sh
90wpatch apply PATCH.wp BASE.ck APPLIED.ck
91wpatch verify PATCH.wp APPLIED.ck
92```
93
94`apply` writes a new file only, rechecks the written bytes and deletes the file on any mismatch. `verify`
95reports how many changed weights survive rounding to f32. If that number is 0, the GPU runtime would serve
96the base model unchanged.
97
98## 8. Bind to the runtime, and clear caches
99
100```sh
101wpatch bind PATCH.wp APPLIED.ck RUNTIME_BINARY BINDING
102wpatch checkbind BINDING APPLIED.ck RUNTIME_BINARY
103```
104
105A binding records which checkpoint, which f32 weights, which runtime program and which patch belong
106together. `checkbind` takes no patch argument, so it cannot notice a replaced patch file; keep patches
107read-only and compare names. Neither command touches a running server. Before anyone claims "the server
108runs the repaired model", the serving side must run `checkbind`, throw away cached weights and cached
109conversation state (the KV cache), load exactly the bound files, and only then answer.
110
111## 9. Roll back
112
113```sh
114wpatch revert PATCH.wp APPLIED.ck RESTORED.ck
115sha256sum BASE.ck RESTORED.ck # must be identical
116```
117
118`revert` puts back the exact old weights and optimizer words, byte for byte. Measured on the round40 model
119(380,003,448 bytes): the restored file hashes to the base, `7c7b5b52…e346`. To roll back a server, point it
120at the base checkpoint again and repeat the cache clearing in step 8.
121
122## 10. Check that the edit survives training
123
124```sh
125wprobe survive BASE.ck EDITED.ck BASE-STEP.ck EDITED-STEP.ck [EDITED-OTHER-POLICY.ck]
126```
127
128Train the base and the edited checkpoint one more step each (`tools/omegallm/wdrive` has the driver), then
129`survive` reports how much of the edit is left: 1 means fully kept, 0 means training erased it. If a later
130training round would start from this checkpoint, a low number means the repair would have to be redone.
131
132## 11. Promotion rules
133
134An edit is a candidate, never a deployment, until all of these hold, in this order:
135
1361. Its preregistered held-out evaluation passed (for DRA-187: `evidence/OMEGALLM/wsp-dra187-20261107/PREREG.md`).
1372. The round40 retention gates ran on the GPU under a posted reservation and passed. NOT_RUN blocks promotion.
1383. An independent review approved the evidence.
1394. The serving owner (lane ownmodel for :18091) accepts it. This lane never changes :18091.
140
141Report each of these as MEASURED, PENDING or NOT_RUN. "The patch applies" proves only that the file is
142correct, not that the model got better.