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-CONTROLLER.md

314 lines · 20924 bytes Raw Blame History Rendered
1# WSP B4: controller scoping (sched and pearl)
2
3Lane wsp, Linear DRA-187, component B4. Written 2026-11-07 by agent CtlTraces on branch
4`wsp/controller` of aien-dev/aien-train (base `0518c915dea370b3bffbb90d579b1daa5ba8b8f5`).
5
6Status of everything in this file: the controller is **PROPOSED**. Nothing here is IMPLEMENTED,
7EXERCISED, QUALIFIED, MERGED or DEPLOYED. The trace and inventory are MEASURED on the host CPU
8side; no GPU work was opened and no setting was changed.
9
10Every derived number below was computed by the Wolfram evaluator; the query and result are quoted
11next to it. Row counts, byte sizes and shas are bookkeeping and are not sent to Wolfram.
12
13## 1. Short answer
14
15- **sched** owns the validated scheduling knobs (capacity, policy, pause, lease) and decides
16 only from logical counters, never from the clock or from telemetry.
17- **pearl** owns the hardware audit and has already filed the controller work as its own issues:
18 DRA-430 (telemetry, bounded scheduling controls, recovery) and DRA-431 (let a model pick only
19 validated scheduling actions and measure net benefit against a fixed policy). Both are Backlog
20 and unassigned.
21- Nothing on either branch maps measured pressure, temperature or GPU state to the sched knobs.
22- **Overlap, stated plainly:** an online controller that does this IS pearl DRA-431, which in
23 turn needs DRA-430. Building it inside wsp would duplicate pearl.
24- **Gap that does not duplicate:** an offline, replay-only study that (a) defines the telemetry
25 feature vector and a fixed baseline rule over sched's existing knobs, and (b) trains and scores a
26 tiny `.om` policy on held-out recorded traces. Its output is evidence for DRA-431, handed to pearl.
27 It writes no knob, adds no sched word and opens no GPU. Linear DRA-438 (this component) is
28 rescoped to exactly this offline study, feeding pearl's DRA-431.
29- **sched's reply (BOARD, 2026-11-07T06:32:58Z):** the three words exist at sched head
30 `9f5ebd35` (omega-mv #1064). Offline replay may model them as actions. A live controller in a
31 journaled Node must not call `sched_*` directly; it targets `jn_cap`, `jn_policy` and
32 `auth_pause` once DRA-398 lands (section 6.1).
33
34## 2. sched lane: what it already does
35
36Sources (read only, via `git show` of the remote refs in the wsp omega-mv clone):
37
38- omega-mv branch `sched/dra-396-fair-dispatch` at `37b01f1891868bb7fdbfca6a974afe8649747910`
39 (EXERCISED in scratch, not merged), file `seed/node/sched.om` (935 lines, sha256
40 `4ad0cc9eaa3b5aa2fcae4a1e7df0b384bb5985fba9e9d7cb4febadcb08070724`) and `seed/node/README.md`.
41- omega-mv branch `sched/dra-395-blocked-head` at `4225bbeb87579d9520a24364c382e3ade9443bf0`,
42 PR omega-mv#1062, READY FOR REVIEW, not merged.
43- Linear P-DRA-14 and DRA-395..399; brief `~/handoffs/hive/sched/BRIEF.md`.
44
45What exists:
46
47| Word | Effect | Citation (sched.om at 37b01f18 unless noted) |
48|---|---|---|
49| `sched_cap caps` | Sets four 16-bit capacities: kind 0 CPU slots, 1 memory MiB, 2 inference slots, 3 caller-defined. Returns -8 and changes nothing if a kind would fall below current use or below one admitted job's need. | line 232; README lines 452-457 |
50| `sched_policy p win db by ttl` | Policy 0 FIFO head-of-line, 1 fair fitting (default). Window 1..64, dispatch budget 1..64, bypass budget 1..65535, ttl 1..1000000. -7 when out of range. | line 258; README line 456 |
51| `sched_pause c on` | Pause stops new assignments; resume dispatches. Already called by `auth_pause` in `auth.om` lines 757-822. | line 800; README line 332 |
52| `sched_lease j ns` | Per-job lease from next assignment; `sched_overdue` reports and reaps late jobs. | lines 422, 444; README lines 544-553 |
53| `sched_stat i` | Counters 0..15, capacity 16..19, use 20..23, policy words 24..31. | line 212 |
54
55Key property, sched.om line 25: "Decisions read only these logical counters, never the clock."
56Defaults from `sched_new` (line 94): every capacity 65535, policy 1, window 64, budget 64, bypass 4,
57ttl 1000. Those defaults mean the capacities are not limiting today.
58
59Not yet there: no telemetry input of any kind; no live dispatch ("Until then neither scheduler
60dispatches live hive work", README lines 406-407), so there are no production scheduler logs, only
61JSON receipts under `evidence/node-schedpol/`. DRA-397 says "Learned ranking remains deferred until
62it beats this baseline in matched evidence"; P-DRA-14 says "baseline scheduling requires no model
63call". DRA-397, 398 and 399 are Backlog.
64
65## 3. pearl lane: what it already does
66
67Sources (read only): repo omega-pearl in `~/work/pearl/omega-pearl`, branch
68`pearl/dra-422-audit` at `d81798de2ae0d3253ad09a7d203e52cdb56fa23f`, files `audit/HARDWARE.md`,
69`audit/ENVELOPE.md`, `audit/CAPABILITY-MATRIX.md`; Linear P-DRA-16, DRA-421, 422, 430, 431; brief
70`~/handoffs/hive/pearl/BRIEF.md`. Pushes are frozen pending Drake's Q4 answer.
71
72- DRA-422 (In Progress): read-only hardware audit. Records SoC TDP 140 W and PSU 240 W
73 (DOCUMENTED), GPU power limits N/A, acpitz critical trip 104.8 C, powercap empty (no SoC or
74 CPU power rails), no wall meter, UPS whole-load only (`audit/HARDWARE.md` lines 23, 19, 29-31).
75- `audit/CAPABILITY-MATRIX.md` line 27: clock-cap governor MISSING_IMPLEMENTATION, "no clock
76 writes without auth". Line 62: duty cycle and stop conditions, "no clock, power-limit or firmware
77 writes", owned by the pearl scheduler with sched's `sched.om`, tracked as **DRA-430**.
78- **DRA-430** (Backlog, unassigned): "Implement resource-aware scheduling, telemetry and recovery":
79 typed capabilities, bounded scheduling controls, memory-pressure handling, telemetry freshness,
80 stop and recovery, service priority.
81- **DRA-431** (Backlog, unassigned): "Add model scheduling policy and measure its net
82 contribution": "Let the model select only validated scheduling actions ... held-out
83 workload/telemetry replays plus controlled on-device comparison against a simple fixed policy.
84 Measure controller time/energy and AI-service quality. Promote decisions only when net useful
85 performance or energy improves."
86- The pearl brief (line 87) already expects wsp to "bring a qualified edit or controller to you;
87 integration is gated on its qualification (its B5)".
88
89## 4. Telemetry inventory (this machine, read without root)
90
91| Source | Fields | Rate / cost | Label |
92|---|---|---|---|
93| `/proc/loadavg` | load 1/5/15, runnable/total | any | MEASURED |
94| `/proc/pressure/{cpu,memory,io}` | PSI some/full avg10/60/300, totals | any; cpu `full` is always 0 here | MEASURED |
95| `/proc/stat` | per-core busy over 20 cores (delta) | any | MEASURED |
96| `/proc/meminfo` | MemTotal, MemAvailable; no swap configured | any | MEASURED |
97| `/sys/class/thermal/thermal_zone0..6` | all seven are `acpitz` | any | MEASURED |
98| hwmon | acpitz, nvme temp1-3, wifi phy temp | any | MEASURED |
99| `nvidia-smi` (one-shot) | GPU util, power draw, temp, SM clock, pstate; `clocks_event_reasons.active` available but not sampled; memory used/total N/A (unified memory) | the dominant read cost (section 5) | PARTIAL: GPU board only |
100| `upsc spark` | ups.load % of 1000 W nominal, status, input voltage, runtime | driver poll 2 s, integer % | PARTIAL: whole UPS, other loads unknown |
101| SoC / CPU power rails | none (powercap empty) | n/a | BLOCKED_INPUT |
102| Wall energy | no qualified meter | n/a | BLOCKED_INPUT |
103| `~/yardsticks/sensors/<local date>.csv` (existing, `spark-sensors`, started @reboot) | epoch, iso, UPS W (load x 10), GPU W, GPU util, load1, MemAvailable, GB10 lock holders, NVRM error count | one row about every 2 s; 19 files, 787376 rows | MEASURED history, PARTIAL power |
104| `~/yardsticks/windows/<id>/open.json` (existing, `spark-window`) | 478 window records; `state` snapshot: loadavg, MemAvailable, GPU util and W, lock holders, GPU apps, last sensors row | one per window | MEASURED event labels |
105| `~/.local/state/aien-coordinator/` | chip-watchdog.log, OWNER, CHIP-RESERVED | free text | not machine-usable as-is |
106
107History span of the existing sensors log, from the first row of `2026-10-19.csv`
108(1792422846, 2026-10-19T10:14:06-05:00) to the last row read (1794030993,
1092026-11-06T23:56:33-06:00):
110`WolframLanguageEvaluator: DateDifference[DateObject[{2026,10,19,10,14,6},TimeZone->-5], DateObject[{2026,11,6,23,56,33},TimeZone->-6], {"Day","Hour","Minute","Second"}] -> 18 days 14 h 42 min 27 s`.
111
112That log lacks PSI, per-core and thermal fields, so it can train only the reduced feature set
113(section 6.3). The sampler of section 5 adds those fields.
114
115## 5. Trace recorded for this study
116
117Directory `evidence/OMEGALLM/wsp-ctl-traces-20261107/` in this branch. Both instruments ran on
118core 0 only, at `nice -n 19`, read only, with no GPU work and no setting changed.
119
120Instrument going forward: the seeded Omega sampler `tools/omegallm/ctlsamp/ctlsamp.om` (build,
121usage, row format and exit codes in its README). It writes the keys of both files below in one
122row, runs `nvidia-smi` and `upsc` through `execprog` with pipes, and timestamps with `monons` and
123`realns`. Its port gate (2 minute run, keys and types equal to these traces, 71 values per row
124equal to same-moment raw readings on 3 rows, a missing command recorded as a read error) is in
125`gate-om-20261107/`; the output drain fix (a command with large or endless output is read to the
126end or killed at 4 s and recorded as `truncated`, normal rows unchanged) is in
127`gate-om-drain-20261107/`. Details in the evidence README, all PASS (MEASURED).
128
129The two files below are data from the old Python and shell samplers, which are deleted from the
130tree; their source stays in commit `a64e8707ebd2693254f27285dee6d8bdd0391559`.
131
132| File | What | Rows | First / last ts_utc | sha256 |
133|---|---|---|---|---|
134| `trace-001.jsonl` | old `sampler.py`, 5 s interval | 360 | 2026-11-07T05:53:53Z / 06:23:48Z | `531da5be7473ce80b4d98f736810365dd33339d3f0626ea7b99cb15bcb51a03e` |
135| `ups-001.jsonl` | old `ups-sampler.sh` (`upsc spark`), 5 s interval | 340 | 2026-11-07T05:55:10Z / 06:23:45Z | `fd8a873d20491667d05f81462f2f7848676151addb6f2ced1a1ef3c9caab894c` |
136
137Start command (recorded in `run-start.txt`, 2026-11-07T05:53:47Z):
138`taskset -c 0 nice -n 19 python3 sampler.py trace-001.jsonl 5 360`. Instrument hashes:
139`sampler.py` `d45206003f03be9881ae4dc2419b1c5d9ada84ead0f69b5c79c397cae02317e8`,
140`ups-sampler.sh` `1cd419f15260f4c8d3d6b4023b561b02f515cd5114eae207089d6e67c377f09a`.
141Both logs are empty (no errors). No row has a `gpu_error`; every UPS row reports status `OL`.
142
143Span and cadence (MEASURED):
144
145- `WolframLanguageEvaluator: UnitConvert[Quantity[{1794.999, 1715.003}, "Seconds"], MixedUnit[{"Minutes","Seconds"}]] -> {29 min 55.0 s, 28 min 35.0 s}`
146 for trace-001 and ups-001 (last minus first `ts_unix`).
147- Interval between trace rows, `{Mean, Min, Max}` of `Differences[ts_unix]`:
148 `-> {5.000 s, 4.927 s, 5.072 s}`.
149
150Summary of trace-001. Each line is
151`WolframLanguageEvaluator: With[{d=<column>}, {Length[d], Min[d], Max[d], N[Mean[d]], N[Median[d]], N[Quantile[d,95/100]]}]`
152on the named column (all 360 rows); values rounded here to the precision of the source field.
153
154| Column | n | Min | Max | Mean | Median | p95 |
155|---|---|---|---|---|---|---|
156| load1 | 360 | 9.59 | 17.44 | 11.96 | 11.47 | 15.54 |
157| PSI cpu some avg10 (%) | 360 | 0.07 | 20.05 | 4.41 | 1.78 | 15.13 |
158| PSI memory some avg10 (%) | 360 | 0 | 1.22 | 0.088 | 0.01 | 0.39 |
159| PSI io some avg10 (%) | 360 | 0 | 37.44 | 1.38 | 0.09 | 5.46 |
160| PSI io full avg10 (%) | 360 | 0 | 33.93 | 1.27 | 0.08 | 5.04 |
161| per-core busy % (20 cores x 360 rows) | 7200 | 1.9 | 100 | 51.06 | 29.99 | 100 |
162| max acpitz (C) | 360 | 67.8 | 93.9 | 79.43 | 78.6 | 87.8 |
163| GPU util (%) | 360 | 0 | 94 | 68.24 | 84 | 93 |
164| GPU power (W, board only) | 360 | 5.89 | 45.43 | 37.37 | 43.14 | 44.78 |
165| GPU temp (C) | 360 | 51 | 74 | 65.45 | 67 | 72 |
166| SM clock (MHz) | 360 | 201 | 2515 | 1889.1 | 2067 | 2509 |
167| sample cost (us per row) | 360 | 31493 | 583525 | 59391 | 55943 | 109115 |
168
169- MemAvailable in GB: `With[{d=<MemAvailable_kb>}, N[{Min[d], Max[d], Mean[d]}*1024/10^9]] -> {69.92, 86.91, 79.69}`.
170- UPS load as W (load % x 1000 W nominal / 100), PARTIAL:
171 `With[{d=<ups_load_pct>}, {Min[d]*10, Max[d]*10, N[Mean[d]*10], N[Median[d]*10]}] -> {200, 280, 252.6, 260}` W.
172- The GPU went idle for part of the window: 39 rows in pstate P8 and 49 rows under 10 W.
173 Rows where max acpitz reached 90 C: 3 (05:55:48Z 91.5 C, 05:57:08Z 93.9 C, 05:57:23Z 92.9 C).
174 Rows with PSI io some avg10 above 10: 13. As shares of 360 rows:
175 `WolframLanguageEvaluator: N[{3, 13, 39, 49}/360*100] -> {0.83, 3.61, 10.83, 13.61}` %.
176- The telemetry read itself costs a median of 55943 us per sample on one core (MEASURED). The
177 sampler does not time its parts separately; INFERENCE: most of it is the `nvidia-smi` process
178 start, since the other reads are plain `/proc` and `/sys` files. A controller should reuse an
179 existing poller rather than add its own.
180
181Held-out split for this trace (time-contiguous): `WolframLanguageEvaluator: {Floor[2*360/3], 360 - Floor[2*360/3]} -> {240, 120}`,
182so rows seq 0..239 train and seq 240..359 are held out.
183
184R0 replay on this trace (section 6.4 rules 1-4 only; the nvme and clock-reason clauses are
185NOT_RUN because those fields were not sampled): R0 chooses A0 (keep) on all 360 rows. The hottest
186row, 93.9 C, stays under the 95 C pause threshold, and no PSI threshold is crossed. So on this
187window the label set is degenerate: a policy imitating R0 would learn "always keep", and
188agreement with R0 would say nothing. This is a MEASURED finding about the data, not about a model.
189
190## 6. Controller spec (PROPOSED)
191
192### 6.1 Boundary
193
194- Offline replay (this study): the actions in 6.2 are modelled with sched's words `sched_cap`,
195 `sched_policy`, `sched_pause`. A refused call (-7, -8) means no change, logged. Nothing is
196 written to a live scheduler.
197- Live use (later, owned by pearl DRA-431 and DRA-430): a controller must NOT call `sched_*`
198 directly in a journaled Node, because a direct call is not journaled and crash replay would
199 diverge (sched, BOARD line 2026-11-07T06:32:58Z). It targets `jn_cap` and `jn_policy`
200 (journaled as a type 11 POLICY record before `sched_cap`/`sched_policy` take effect) and
201 `auth_pause` (journaled PAUSE), once DRA-398 lands. Source:
202 `~/handoffs/hive/sched/dra398-design.md`, mtime 2026-11-07T00:28:35-06:00, 151 lines, sha256
203 `333ff9060c5217a9d9c6241291afa69ae4e5c800175429bf7d3c089b482ea517`, lines 63-65 and 137.
204 That design and those journaled words are PROPOSED, not implemented.
205- Never writes clocks, power limits, firmware, or GPU state (pearl CAPABILITY-MATRIX line 62).
206- Telemetry older than 15 s, or any read error, forces the fail-safe action (pause new
207 assignments; running jobs continue). The model is never asked in that case.
208- Decision point: every sched step tick, rate-limited to one decision per 10 s, plus once on
209 each admission. Decisions use the snapshot taken at the tick.
210
211### 6.2 Action set (7 discrete actions)
212
213| Id | Action | Offline model (sched word) |
214|---|---|---|
215| A0 | keep | none |
216| A1 | pause new assignments | `sched_pause c true` |
217| A2 | resume | `sched_pause c false` |
218| A3 | inference slots minus 1 | `sched_cap` with kind 2 lowered by 1 (refused below use) |
219| A4 | inference slots plus 1, up to the configured maximum | `sched_cap` kind 2 raised by 1 |
220| A5 | CPU slots minus 1 | `sched_cap` kind 0 lowered by 1 |
221| A6 | CPU slots plus 1, up to the configured maximum | `sched_cap` kind 0 raised by 1 |
222
223Memory capacity (kind 1) is not a model action. A fixed guard sets it to MemAvailable minus a
224reserve; that guard belongs to DRA-430.
225
226### 6.3 Features (16 inputs)
227
228load1; runnable count; PSI cpu some avg10; PSI memory some and full avg10; PSI io some and full
229avg10; mean per-core busy %; max acpitz C; MemAvailable / MemTotal; GPU util %; GPU W; GPU C;
230SM MHz; UPS W (PARTIAL); telemetry age s. The reduced set available in the 18-day sensors history
231is: load1, MemAvailable, GPU util, GPU W, UPS W, lock holders.
232
233### 6.4 Baseline rule R0 (deterministic, no model)
234
235Evaluated in order; first match wins; thresholds have hysteresis so R0 does not flap.
236
2371. Telemetry stale or unreadable: A1.
2382. Max acpitz at or above 95 C, or nvme composite at or above 80 C: A1. Resume (A2) only when
239 acpitz is below 90 C and nvme below 75 C.
2403. PSI memory some avg10 above 10: A3 if any inference slot is in use, else A5.
2414. PSI cpu some avg10 above 50: A5. Below 20 for three decisions: A6.
2425. GPU clock event reasons show thermal or power braking: A3.
2436. Otherwise: A0.
244
245Thresholds are design starting points, not measured optima. The acpitz values sit below the
246critical trip of 104.8 C recorded by pearl.
247
248### 6.5 Tiny learned policy
249
250One hidden layer, 32 units, ReLU, 7 outputs, written in `.om` with `f64` (an OM-1 keyword at
251omega-mv `e5b32567`; looked up with the omega lookup tool). Size:
252`WolframLanguageEvaluator: 16*32 + 32 + 32*7 + 7 -> 775` parameters, and
253`WolframLanguageEvaluator: 16*32 + 32*7 -> 736` multiply-adds per decision. Training starts from
254imitation of R0, then from a cost signal (section 6.7). The model output is only a ranking; the
255action executed is the top-ranked action that sched accepts, so an invalid choice cannot reach
256the scheduler.
257
258### 6.6 Held-out split
259
260Time-contiguous, never shuffled. Reduced features: train on sensors files 2026-10-19 to
2612026-11-02, hold out 2026-11-03 to 2026-11-06. Full features: first two thirds of each new trace
262for training, last third held out (section 5: rows 0..239 train, 240..359 held out). Any trace whose window
263overlaps a spark-window record is tagged with that window id so GPU-busy periods are not split
264across train and test.
265
266### 6.7 Metrics
267
268- Decision agreement with R0 on held-out rows (exact match rate), with the confusion matrix.
269- Regret proxy: count of held-out rows where the policy keeps or grows capacity while a rule-1 or
270 rule-2 condition holds (must be 0), and rows where it pauses with all pressures low.
271- Controller overhead: telemetry read time (measured in section 5) plus `.om` inference time,
272 measured with `monons`, reported in microseconds.
273- Replay cannot measure net benefit: the recorded telemetry does not react to the replayed
274 action. Net useful work and energy need the on-device comparison in 6.8.
275- Because R0 picks A0 on every row of trace-001, imitation agreement is only meaningful on data
276 that contains pressure or heat events. The 18-day sensors history and spark-window records
277 must be searched for such periods first; if they are too rare, a learned policy has nothing to
278 learn over R0, and that is a valid negative result for DRA-431.
279
280### 6.8 Bounded hardware-run plan (NOT_RUN; needs authorization)
281
282Only after both lanes agree, pearl DRA-430 provides the action path and DRA-398 lands; the arms
283act only through `jn_cap`, `jn_policy` and `auth_pause`, never `sched_*` directly. One authorized
284spark-window, a fixed synthetic job mix through sched, three arms of equal length (sched defaults,
285R0, learned policy), order randomized, one decision per 10 s, no clock or power writes. Record
286completed jobs, sched overdue count, PSI, acpitz, GPU W and UPS W. Wall energy stays
287BLOCKED_INPUT until a qualified meter exists; UPS W is reported as PARTIAL only.
288
289## 7. BOARD proposal and replies
290
291Posted to `~/handoffs/BOARD.md` at 2026-11-07T06:27:07Z addressed to sched and pearl (the line
292with `wsp/CtlTraces PROPOSE`). It asked sched to confirm the three words above are the stable
293action interface, and pearl to say whether DRA-431 accepts this offline study as its replay input
294or wants wsp to stand down.
295
296sched replied at 2026-11-07T06:32:58Z (`grep '06:32:58Z sched to wsp' ~/handoffs/BOARD.md`): the
297words exist at head `9f5ebd35` (#1064); the offline study may model them; a live controller uses
298`jn_cap` / `jn_policy` / `auth_pause` after DRA-398, whose journaled words are PROPOSED. Linear
299DRA-438 is rescoped as the offline study feeding pearl's DRA-431. No reply from pearl is recorded
300in this document.
301
302## 8. Open risks
303
304- DRA-431 overlap: if pearl takes DRA-431 itself, this study should stop and hand over the
305 trace and inventory only.
306- sched defaults (65535 per kind) make `sched_cap` actions inert until real capacities are set.
307- `spark-sensors` already calls nvidia-smi about every 2 s, faster than the 5 s rule this lane
308 follows; any controller should reuse that log instead of adding a second poller.
309 ctlsamp's own 30 minute acceptance runs (evidence `gate-om-sched-20261109/`) did add a second
310 5 s `nvidia-smi` poller beside spark-sensors for their duration; they test the sampler, not a
311 controller input path.
312- UPS load is integer % of a whole UPS with unknown other loads; it is not energy evidence.
313- The trace in section 5 is one 30 minute window on a loaded machine; it is not representative
314 of idle or GPU-exclusive periods, and R0 never acts on it.