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 / tests / omegallm / weight-edit.om

101 lines · 1698 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note Experimental inference checkpoint editor. Concatenate after the normal CPU units with
3note lio main renamed. Args OLD CURRENT NEW ALPHA_MILLI GAIN_MILLI. NEW must not exist.
4note Weights become old + alpha * (current - old); final RMS gain is then scaled by gain.
5note Preserve CURRENT metadata and optimizer state for provenance, not for continued training.
6note Do not resume these edited checkpoints without a separate optimizer-state decision.
7global wesh ulong 9
8
9fn weempty to void
10n = oargp 3
11fd = int fopen oarg 0 n 0 0
12if ge fd 0
13r = fclose fd
14exit 52
15end
16if ne fd -2
17exit 70
18end
19end
20
21fn weone i ulong a f64 s f64 to void
22v = owg i
23v = add v mul sub a 1.0 sub v ogrg i
24if ge i get og 33
25v = mul v s
26end
27if or ne v v gt fabs v 1000000.0
28exit 54
29end
30owp i v
31end
32
33fn wemix a f64 s f64 to void
34p = get og 8
35nc = div add p 65535 65536
36for c ulong nc
37st = mul c 65536
38en = add st 65536
39if gt en p
40en = p
41end
42for j ulong sub en st
43weone add st j a s
44end
45end
46end
47
48fn main to int
49if ne oargc 6
50ret 2
51end
52aa = oargu 4
53ss = oargu 5
54if or or lt aa 500 gt aa 1200 or lt ss 800 gt ss 1200
55ret 51
56end
57weempty
58ockload 1
59for i ulong 7
60put wesh i get og i
61end
62put wesh 7 get og 40
63put wesh 8 get og 41
64p = get og 8
65nc = div add p 65535 65536
66for c ulong nc
67st = mul c 65536
68en = add st 65536
69if gt en p
70en = p
71end
72for j ulong sub en st
73i = add st j
74ogrp i owg i
75end
76end
77ockload 2
78for i ulong 7
79if ne get wesh i get og i
80ret 53
81end
82end
83if ne get wesh 7 get og 40
84ret 53
85end
86if gt get wesh 8 get og 41
87ret 53
88end
89wemix div f64 aa 1000.0 div f64 ss 1000.0
90ocksave 3
91oputc 87
92oputc 32
93oputu get og 8
94oputc 32
95oputu aa
96oputc 32
97oputu ss
98oputc 10
99oflush
100ret 0
101end