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 / src / omega_gpu_gdn_admit.h

27 lines · 1608 bytes Raw Blame History
1/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */
2/*
3 * omega_gpu_gdn_admit.h: the admission and layout decisions of omega_gpu_gdn_api.c. Each returns 0 admitted, -1 refused
4 * (the caller maps -1 to OMEGA_GPU_GDN_BAD_ARGS). The decisions are the Omega unit om/gdn/admit.om; the retained C is
5 * behind CUDAPP_MIGRATION_PENDING_C_GDN_ADMIT (default off). Pointer checks stay with the callers.
6 */
7#ifndef OMEGA_GPU_GDN_ADMIT_H
8#define OMEGA_GPU_GDN_ADMIT_H
9#include <stddef.h>
10#include <stdint.h>
11#include "omega_blackwell_codegen_gdn.h"
12
13#define OMEGA_GDN_ADMIT_KIND_COPY 4u /* omega_gpu_gdn_api.c KK_COPY */
14#define OMEGA_GDN_ADMIT_KIND_ZERO 5u /* KK_ZERO */
15#define OMEGA_GDN_PF_SECTIONS 6u
16
17int omega_gdn_admit_shape(uint32_t ratio, uint32_t state_bf16, OmegaGdnShape *s);
18int omega_gdn_admit_alloc(uint32_t layers, uint32_t ratio, uint32_t state_bf16, OmegaGdnShape *s);
19int omega_gdn_admit_layer(uint32_t layer, uint32_t layers);
20int omega_gdn_admit_finite(float eps_l2, float eps_norm, float in_scale, float out_scale);
21int omega_gdn_admit_multi(uint32_t layer, uint32_t layers, uint32_t tokens, uint64_t qkv_va, uint64_t z_va, uint32_t xstride,
22 uint64_t ab_va, uint32_t abstride, uint64_t out_va, uint32_t ostride);
23int omega_gdn_admit_tokens(uint32_t tokens);
24/* the prefill scratch for T <= OMEGA_GPU_GDN_PF_MAX_T tokens: section offsets and total bytes */
25int omega_gdn_admit_layout(uint32_t ratio, uint32_t tokens, size_t off[OMEGA_GDN_PF_SECTIONS], size_t *bytes);
26int omega_gdn_admit_move(unsigned kind, uint64_t dst, size_t bytes, uint32_t *grid);
27#endif