amer224 commited on
Commit
7ce8c59
·
verified ·
1 Parent(s): fda08d4

Add brains/sovereign-nano/nano_notes.md

Browse files
Files changed (1) hide show
  1. brains/sovereign-nano/nano_notes.md +41 -0
brains/sovereign-nano/nano_notes.md CHANGED
@@ -145,3 +145,44 @@ be fetched, and says so loudly.
145
  through each episode when `use_mem=True`.
146
  - CPU sanity: bs 8, lr 3e-4, 100 steps on the prep'd real shard, watch
147
  `terms` fall.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  through each episode when `use_mem=True`.
146
  - CPU sanity: bs 8, lr 3e-4, 100 steps on the prep'd real shard, watch
147
  `terms` fall.
148
+ - Pipeline integration (B, 15 Aug): `src/nn/sovereign_nano.py`,
149
+ `scripts/distill_nano.py`, `scripts/bench_nano.py`,
150
+ `nano_rollout.py` (env wrapper with GRU carry; random-nano smoke
151
+ **0.29 s/tick on 2-core CPU** → CPU rollouts viable on Kaggle).
152
+
153
+ ## 8. Pipeline review (B, 15 Aug) — 8.5/10, findings applied
154
+
155
+ Verified BY EXECUTION on the real shard: **3.39M params**, contract
156
+ shapes, act(B=4) logprob/entropy (B,), stage-A loss + backward finite.
157
+
158
+ | # | Finding | Fix (applied in this file) |
159
+ |---|---|---|
160
+ | 1 | cell_nll at init = 16.05 vs ~6.93 uniform floor — heat/gate init over-confident | heat tower's final conv scaled **0.1×** + bias zeroed; cell CE now uses **label smoothing 0.02**; the smoke **asserts init cell CE < 8.5**. The same fix went into the v3/290M reference (its run1 showed cell_nll 24.3 at step 758). |
161
+ | 2 | main smoke holds two grad-enabled graphs at bs16 (~1.5–2 GB peak) | `python model_nano.py --tiny` → 8 frames, loss on a 4-sample slice (~0.5 GB peak) |
162
+ | 3 | torch.quantization deprecation | quantize_cpu.py now uses **torch.ao.quantization** with a <1.13 fallback |
163
+
164
+ Real measurements from B's box (2-core CPU, fp32, bs1): baseline fwd
165
+ **295 ms** / act **270 ms**; heat_res=64 → fwd **213 ms** / act **177 ms**
166
+ (~28% win, matches the shared-tower math direction); channels-last shows
167
+ no gain on CPU (needs cuDNN/T4). T4 numbers still open — add bench to the
168
+ next GPU kernel boot (measurement, not training).
169
+
170
+ Live shard stats (40-shard sample, 160 eps): kind expand/attack/bank =
171
+ **32.1 / 30.4 / 37.5%** (bank-heavy farmer), survivor **39.4%**,
172
+ frames/ep mean **98** / median 108 / min 10 / max 125 (250-tick cap).
173
+ AWR note (honest): survivor ×4 weighting over a bank-heavy survivor set
174
+ can reinforce passivity — banking to red interest is genuinely strategic
175
+ per ATTACK_META, so the weight stays, but the PPO stage (win-driven) is
176
+ where aggressive emergence must come from; kill-window ×2 unchanged.
177
+
178
+ Distill alignment: distill_nano.py now implements B's joint
179
+ (kind × cell) flattening for KL/CE (the old kind-dim softmax was the
180
+ wrong normalization) with `kind` required for the hard-cell CE, and
181
+ shape-asserts the joint before the loss runs.
182
+
183
+ ## 9. What is NOT fixed yet (waiting on the pipeline)
184
+
185
+ - T4 bench numbers (bench.py on a GPU boot).
186
+ - Trained-nano eval numbers (distill → nano_rollout.py → real win-rate).
187
+ - The teacher's Stage-A launch is B's side; first evals at step 300
188
+ under the v8 script (13 GB download cap, heartbeat-before-eval).