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 / graph / final_batch.om

46 lines · 949 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note cfg N,max-xbatch,argmax-ctas,H. VAs hidden,logits,token,amv,ami. All xbatch launches precede per-head argmax pairs.
3fn mg_finb c view ulong 16 v view ulong 16 d edit ulong 64 p ulong to ulong
4a = new ulong 16 0
5for i ulong 64
6put d i 0
7end
8chunks = div add get c 0 sub get c 1 1 get c 1
9if lt p chunks
10h = mul p get c 1
11put d 0 7
12put d 7 sub get c 0 h
13if gt get d 7 get c 1
14put d 7 get c 1
15end
16put d 11 graph_slot get v 0 h get c 3
17put d 13 mul get c 2 2048
18put d 12 graph_slot get v 1 h get d 13
19ret 1
20end
21j = sub p chunks
22h = div j 2
23if ge h get c 0
24put d 0 255
25ret 1
26end
27put d 0 8
28put d 1 5
29put d 2 get c 2
30put d 3 1
31put d 4 mul get c 2 2048
32put d 5 8
33put a 0 graph_slot get v 1 h get d 4
34put a 2 get v 3
35put a 3 get v 4
36if ne rem j 2 0
37put d 1 6
38put d 2 1
39put d 4 2048
40put a 0 get v 3
41put a 1 get v 4
42put a 3 add get v 2 mul h 256
43put a 2 add get a 3 4
44end
45ret gr_pack a d 3
46end