← Back to C-Kernel-Engine Docs Doxygen Source Documentation
Loading...
Searching...
No Matches
ckernel_transformer_rows_checked.h
Go to the documentation of this file.
1#ifndef CKERNEL_TRANSFORMER_ROWS_CHECKED_H
2#define CKERNEL_TRANSFORMER_ROWS_CHECKED_H
3
4#include <stddef.h>
5
6/* Shared row bound for the checked routed expert providers and their circuit authoring. */
7#define CHECKED_ROUTED_EXPERT_MAX_ROWS 128
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/* All providers reject invalid spans/nonfinite inputs before output writes. */
14int rmsnorm_rows_checked_f32(const float *input, size_t input_elements,
15 size_t input_stride, const float *gamma,
16 size_t gamma_elements, float *output,
17 size_t output_elements, size_t output_stride,
18 size_t rows, size_t width, float eps);
19int token_head_layout_checked_f32(const float *input, size_t input_elements,
20 float *output, size_t output_elements,
21 size_t tokens, size_t heads, size_t head_dim,
22 int head_to_token);
23int add_rows_checked_f32(const float *left, size_t left_elements,
24 const float *right, size_t right_elements,
25 float *output, size_t output_elements,
26 size_t elements);
27int silu_mul_rows_checked_f32(const float *gate, size_t gate_elements,
28 const float *up, size_t up_elements,
29 float *output, size_t output_elements,
30 size_t elements);
31int channel_scale_rows_checked_f32(const float *input, size_t input_elements,
32 size_t input_stride, const float *scale,
33 size_t scale_elements, float *output,
34 size_t output_elements, size_t output_stride,
35 size_t rows, size_t channels);
36int softcapped_swiglu_rows_checked_f32(const float *gate, size_t gate_elements,
37 const float *up, size_t up_elements,
38 float *output, size_t output_elements,
39 size_t elements, float gate_cap, float up_cap);
40int rope_qk_bounded_checked_f32(float *q, size_t q_elements,
41 float *k, size_t k_elements,
42 size_t heads, size_t kv_heads,
43 size_t tokens, size_t head_dim,
44 size_t pos_offset, float freq_base);
46 const float *q, size_t q_elements,
47 const float *k, size_t k_elements,
48 const float *v, size_t v_elements,
49 float *work, size_t work_elements,
50 float *output, size_t output_elements,
51 size_t heads, size_t kv_heads, size_t tokens, size_t head_dim);
53 const float *q, size_t q_elements,
54 const float *k, size_t k_elements,
55 const float *v, size_t v_elements,
56 float *work, size_t work_elements,
57 float *output, size_t output_elements,
58 size_t heads, size_t kv_heads, size_t tokens, size_t head_dim,
59 size_t sliding_window);
60
61#ifdef __cplusplus
62}
63#endif
64#endif
int rope_qk_bounded_checked_f32(float *q, size_t q_elements, float *k, size_t k_elements, size_t heads, size_t kv_heads, size_t tokens, size_t head_dim, size_t pos_offset, float freq_base)
int channel_scale_rows_checked_f32(const float *input, size_t input_elements, size_t input_stride, const float *scale, size_t scale_elements, float *output, size_t output_elements, size_t output_stride, size_t rows, size_t channels)
int softcapped_swiglu_rows_checked_f32(const float *gate, size_t gate_elements, const float *up, size_t up_elements, float *output, size_t output_elements, size_t elements, float gate_cap, float up_cap)
int silu_mul_rows_checked_f32(const float *gate, size_t gate_elements, const float *up, size_t up_elements, float *output, size_t output_elements, size_t elements)
int rmsnorm_rows_checked_f32(const float *input, size_t input_elements, size_t input_stride, const float *gamma, size_t gamma_elements, float *output, size_t output_elements, size_t output_stride, size_t rows, size_t width, float eps)
int add_rows_checked_f32(const float *left, size_t left_elements, const float *right, size_t right_elements, float *output, size_t output_elements, size_t elements)
int token_head_layout_checked_f32(const float *input, size_t input_elements, float *output, size_t output_elements, size_t tokens, size_t heads, size_t head_dim, int head_to_token)
int attention_sliding_bounded_checked_f32(const float *q, size_t q_elements, const float *k, size_t k_elements, const float *v, size_t v_elements, float *work, size_t work_elements, float *output, size_t output_elements, size_t heads, size_t kv_heads, size_t tokens, size_t head_dim, size_t sliding_window)
int attention_causal_bounded_checked_f32(const float *q, size_t q_elements, const float *k, size_t k_elements, const float *v, size_t v_elements, float *work, size_t work_elements, float *output, size_t output_elements, size_t heads, size_t kv_heads, size_t tokens, size_t head_dim)
const char * left
Definition true_bpe.h:140
const char const char * right
Definition true_bpe.h:141