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 / prefill-shape / admit.om

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