#include "ckernel_engine.h"#include "bf16_utils.h"#include <dlfcn.h>#include <math.h>#include <pthread.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Typedefs | |
| typedef float(* | ck_hybrid_libm_f32_fn) (float) |
Functions | |
| void | attn_gate_sigmoid_mul_backward (const float *d_out, const float *x, const float *gate, float *d_x, float *d_gate, int rows, int num_heads, int state_dim) |
| void | attn_gate_sigmoid_mul_forward (const float *x, const float *gate, float *out, int rows, int num_heads, int state_dim) |
| void | attn_gate_sigmoid_mul_pytorch_bf16_storage (const float *x, const float *gate, float *out, int rows, int num_heads, int state_dim) |
| void | attn_gate_softplus_mul_forward (const float *x, const float *gate, float *out, int rows, int num_heads, int state_dim) |
| static void | ck_bind_hybrid_llama_libm (void) |
| static float | hybrid_sigmoid (float x) |
| void | split_q_gate_backward (const float *d_q, const float *d_gate, float *d_packed_qg, int rows, int q_dim, int gate_dim, int group_dim) |
| void | split_q_gate_forward (const float *packed_qg, float *q, float *gate, int rows, int q_dim, int gate_dim, int group_dim) |
Variables | |
| static void * | ck_hybrid_libm_handle = NULL |
| static pthread_once_t | ck_hybrid_libm_once = PTHREAD_ONCE_INIT |
| static ck_hybrid_libm_f32_fn | ck_hybrid_llama_expf = NULL |
| typedef float(* ck_hybrid_libm_f32_fn) (float) |
Definition at line 11 of file hybrid_attention_kernels.c.
| void attn_gate_sigmoid_mul_backward | ( | const float * | d_out, |
| const float * | x, | ||
| const float * | gate, | ||
| float * | d_x, | ||
| float * | d_gate, | ||
| int | rows, | ||
| int | num_heads, | ||
| int | state_dim | ||
| ) |
Definition at line 187 of file hybrid_attention_kernels.c.
References hybrid_sigmoid().
| void attn_gate_sigmoid_mul_forward | ( | const float * | x, |
| const float * | gate, | ||
| float * | out, | ||
| int | rows, | ||
| int | num_heads, | ||
| int | state_dim | ||
| ) |
Definition at line 116 of file hybrid_attention_kernels.c.
References hybrid_sigmoid().
Referenced by ck_test_attn_gate_sigmoid_mul().
| void attn_gate_sigmoid_mul_pytorch_bf16_storage | ( | const float * | x, |
| const float * | gate, | ||
| float * | out, | ||
| int | rows, | ||
| int | num_heads, | ||
| int | state_dim | ||
| ) |
Definition at line 133 of file hybrid_attention_kernels.c.
References bf16_to_float(), float_to_bf16(), and recurrent_sigmoid_forward_pytorch_bf16_input_fp32_output().
| void attn_gate_softplus_mul_forward | ( | const float * | x, |
| const float * | gate, | ||
| float * | out, | ||
| int | rows, | ||
| int | num_heads, | ||
| int | state_dim | ||
| ) |
Definition at line 162 of file hybrid_attention_kernels.c.
|
static |
Definition at line 16 of file hybrid_attention_kernels.c.
References ck_hybrid_libm_handle, and ck_hybrid_llama_expf.
Referenced by hybrid_sigmoid().
|
static |
Definition at line 33 of file hybrid_attention_kernels.c.
References ck_bind_hybrid_llama_libm(), ck_hybrid_libm_once, and ck_hybrid_llama_expf.
Referenced by attn_gate_sigmoid_mul_backward(), and attn_gate_sigmoid_mul_forward().
| void split_q_gate_backward | ( | const float * | d_q, |
| const float * | d_gate, | ||
| float * | d_packed_qg, | ||
| int | rows, | ||
| int | q_dim, | ||
| int | gate_dim, | ||
| int | group_dim | ||
| ) |
Definition at line 77 of file hybrid_attention_kernels.c.
| void split_q_gate_forward | ( | const float * | packed_qg, |
| float * | q, | ||
| float * | gate, | ||
| int | rows, | ||
| int | q_dim, | ||
| int | gate_dim, | ||
| int | group_dim | ||
| ) |
Definition at line 38 of file hybrid_attention_kernels.c.
Referenced by ck_test_split_q_gate().
|
static |
Definition at line 13 of file hybrid_attention_kernels.c.
Referenced by ck_bind_hybrid_llama_libm().
|
static |
Definition at line 14 of file hybrid_attention_kernels.c.
Referenced by hybrid_sigmoid().
|
static |
Definition at line 12 of file hybrid_attention_kernels.c.
Referenced by ck_bind_hybrid_llama_libm(), and hybrid_sigmoid().