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_pfhost.h

38 lines · 2227 bytes Raw Blame History
1/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */
2#ifndef OMEGA_GPU_PFHOST_H
3#define OMEGA_GPU_PFHOST_H
4/*
5 * omega_gpu_pfhost (OWN-30B W-L1G-D, 2026-10-14): the whole-prompt prefill's router logits and MoE combine on the chip. New file.
6 * Kernels and their exact semantics: omega_blackwell_codegen_pfhost.h (bit-identical to the Rust driver's host loops).
7 * Buffers are omega_gpu_prefill.h buffers (DEVICE or HOST, by VA); every call takes the session lock and is synchronous.
8 *
9 * uint32_t omega_gpu_pf_router_rows(void);
10 * Rows per CTA of the router-logits launch (t). x must have ceil(rows / t) * t readable rows; logits gets that many rows.
11 * size_t omega_gpu_pf_router_packed_bytes(uint32_t e, uint32_t k);
12 * void omega_gpu_pf_router_pack(uint32_t e, uint32_t k, const float *w, float *wq);
13 * w: f32 [e][k] (row ex = expert ex); wq: the packed layout R4 plus the pad group (zeros), packed_bytes bytes.
14 * int omega_gpu_pf_router_logits(uint32_t k, uint32_t e, uint32_t rows, uint64_t x_va, uint64_t wq_va, uint64_t logits_va, uint64_t *ns);
15 * int omega_gpu_pf_moe_combine(uint32_t h, uint32_t top_k, uint32_t rows, uint64_t down_va, uint64_t inv_va, uint64_t wt_va,
16 * uint64_t out_va, uint64_t *ns);
17 * Return codes OMEGA_GPU_PF_*; *ns (when given) gains the chip nanoseconds.
18 */
19#include <stddef.h>
20#include <stdint.h>
21#include "omega_gpu_prefill.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26uint32_t omega_gpu_pf_router_rows(void);
27size_t omega_gpu_pf_router_packed_bytes(uint32_t e, uint32_t k);
28void omega_gpu_pf_router_pack(uint32_t e, uint32_t k, const float *w, float *wq);
29int omega_gpu_pf_router_logits(uint32_t k, uint32_t e, uint32_t rows, uint64_t x_va, uint64_t wq_va, uint64_t logits_va, uint64_t *ns);
30int omega_gpu_pf_moe_combine(uint32_t h, uint32_t top_k, uint32_t rows, uint64_t down_va, uint64_t inv_va, uint64_t wt_va, uint64_t out_va, uint64_t *ns);
31/* tests only: kernel mutants (0 restores) and the router's rows per CTA (0 = default 16) */
32void omega_gpu_pf_router_test_set_mutant(int m);
33void omega_gpu_pf_combine_test_set_mutant(int m);
34void omega_gpu_pf_router_set_rows(uint32_t t);
35#ifdef __cplusplus
36}
37#endif
38#endif