Go to the source code of this file.
Functions | |
| int | ck_rwkv7_apply_kk_factor (const float *k, const float *k_k, float *kk_raw, int dim) |
| int | ck_rwkv7_channelmix_decode (const float *x, const float *shift_in, const float *mu, const float *Wk, const float *Wv, float *shift_out, float *out, int dim, int hidden_dim, float *scratch, size_t scratch_elems) |
| size_t | ck_rwkv7_channelmix_scratch_elems (int dim, int hidden_dim) |
| int | ck_rwkv7_lora_gates (const float *xw, const float *xa, const float *xg, const float *w1, const float *w2, const float *w0, const float *a1, const float *a2, const float *a0, const float *g1, const float *g2, int dim, int rank_w, int rank_a, int rank_g, float *w_log, float *a_out, float *g_out) |
| int | ck_rwkv7_norm_kk (const float *kk_in, float *kk_out, int num_heads, int head_dim) |
| int | ck_rwkv7_scale_k (const float *k_in, const float *a, const float *k_a, float *k_out, int dim) |
| static float | ck_rwkv7_sigmoid (float x) |
| int | ck_rwkv7_state_readout (const float *state, const float *r, float *y, int head_dim) |
| int | ck_rwkv7_state_step (const float *w_log, const float *k, const float *v, const float *kk, const float *a, const float *state_in, float *state_out, int head_dim) |
| int | ck_rwkv7_time_mix_block (const float *h, const float *att_shift_in, const float *v_first_in, const float *state_in, const float *ln_g, const float *ln_b, const float *mu_r, const float *mu_w, const float *mu_k, const float *mu_v, const float *mu_a, const float *mu_g, const float *Wr, const float *Wk, const float *Wv, const float *Wo, const float *w1, const float *w2, const float *w0, const float *a1, const float *a2, const float *a0, const float *g1, const float *g2, const float *v1, const float *v2, const float *v0, const float *k_k, const float *k_a, const float *rk, const float *gn_w, const float *gn_b, float norm_eps, int dim, int num_heads, int head_dim, int rank_w, int rank_a, int rank_g, int rank_v, int is_layer_zero, ck_rwkv7_gemv_fn gemv, ck_rwkv7_layer_norm_fn layer_norm, void *ctx, float *h_out, float *att_shift_out, float *state_out, float *v_first_out, float *scratch, size_t scratch_elems) |
| size_t | ck_rwkv7_time_mix_block_scratch_elems (int dim) |
| size_t | ck_rwkv7_time_mix_scratch_elems (int dim) |
| int | ck_rwkv7_time_mix_shifts (const float *x, const float *shift_in, const float *mu_r, const float *mu_w, const float *mu_k, const float *mu_v, const float *mu_a, const float *mu_g, float *xr, float *xw, float *xk, float *xv, float *xa, float *xg, float *shift_out, int dim) |
| int | ck_rwkv7_time_mix_tail (const float *r, const float *k_raw, const float *v_in, const float *v_first_in, const float *xw, const float *xa, const float *xg, const float *xv, const float *w1, const float *w2, const float *w0, const float *a1, const float *a2, const float *a0, const float *g1, const float *g2, const float *v1, const float *v2, const float *v0, const float *k_k, const float *k_a, const float *rk, const float *ln_w, const float *ln_b, float norm_eps, const float *state_in, float *state_out, float *y_preproj, float *v_first_out, int dim, int num_heads, int head_dim, int rank_w, int rank_a, int rank_g, int rank_v, float *scratch, size_t scratch_elems) |
| int | ck_rwkv7_token_shift_lerp (const float *x, const float *shift_in, const float *mu, float *xm, float *shift_out, int dim) |
| int | ck_rwkv7_vgate_vmix (const float *v_in, const float *v_first, const float *xv, const float *v1, const float *v2, const float *v0, int dim, int rank_v, float *v_out, float *v_first_out, float *v_gate) |
| int | ck_rwkv7_wkv_decode (const float *r, const float *w_log, const float *k, const float *v, const float *kk, const float *a, const float *g, const float *rk, const float *ln_w, const float *ln_b, float norm_eps, const float *state_in, float *state_out, float *y_out, int num_heads, int head_dim) |
| static int | overlaps (const void *a, size_t an, const void *b, size_t bn) |
| int ck_rwkv7_apply_kk_factor | ( | const float * | k, |
| const float * | k_k, | ||
| float * | kk_raw, | ||
| int | dim | ||
| ) |
Definition at line 141 of file rwkv7_decode.c.
| int ck_rwkv7_channelmix_decode | ( | const float * | x, |
| const float * | shift_in, | ||
| const float * | mu, | ||
| const float * | Wk, | ||
| const float * | Wv, | ||
| float * | shift_out, | ||
| float * | out, | ||
| int | dim, | ||
| int | hidden_dim, | ||
| float * | scratch, | ||
| size_t | scratch_elems | ||
| ) |
Definition at line 432 of file rwkv7_decode.c.
References overlaps().
| size_t ck_rwkv7_channelmix_scratch_elems | ( | int | dim, |
| int | hidden_dim | ||
| ) |
Definition at line 425 of file rwkv7_decode.c.
| int ck_rwkv7_lora_gates | ( | const float * | xw, |
| const float * | xa, | ||
| const float * | xg, | ||
| const float * | w1, | ||
| const float * | w2, | ||
| const float * | w0, | ||
| const float * | a1, | ||
| const float * | a2, | ||
| const float * | a0, | ||
| const float * | g1, | ||
| const float * | g2, | ||
| int | dim, | ||
| int | rank_w, | ||
| int | rank_a, | ||
| int | rank_g, | ||
| float * | w_log, | ||
| float * | a_out, | ||
| float * | g_out | ||
| ) |
Definition at line 158 of file rwkv7_decode.c.
References ck_rwkv7_sigmoid().
| int ck_rwkv7_norm_kk | ( | const float * | kk_in, |
| float * | kk_out, | ||
| int | num_heads, | ||
| int | head_dim | ||
| ) |
Definition at line 99 of file rwkv7_decode.c.
| int ck_rwkv7_scale_k | ( | const float * | k_in, |
| const float * | a, | ||
| const float * | k_a, | ||
| float * | k_out, | ||
| int | dim | ||
| ) |
Definition at line 127 of file rwkv7_decode.c.
|
inlinestatic |
Definition at line 154 of file rwkv7_decode.c.
Referenced by ck_rwkv7_lora_gates(), and ck_rwkv7_vgate_vmix().
| int ck_rwkv7_state_readout | ( | const float * | state, |
| const float * | r, | ||
| float * | y, | ||
| int | head_dim | ||
| ) |
Definition at line 319 of file rwkv7_decode.c.
Referenced by ck_rwkv7_wkv_decode().
| int ck_rwkv7_state_step | ( | const float * | w_log, |
| const float * | k, | ||
| const float * | v, | ||
| const float * | kk, | ||
| const float * | a, | ||
| const float * | state_in, | ||
| float * | state_out, | ||
| int | head_dim | ||
| ) |
Definition at line 287 of file rwkv7_decode.c.
Referenced by ck_rwkv7_wkv_decode().
| int ck_rwkv7_time_mix_block | ( | const float * | h, |
| const float * | att_shift_in, | ||
| const float * | v_first_in, | ||
| const float * | state_in, | ||
| const float * | ln_g, | ||
| const float * | ln_b, | ||
| const float * | mu_r, | ||
| const float * | mu_w, | ||
| const float * | mu_k, | ||
| const float * | mu_v, | ||
| const float * | mu_a, | ||
| const float * | mu_g, | ||
| const float * | Wr, | ||
| const float * | Wk, | ||
| const float * | Wv, | ||
| const float * | Wo, | ||
| const float * | w1, | ||
| const float * | w2, | ||
| const float * | w0, | ||
| const float * | a1, | ||
| const float * | a2, | ||
| const float * | a0, | ||
| const float * | g1, | ||
| const float * | g2, | ||
| const float * | v1, | ||
| const float * | v2, | ||
| const float * | v0, | ||
| const float * | k_k, | ||
| const float * | k_a, | ||
| const float * | rk, | ||
| const float * | gn_w, | ||
| const float * | gn_b, | ||
| float | norm_eps, | ||
| int | dim, | ||
| int | num_heads, | ||
| int | head_dim, | ||
| int | rank_w, | ||
| int | rank_a, | ||
| int | rank_g, | ||
| int | rank_v, | ||
| int | is_layer_zero, | ||
| ck_rwkv7_gemv_fn | gemv, | ||
| ck_rwkv7_layer_norm_fn | layer_norm, | ||
| void * | ctx, | ||
| float * | h_out, | ||
| float * | att_shift_out, | ||
| float * | state_out, | ||
| float * | v_first_out, | ||
| float * | scratch, | ||
| size_t | scratch_elems | ||
| ) |
Definition at line 707 of file rwkv7_decode.c.
References ck_rwkv7_time_mix_shifts(), ck_rwkv7_time_mix_tail(), and overlaps().
| size_t ck_rwkv7_time_mix_block_scratch_elems | ( | int | dim | ) |
Definition at line 700 of file rwkv7_decode.c.
| size_t ck_rwkv7_time_mix_scratch_elems | ( | int | dim | ) |
Definition at line 505 of file rwkv7_decode.c.
| int ck_rwkv7_time_mix_shifts | ( | const float * | x, |
| const float * | shift_in, | ||
| const float * | mu_r, | ||
| const float * | mu_w, | ||
| const float * | mu_k, | ||
| const float * | mu_v, | ||
| const float * | mu_a, | ||
| const float * | mu_g, | ||
| float * | xr, | ||
| float * | xw, | ||
| float * | xk, | ||
| float * | xv, | ||
| float * | xa, | ||
| float * | xg, | ||
| float * | shift_out, | ||
| int | dim | ||
| ) |
Definition at line 41 of file rwkv7_decode.c.
References overlaps().
Referenced by ck_rwkv7_time_mix_block().
| int ck_rwkv7_time_mix_tail | ( | const float * | r, |
| const float * | k_raw, | ||
| const float * | v_in, | ||
| const float * | v_first_in, | ||
| const float * | xw, | ||
| const float * | xa, | ||
| const float * | xg, | ||
| const float * | xv, | ||
| const float * | w1, | ||
| const float * | w2, | ||
| const float * | w0, | ||
| const float * | a1, | ||
| const float * | a2, | ||
| const float * | a0, | ||
| const float * | g1, | ||
| const float * | g2, | ||
| const float * | v1, | ||
| const float * | v2, | ||
| const float * | v0, | ||
| const float * | k_k, | ||
| const float * | k_a, | ||
| const float * | rk, | ||
| const float * | ln_w, | ||
| const float * | ln_b, | ||
| float | norm_eps, | ||
| const float * | state_in, | ||
| float * | state_out, | ||
| float * | y_preproj, | ||
| float * | v_first_out, | ||
| int | dim, | ||
| int | num_heads, | ||
| int | head_dim, | ||
| int | rank_w, | ||
| int | rank_a, | ||
| int | rank_g, | ||
| int | rank_v, | ||
| float * | scratch, | ||
| size_t | scratch_elems | ||
| ) |
Definition at line 510 of file rwkv7_decode.c.
Referenced by ck_rwkv7_time_mix_block().
| int ck_rwkv7_token_shift_lerp | ( | const float * | x, |
| const float * | shift_in, | ||
| const float * | mu, | ||
| float * | xm, | ||
| float * | shift_out, | ||
| int | dim | ||
| ) |
Definition at line 15 of file rwkv7_decode.c.
References overlaps().
| int ck_rwkv7_vgate_vmix | ( | const float * | v_in, |
| const float * | v_first, | ||
| const float * | xv, | ||
| const float * | v1, | ||
| const float * | v2, | ||
| const float * | v0, | ||
| int | dim, | ||
| int | rank_v, | ||
| float * | v_out, | ||
| float * | v_first_out, | ||
| float * | v_gate | ||
| ) |
Definition at line 239 of file rwkv7_decode.c.
References ck_rwkv7_sigmoid().
| int ck_rwkv7_wkv_decode | ( | const float * | r, |
| const float * | w_log, | ||
| const float * | k, | ||
| const float * | v, | ||
| const float * | kk, | ||
| const float * | a, | ||
| const float * | g, | ||
| const float * | rk, | ||
| const float * | ln_w, | ||
| const float * | ln_b, | ||
| float | norm_eps, | ||
| const float * | state_in, | ||
| float * | state_out, | ||
| float * | y_out, | ||
| int | num_heads, | ||
| int | head_dim | ||
| ) |
Definition at line 336 of file rwkv7_decode.c.
References ck_rwkv7_state_readout(), and ck_rwkv7_state_step().
|
static |
Definition at line 9 of file rwkv7_decode.c.
Referenced by ck_rwkv7_channelmix_decode(), ck_rwkv7_time_mix_block(), ck_rwkv7_time_mix_shifts(), and ck_rwkv7_token_shift_lerp().