#include "ckernel_engine.h"#include "bf16_utils.h"#include <math.h>#include <stddef.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Typedefs | |
| typedef void(* | ck_hyper_q8k_gemm_fn) (const void *, const void *, const float *, float *, int, int, int) |
Functions | |
| static float | ck_bf16_round (float value) |
| static float | ck_sigmoid_bf16 (float value) |
| void | gemm_nt_q4_k_q8_k_pairwise_split_min_parallel_dispatch (const void *A, const void *B, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q5_0_q8_0_parallel_dispatch (const void *A, const void *B, const float *bias, float *C, int M, int N, int K) |
| void | gemm_nt_q6_k_q8_k_parallel_dispatch (const void *A, const void *B, const float *bias, float *C, int M, int N, int K) |
| void | gemv_q4_k_q8_k_avx2 (float *y, const void *W, const void *x_q8, int M, int K) |
| void | hyper_connection_mix_bf16 (const float *hyper_input, const float *norm_weight, const uint16_t *mix_down_weight, const uint16_t *mix_up_weight, const uint16_t *inject_weight, float *mixed_output, float *injection_output, float *normalized_scratch, float *dynamic_scratch, float *mix_scratch, int rows, int streams, int hidden_dim, int dynamic_dim, float eps, int emit_injection) |
| void | hyper_connection_mix_q4k_q5_0_q4k (const float *hyper_input, const float *norm_weight, const void *mix_down_weight, const void *mix_up_weight, const void *inject_weight, float *mixed_output, float *injection_output, float *normalized_scratch, float *dynamic_scratch, float *mix_scratch, int rows, int streams, int hidden_dim, int dynamic_dim, float eps, int emit_injection) |
| void | hyper_connection_mix_q6k_q5_0_q4k (const float *hyper_input, const float *norm_weight, const void *mix_down_weight, const void *mix_up_weight, const void *inject_weight, float *mixed_output, float *injection_output, float *normalized_scratch, float *dynamic_scratch, float *mix_scratch, int rows, int streams, int hidden_dim, int dynamic_dim, float eps, int emit_injection) |
| static void | hyper_connection_mix_quantized (const float *hyper_input, const float *norm_weight, const void *mix_down_weight, const void *mix_up_weight, const void *inject_weight, float *mixed_output, float *injection_output, float *normalized_scratch, float *dynamic_scratch, float *mix_scratch, int rows, int streams, int hidden_dim, int dynamic_dim, float eps, int emit_injection, ck_hyper_q8k_gemm_fn injection_gemm, ck_hyper_q8k_gemm_fn down_gemm) |
| static void | hyper_injection_q4k_q8k_llama_dispatch (const void *input, const void *weight, const float *bias, float *output, int rows, int output_dim, int input_dim) |
| void | hyper_stream_expand_bf16 (const float *input, float *output, int rows, int streams, int hidden_dim) |
| void | hyper_stream_expand_f32 (const float *input, float *output, int rows, int streams, int hidden_dim) |
| void | hyper_stream_inject_bf16 (const float *hyper_input, const float *block_output, const float *injection_weight, float *output, int rows, int streams, int hidden_dim) |
| void | hyper_stream_inject_f32 (const float *hyper_input, const float *block_output, const float *injection_weight, float *output, int rows, int streams, int hidden_dim) |
| typedef void(* ck_hyper_q8k_gemm_fn) (const void *, const void *, const float *, float *, int, int, int) |
Definition at line 172 of file hyper_connection_kernels.c.
|
inlinestatic |
Definition at line 24 of file hyper_connection_kernels.c.
References bf16_to_float(), and float_to_bf16().
Referenced by ck_sigmoid_bf16(), hyper_connection_mix_bf16(), hyper_stream_expand_bf16(), and hyper_stream_inject_bf16().
|
inlinestatic |
Definition at line 28 of file hyper_connection_kernels.c.
References ck_bf16_round().
Referenced by hyper_connection_mix_bf16().
| void gemm_nt_q4_k_q8_k_pairwise_split_min_parallel_dispatch | ( | const void * | A, |
| const void * | B, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Referenced by hyper_connection_mix_q4k_q5_0_q4k().
| void gemm_nt_q5_0_q8_0_parallel_dispatch | ( | const void * | A, |
| const void * | B, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Referenced by hyper_connection_mix_quantized().
| void gemm_nt_q6_k_q8_k_parallel_dispatch | ( | const void * | A, |
| const void * | B, | ||
| const float * | bias, | ||
| float * | C, | ||
| int | M, | ||
| int | N, | ||
| int | K | ||
| ) |
Referenced by hyper_connection_mix_q6k_q5_0_q4k().
| void gemv_q4_k_q8_k_avx2 | ( | float * | y, |
| const void * | W, | ||
| const void * | x_q8, | ||
| int | M, | ||
| int | K | ||
| ) |
Definition at line 118 of file gemm_kernels_q4k_q8k_avx2.c.
Referenced by hyper_injection_q4k_q8k_llama_dispatch().
| void hyper_connection_mix_bf16 | ( | const float * | hyper_input, |
| const float * | norm_weight, | ||
| const uint16_t * | mix_down_weight, | ||
| const uint16_t * | mix_up_weight, | ||
| const uint16_t * | inject_weight, | ||
| float * | mixed_output, | ||
| float * | injection_output, | ||
| float * | normalized_scratch, | ||
| float * | dynamic_scratch, | ||
| float * | mix_scratch, | ||
| int | rows, | ||
| int | streams, | ||
| int | hidden_dim, | ||
| int | dynamic_dim, | ||
| float | eps, | ||
| int | emit_injection | ||
| ) |
Definition at line 71 of file hyper_connection_kernels.c.
References bf16_to_float(), ck_bf16_round(), ck_sigmoid_bf16(), and rmsnorm_forward_qwen3next_pytorch_bf16_storage().
| void hyper_connection_mix_q4k_q5_0_q4k | ( | const float * | hyper_input, |
| const float * | norm_weight, | ||
| const void * | mix_down_weight, | ||
| const void * | mix_up_weight, | ||
| const void * | inject_weight, | ||
| float * | mixed_output, | ||
| float * | injection_output, | ||
| float * | normalized_scratch, | ||
| float * | dynamic_scratch, | ||
| float * | mix_scratch, | ||
| int | rows, | ||
| int | streams, | ||
| int | hidden_dim, | ||
| int | dynamic_dim, | ||
| float | eps, | ||
| int | emit_injection | ||
| ) |
Definition at line 344 of file hyper_connection_kernels.c.
References gemm_nt_q4_k_q8_k_pairwise_split_min_parallel_dispatch(), hyper_connection_mix_quantized(), and hyper_injection_q4k_q8k_llama_dispatch().
| void hyper_connection_mix_q6k_q5_0_q4k | ( | const float * | hyper_input, |
| const float * | norm_weight, | ||
| const void * | mix_down_weight, | ||
| const void * | mix_up_weight, | ||
| const void * | inject_weight, | ||
| float * | mixed_output, | ||
| float * | injection_output, | ||
| float * | normalized_scratch, | ||
| float * | dynamic_scratch, | ||
| float * | mix_scratch, | ||
| int | rows, | ||
| int | streams, | ||
| int | hidden_dim, | ||
| int | dynamic_dim, | ||
| float | eps, | ||
| int | emit_injection | ||
| ) |
Definition at line 368 of file hyper_connection_kernels.c.
References gemm_nt_q6_k_q8_k_parallel_dispatch(), hyper_connection_mix_quantized(), and hyper_injection_q4k_q8k_llama_dispatch().
|
static |
Definition at line 204 of file hyper_connection_kernels.c.
References gemm_nt_q5_0_q8_0_parallel_dispatch(), QK8_0, QK_K, quantize_row_q8_0(), quantize_row_q8_k(), recurrent_sigmoid_forward_ggml(), and recurrent_silu_forward_ggml().
Referenced by hyper_connection_mix_q4k_q5_0_q4k(), and hyper_connection_mix_q6k_q5_0_q4k().
|
static |
Definition at line 175 of file hyper_connection_kernels.c.
References gemv_q4_k_q8_k_avx2(), and QK_K.
Referenced by hyper_connection_mix_q4k_q5_0_q4k(), and hyper_connection_mix_q6k_q5_0_q4k().
| void hyper_stream_expand_bf16 | ( | const float * | input, |
| float * | output, | ||
| int | rows, | ||
| int | streams, | ||
| int | hidden_dim | ||
| ) |
Definition at line 51 of file hyper_connection_kernels.c.
References ck_bf16_round().
| void hyper_stream_expand_f32 | ( | const float * | input, |
| float * | output, | ||
| int | rows, | ||
| int | streams, | ||
| int | hidden_dim | ||
| ) |
Definition at line 32 of file hyper_connection_kernels.c.
| void hyper_stream_inject_bf16 | ( | const float * | hyper_input, |
| const float * | block_output, | ||
| const float * | injection_weight, | ||
| float * | output, | ||
| int | rows, | ||
| int | streams, | ||
| int | hidden_dim | ||
| ) |
Definition at line 392 of file hyper_connection_kernels.c.
References ck_bf16_round().
| void hyper_stream_inject_f32 | ( | const float * | hyper_input, |
| const float * | block_output, | ||
| const float * | injection_weight, | ||
| float * | output, | ||
| int | rows, | ||
| int | streams, | ||
| int | hidden_dim | ||
| ) |
Definition at line 423 of file hyper_connection_kernels.c.