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/controls/attention_nomax/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 / controls / attention_nomax / omega.om` 69 lines ยท 1114 bytes Raw Blame History 1 note CONTROL attention_nomax: as workloads/attention but exp(s_j) without the row max subtraction 2 global kt ulong 1 3 global kd ulong 1 4 global sr f32 65536 5 fn dotqk qi ulong kj ulong d ulong to f32 6 acc = 0.0f32 7 for c ulong d 8 x = get fa add qi c 9 acc = add acc mul x get fb add kj c 10 end 11 ret acc 12 end 13 fn rowexp n ulong m f32 to f32 14 z = 0.0f32 15 for j ulong n 16 e = f32 oal_expf f64 sub get sr j m 17 put sr j e 18 z = add z e 19 end 20 ret z 21 end 22 fn rowpv i ulong n ulong d ulong z f32 to void 23 for c ulong d 24 acc = 0.0f32 25 for j ulong n 26 x = get sr j 27 acc = add acc mul x get fc add mul j d c 28 end 29 put fo add mul i d c div acc z 30 end 31 end 32 fn kern to void 33 t = get kt 0 34 d = get kd 0 35 for i ulong t 36 n = add i 1 37 m = -1.`0e30f32` 38 for j ulong n 39 s = mul dotqk mul i d mul j d d 0.125f32 40 put sr j s 41 m = fmax m s 42 end 43 z = rowexp n 0.0f32 44 rowpv i n d z 45 end 46 end 47 fn main to int 48 oal_begin 49 put kt 0 ulong oal_p 0 50 put kd 0 ulong oal_p 1 51 if gt get kt 0 65536 52 trap 9 53 end 54 a = oal_fa 0 55 b = oal_fb 1 56 c = oal_fc 2 57 w = oal_warm 58 for i ulong add w oal_reps 59 t0 = monons 60 kern 61 t1 = monons 62 if ge i w 63 oal_tick sub t1 t0 64 end 65 end 66 oal_so 0 mul get kt 0 get kd 0 67 oal_end 68 ret 0 69 end