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