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
aien-train / docs / omegallm / GROW.md
| 1 | # Grow a trained Omega LLM |
| 2 | |
| 3 | `ollm grow` adds trainable residual layers to an existing checkpoint. It keeps the |
| 4 | learned embeddings, original layers and final normalization gain byte for byte. |
| 5 | This is a capacity operation. A larger checkpoint is not evidence of better |
| 6 | reasoning, coding, conversation or held-out quality. |
| 7 | |
| 8 | ```sh |
| 9 | ollm grow INPUT.ck OUTPUT.ck LAYERS TOTAL LRMICRO |
| 10 | ``` |
| 11 | |
| 12 | `LAYERS` is the new total depth, strictly greater than the input depth. All other |
| 13 | shape fields, the seed, gradient-block count and CK01/CK02 format are preserved. |
| 14 | The existing model geometry and memory-pool checks apply. `TOTAL` is a positive |
| 15 | training-step count accepted by `tune`; `LRMICRO` must be positive. The command |
| 16 | prints `G OLD_LAYERS NEW_LAYERS PARAMETERS`. |
| 17 | |
| 18 | The output starts at step zero with zero Adam moments and the specified learning |
| 19 | rate and schedule, just as a fresh fine-tune does. Retaining moments while changing |
| 20 | the model is intentionally not supported. Use the same tokenizer as the input. |
| 21 | `train` consumes the ordinary output checkpoint. The GPU trainers use the same |
| 22 | checkpoint format, but growth followed by GPU training has not been exercised. |
| 23 | This change tests host training only. |
| 24 | |
| 25 | On Linux, the normal checkpoint writer saves OUTPUT.ck through OUTPUT.ck.tmp. As with |
| 26 | `tune`, an existing output is replaced. Use a distinct output in a private working |
| 27 | directory and preserve the input. Do not target a served checkpoint or a path |
| 28 | another process is writing. Checkpoints derived from private data remain private. |
| 29 | |
| 30 | ## Initialization and storage |
| 31 | |
| 32 | The own `oinit` initializer supplies the new layers' gains and input projections. |
| 33 | Their attention output projection (`Wo`) and feed-forward output projection |
| 34 | (`W2`) are then zeroed. Thus their residual contributions start at zero, while |
| 35 | the input projections are populated so that these branches can learn. Old layers |
| 36 | are restored without scaling. The final gain moves after the added layers. |
| 37 | |
| 38 | The existing gradient cold store holds a snapshot of the input weights. Growth |
| 39 | increases the parameter count, so the new Adam region begins beyond this snapshot. |
| 40 | No new parameter-sized allocation, checkpoint format or inference kernel is added. |
| 41 | The existing parameter and activation banks handle the enlarged model. Added |
| 42 | layers still cost inference work before they learn; this is not a speed feature. |
| 43 | |
| 44 | Non-finite source weights are refused with exit 54. Other checkpoint failures |
| 45 | retain their existing exit codes. A non-increasing or unsupported depth, invalid |
| 46 | schedule or zero learning rate returns 12; malformed arguments return 2. Invalid |
| 47 | requests do not call the checkpoint writer. Finite weights alone do not guarantee |
| 48 | that every possible input has finite intermediate activations; preservation is |
| 49 | checked on measured inputs, not asserted for arbitrary floating-point states. |
| 50 | |
| 51 | ## Verification |
| 52 | |
| 53 | ```sh |
| 54 | python3 tests/omegallm/grow-gate.py compilers.json /private/growth-gate --core 4 |
| 55 | ``` |
| 56 | |
| 57 | The release gate discovers the targets from `build.sh`, requires a local JSON |
| 58 | object mapping every target name to its pinned compiler path, builds every target, |
| 59 | and then runs the host growth checks. Keep the a64efi compiler with its existing |
| 60 | `../a64efi/efirt.om` companion. Missing compilers or a failed target stop the gate. |
| 61 | Compiling the GPU and EFI targets is not a claim of running growth on them. |
| 62 | |
| 63 | The external Python instrument reuses the repository's independent checkpoint, |
| 64 | initialization and forward/backward oracle. It tests both checkpoint versions, |
| 65 | all preserved tensors, deterministic growth, sampled-token and held-out-loss |
| 66 | preservation, gradients and actual updates in new branches, training-resume |
| 67 | identity, repeated growth to the current depth boundary, invalid inputs and |
| 68 | non-finite weights. It repeats the checks using the reduced-bank variant built by |
| 69 | `build.sh`, and |
| 70 | checks preservation and non-finite refusals beyond the first snapshot chunk. |
| 71 | Native `eval` comparisons check the printed micro-nat and micro-bits-per-byte values, not |
| 72 | bitwise internal losses; the independent oracle also compares its unrounded |
| 73 | losses. The bitwise preservation claim applies to the saved learned tensors. |
| 74 | Compiled negative controls must be caught: nonzero attention/FFN outputs, |
| 75 | missing old weights, lost final gain, stale optimizer state, lost signed-zero bits, |
| 76 | dead new inputs and a truncated snapshot. Preservation compares packed tensor bytes |
| 77 | and includes a negative-zero source weight. |
| 78 | Python is not a product dependency. |
| 79 | |
| 80 | Before promoting any grown checkpoint, train it and compare it with its source |
| 81 | on preregistered held-out tasks, including code and unanswered-question cases. |
| 82 | Preservation and trainability checks do not substitute for that quality test. |