Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/openaccel-lab/blob/main/workloads/rmsnorm/omega.om # openaccel-lab aien-dev/openaccel-lab Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `openaccel-lab / workloads / rmsnorm / omega.om` 41 lines ยท 678 bytes Raw Blame History 1 note rmsnorm over rows of x[R][D] in f32: y = x rsqrt(mean(x^2) + 1e-6) w 2 global kr ulong 1 3 global kd ulong 1 4 fn rmsrow o ulong d ulong inv f32 to void 5 q = 0.0f32 6 for k ulong d 7 v = get fa add o k 8 q = add q mul v v 9 end 10 rs = div 1.0f32 fsqrt add mul q inv 0.`000001f32` 11 for k ulong d 12 p = mul get fa add o k rs 13 put fo add o k mul p get fb k 14 end 15 end 16 fn kern to void 17 d = get kd 0 18 inv = div 1.0f32 f32 d 19 for i ulong get kr 0 20 rmsrow mul i d d inv 21 end 22 end 23 fn main to int 24 oal_begin 25 put kr 0 ulong oal_p 0 26 put kd 0 ulong oal_p 1 27 a = oal_fa 0 28 b = oal_fb 1 29 w = oal_warm 30 for i ulong add w oal_reps 31 t0 = monons 32 kern 33 t1 = monons 34 if ge i w 35 oal_tick sub t1 t0 36 end 37 end 38 oal_so 0 a 39 oal_end 40 ret 0 41 end