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 / evidence / OMEGALLM / gpu-k3 / README.md

99 lines · 6860 bytes Raw Blame History Source

GB10 kernels k3: warp-per-row RMS norm (aien-train#52)

After ../gpu-k2/, prof-C2.txt put 22.36 ms of the profiled step's 203.30 ms GPU wait in the two RMS norm kernels (gr.om ids 10 grrmsf and 11 grrmsb), which ran one thread per row: each thread walked its row's D columns, so a warp's loads touched 32 rows at a stride of 4·D bytes, and both kernels read their inputs twice (sum pass, then output pass). This change runs one warp per row:

Status: EXERCISED on one GB10, window 20261102T135748Z-ed1c5b (win-k3-chk2.txt), opened --gb10 shared --quiet none. The quiet lock was not taken; the rung-6 P5 CPU eval held core 7 and the load average was 1.52 at open and 3.77 at close (open.json, close.json), so the timings are non-quiet. The first attempt, window 20261102T135737Z-bafe66 (win-k3-chk1.txt), ran nothing: run.sh was not executable (exec rc 126). Its mode was changed, not its content, and the same run.sh ran in k3-chk2. Not QUALIFIED.

Setup

Results

prediction (prereg.txt)receiptresult
K3 gcmp2 small, 3 steps, rc 0gc2-small-s3-K3.txt GCMP2 PASS rc=0PASS
K3 gcmp2 max, 7 steps, rc 0gc2-max-s7-K3.txt GCMP2 PASS rc=0PASS
K3 gacmp max rc 0ga-max-K3.txt GACMP PASS rc=0PASS
mutant r gcmp2 max FAIL rc 47gc2-max-s7-KR.txt GCMP2 FAIL rc=47PASS (caught)
mutant r gcmp2 small FAIL rc 47gc2-small-s3-KR.txt GCMP2 FAIL rc=47PASS (caught)
K3 geval of rung 5 ck9000: |E − 1445466| < 10 (CPU eval)ge-max-9000-K3.txt E 9000 2243 1445466 539226PASS (Δ 0)
K3 geval of rung 6 ck30000: |E − 1338156| < 10 (C2 chip value)ge-max-30000-K3.txt E 30000 2243 1338156 499194PASS (Δ 0)
gprof K3: ids 10 and 11 launch gx = R·32/64prof-K3.txt rc=0: 17 launches each, gx 8192 at the max shape (k2: 256)PASS
t200 C2 then K3, both rc 0; K3 T line reportedt200-C2.txt T 9200 1507707, ck_after fde1fae9… (same as ../gpu-k2/); t200-K3.txt T 9200 1508121, ck_after 70ede05c…PASS (both rc 0)

The K3 training loss after 200 steps is 414 µnats above C2's. The two runs differ only in the RMS sum order, so the trajectories diverge after the first step; one pair of 200-step runs says nothing about whether either order trains better [INFERENCE: one sample, no repeat].

Speed (non-quiet)

t200: 200 gtrainf steps 9000→9200 from rung 6's ck9000, both binaries in this window, C2 first.

binarywallGPU wait (GT field 9)launcheswait per launch
C2, k244.674 s40.848 s638000.6402 ms
K3, this tree42.241 s38.398 s638000.6019 ms

K3 is 1.0576× faster than C2 in wall time (−5.45%) and 1.0638× in GPU wait (WolframLanguageEvaluator: 44674481439/42241119437 → 1.05761, 40847864725/38398155652 → 1.06380). The wait is 90.90% of K3's wall. C2 ran 0.231 s faster here than in the k2 window (44.906 s).

prof-K3.txt (one profiled step, ns summed over launches):

idkernellaunchesk2 msk3 msspeed-upk3 ms per launchk3 GB/s
10grrmsf176.0222.4062.5030.1415237.6
11grrmsb1716.3386.6142.4700.3890215.8

GB/s counts the bytes the k3 kernel must move at the max shape (16384 rows × 256 columns, f32): grrmsf reads v and writes y (2 × 16 MiB) plus s and g; grrmsb reads v, da, dh and writes dh, w (5 × 16 MiB) plus s and g (WolframLanguageEvaluator: (2·16777216+65536+1024)/(2405773/17) → 237.58, (5·16777216+65536+1024)/(6613658/17) → 215.80). Counted the same way, k2 moved 94.9 and 87.4 GB/s. The two kernels saved 13.34 ms of the profile; its total fell from 203.30 ms to 192.63 ms (1.0554×), so the other kernels came out 2.67 ms slower in this single profiled step, which is within the run-to-run spread of one profile [INFERENCE: one profile per binary, no repeat]. The RMS kernels are now 4.68% of the profiled wait.

Next targets

Unchanged from ../gpu-k2/ apart from the RMS kernels: grce (id 21, one thread per row, 13.2 ms in k2's profile) is next, but a warp-parallel sum changes the Kahan sum that mutant k removes, so it needs a new mutant design; then the attention batched GEMMs (QK^T id 35 writes the T×T score tensor), via causal tile skipping or a fused attention kernel; then the softmax kernels.