Verba/Rapida

Experiments #115

Seam prologue (row 114's SEAM-ONLY verdict, `megakernel-114.md` option (c)): the two RMSNorm seams per...

done

What was tested

Seam prologue (row 114's SEAM-ONLY verdict, `megakernel-114.md` option (c)): the two RMSNorm seams per layer (seam1 before the FFNs, seam2 before the next layer) recomputed inside every consumer threadgroup instead of one-threadgroup seam kernels on the critical path (seam1 7.9 us dependent against 3.9 overlapped, row 84k); bit-identical if every threadgroup sums the 2816 values in the seam kernel's order

Model and setup

the best

Expected gain

+2 to +3.5% (0.2 to 0.4 ms of 11.2, inferred from 60 seams x 4 to 8 us)

Where the idea came from

kb114 seam-only verdict

Outcome

done 2026-10-31: bit-exact (0 of 24.6M elements, engine check 0 differ), screen 40 of 40 identical but decode -1.18% (1k) / -1.49% (8k); split seam2 -0.90%, seam1 -0.28%; not adopted (README ยง Screen, row 115)

Lesson

removing the seam dispatches by recomputing each seam in every consumer threadgroup is lossless (40 of 40) but 1.2% to 1.5% slower on the M4: every threadgroup then serializes the seam's reductions before its own weight reads, and the idle-GPU prefetch that hid the separate seam is lost, so a removed dispatch level is not a saving when the work it held moves in front of every consumer's reads.

Adopted

no (screen).

Want to see what these experiments produced? Lesto, the Gemma 4 inference engine for Apple silicon Macs, is on lestoengine.com

Made by Federico Andrioli, @fedeandri on X A research lab's own measurements, generated from its files. Data built