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 / apiviews / gdnch.om

14 lines · 472 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note qkv channel of value head h, slot s. Head dim 128, key heads 16.
3note hk = h / (vh / 16). q is hk*128+s, k is 2048+hk*128+(s-128), v is
4note 4096+h*128+(s-256). The caller keeps the slot loop and the loads.
5fn av_gdnch h ulong s ulong vh ulong to ulong
6hk = div h div vh 16
7if lt s 128
8ret add mul hk 128 s
9end
10if lt s 256
11ret add 2048 add mul hk 128 sub s 128
12end
13ret add 4096 add mul h 128 sub s 256
14end