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_wide.om

82 lines · 1968 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note moe_windows with the contribution count read from cfg instead of the literal 9.
3note Profiles (H,EI,contributions): (2048,512,9) Qwen3.6-35B; (2560,640,11) Qwen3.8-Flash-Next.
4note GROUP has 128 rows: take = 128/contributions tokens per window (14 or 11).
5note All windows stay in ONE existing session/cmdlist; GROUP/GU/SWIGLU/DN complete in list order.
6note Input version 1,tokens,H,EI,contributions,router_stride,window_capacity,reserved.
7note Each output8: token0,tokens,rows,XP bytes,GU bytes,ACT bytes,DN bytes,router bytes.
8note Meta windows,total_tokens,total_rows,version. Refusals preserve output/meta.
9fn mw_woff c view ulong 8 o edit ulong 1024 z ulong first ulong to void
10b = mul z 8
11v = mul first get c 2
12put o add b 3 mul v 4
13v = mul first get c 4
14v = mul v get c 3
15put o add b 4 mul v 8
16put o add b 5 mul v 4
17v = mul first get c 4
18v = mul v get c 2
19put o add b 6 mul v 4
20put o add b 7 mul first get c 5
21end
22fn mw_wrow c view ulong 8 o edit ulong 1024 z ulong first ulong count ulong to void
23b = mul z 8
24rows = mul count get c 4
25put o b first
26put o add b 1 count
27put o add b 2 rows
28mw_woff c o z first
29end
30fn mw_wshape c view ulong 8 to ulong
31if eq get c 4 9
32if eq get c 2 2048
33if eq get c 3 512
34ret 0
35end
36end
37end
38if eq get c 4 11
39if eq get c 2 2560
40if eq get c 3 640
41ret 0
42end
43end
44end
45ret 1
46end
47fn moe_windows_wide c view ulong 8 o edit ulong 1024 m edit ulong 4 to ulong
48if or ne get c 0 1 gt get c 1 128
49ret 1
50end
51if ne mw_wshape c 0
52ret 1
53end
54if or eq get c 5 0 gt get c 5 4294967295
55ret 1
56end
57if ne rem get c 5 16 0
58ret 1
59end
60if or gt get c 6 128 ne get c 7 0
61ret 1
62end
63take = div ulong 128 get c 4
64nw = div add get c 1 sub take 1 take
65if gt nw get c 6
66ret 2
67end
68first = ulong 0
69for z ulong nw
70count = sub get c 1 first
71if gt count take
72count = take
73end
74mw_wrow c o z first count
75first = add first count
76end
77put m 0 nw
78put m 1 get c 1
79put m 2 mul get c 1 get c 4
80put m 3 1
81ret 0
82end