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 / prefill-shape / admit.om
| 1 | note Exact maximum store immediate of the existing qgemm epilogue. |
| 2 | note F32 has additional column offsets up to 36 bytes; packed SwiGLU has none. |
| 3 | fn qg_offset n ulong rt ulong epi ulong to ulong |
| 4 | if or eq n 0 gt n 4294967295 |
| 5 | ret 0 |
| 6 | end |
| 7 | if or lt rt 1 gt rt 8 |
| 8 | ret 0 |
| 9 | end |
| 10 | if gt epi 1 |
| 11 | ret 0 |
| 12 | end |
| 13 | stride = n |
| 14 | if eq epi 0 |
| 15 | stride = mul n 4 |
| 16 | end |
| 17 | last = mul sub mul rt 16 8 stride |
| 18 | if eq epi 0 |
| 19 | last = add last 36 |
| 20 | end |
| 21 | if le last 8388607 |
| 22 | ret 1 |
| 23 | end |
| 24 | ret 0 |
| 25 | end |
| 26 | |
| 27 | |
| 28 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 29 | note Retain the incumbent 64-row shape and admit one paired-scale 32-row shape. |
| 30 | note Keep prior shapes and admit only one extended-register 128-row candidate. |
| 31 | fn native_qgshape rt ulong warps ulong n ulong epi ulong to ulong |
| 32 | ok = qg_offset n rt epi |
| 33 | if eq ok 0 |
| 34 | ret 0 |
| 35 | end |
| 36 | if and eq rt 4 eq warps 8 |
| 37 | ret 1 |
| 38 | end |
| 39 | if and eq rt 2 eq warps 4 |
| 40 | ret 1 |
| 41 | end |
| 42 | if and eq rt 4 eq warps 16 |
| 43 | ret 1 |
| 44 | end |
| 45 | if and eq rt 8 eq warps 8 |
| 46 | ret 1 |
| 47 | end |
| 48 | ret 0 |
| 49 | end |