interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / om / moe / moe_windows.om

67 lines · 1742 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Existing GROUP has 128 rows and nine contributions/token: reuse bounded token windows.
3note All windows stay in ONE existing session/cmdlist; GROUP/GU/SWIGLU/DN complete in list order.
4note Reuse descriptor/maps only after preceding DN via existing recorder barriers, never inter-CTA spin.
5note Input version,tokens,H,EI,contributions,router_stride,window_capacity,reserved.
6note Each output8: token0,tokens,rows,XP bytes,GU bytes,ACT bytes,DN bytes,router bytes.
7note Meta windows,total_tokens,total_rows,version. Refusals preserve output/meta.
8fn moe_woff c view ulong 8 o edit ulong 1024 z ulong first ulong to void
9b = mul z 8
10v = mul first get c 2
11put o add b 3 mul v 4
12v = mul first get c 4
13v = mul v get c 3
14put o add b 4 mul v 8
15put o add b 5 mul v 4
16v = mul first get c 4
17v = mul v get c 2
18put o add b 6 mul v 4
19put o add b 7 mul first get c 5
20end
21fn moe_wrow c view ulong 8 o edit ulong 1024 z ulong first ulong count ulong to void
22b = mul z 8
23rows = mul count get c 4
24put o b first
25put o add b 1 count
26put o add b 2 rows
27moe_woff c o z first
28end
29fn moe_windows c view ulong 8 o edit ulong 1024 m edit ulong 4 to ulong
30if or ne get c 0 1 gt get c 1 128
31ret 1
32end
33if or ne get c 2 2048 ne get c 3 512
34ret 1
35end
36if ne get c 4 9
37ret 1
38end
39if or eq get c 5 0 gt get c 5 4294967295
40ret 1
41end
42if ne rem get c 5 16 0
43ret 1
44end
45if or gt get c 6 128 ne get c 7 0
46ret 1
47end
48take = div ulong 128 9
49nw = div add get c 1 sub take 1 take
50if gt nw get c 6
51ret 2
52end
53first = ulong 0
54for z ulong nw
55count = sub get c 1 first
56if gt count take
57count = take
58end
59moe_wrow c o z first count
60first = add first count
61end
62put m 0 nw
63put m 1 get c 1
64put m 2 mul get c 1 9
65put m 3 1
66ret 0
67end