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/dequant_int4/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 / dequant_int4 / omega.om` 52 lines ยท 881 bytes Raw Blame History 1 note dequant_int4: oal_qa gives bytes as -128..127, so add 256 for the u8 value, then take the nibble 2 global kr ulong 1 3 global kc ulong 1 4 global kg ulong 1 5 global kb ulong 1 6 fn nib4 v long hi ulong to f32 7 if lt v 0 8 v = add v 256 9 end 10 n = and v 15 11 if eq hi 1 12 n = shr v 4 13 end 14 if ge n 8 15 n = sub n 16 16 end 17 ret f32 n 18 end 19 fn drow i ulong c ulong g ulong nb ulong to void 20 for j ulong c 21 v = long get qa add mul i nb div j 2 22 sc = get fa add mul i g div j 32 23 put fo add mul i c j mul nib4 v rem j 2 sc 24 end 25 end 26 fn kern to void 27 r = get kr 0 28 for i ulong r 29 drow i get kc 0 get kg 0 get kb 0 30 end 31 end 32 fn main to int 33 oal_begin 34 put kr 0 ulong oal_p 0 35 put kc 0 ulong oal_p 1 36 put kg 0 ulong oal_p 2 37 put kb 0 ulong oal_p 3 38 n = oal_qa 0 39 a = oal_fa 1 40 w = oal_warm 41 for i ulong add w oal_reps 42 t0 = monons 43 kern 44 t1 = monons 45 if ge i w 46 oal_tick sub t1 t0 47 end 48 end 49 oal_so 0 mul get kr 0 get kc 0 50 oal_end 51 ret 0 52 end