char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
bec4772f6
char/aliceai-t5-moe
1#pragma once 2 3#define GGML_COMMON_DECL_C 4#include "ggml-common.h" 5 6#include "ggml.h" 7 8// GGML CPU internal header 9 10#ifdef __cplusplus 11extern "C" { 12#endif 13 14// Quantization 15void quantize_row_q1_0 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 16void quantize_row_q2_0 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 17void quantize_row_q4_0 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 18void quantize_row_q4_1 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 19void quantize_row_q5_0 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 20void quantize_row_q5_1 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 21void quantize_row_q8_0 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 22void quantize_row_q8_1 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 23 24void quantize_row_mxfp4 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 25void quantize_row_nvfp4 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 26 27void quantize_row_q2_K (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 28void quantize_row_q3_K (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 29void quantize_row_q4_K (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 30void quantize_row_q5_K (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 31void quantize_row_q6_K (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 32void quantize_row_q8_K (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 33 34void quantize_row_tq1_0 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 35void quantize_row_tq2_0 (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 36 37void quantize_row_iq4_nl (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 38void quantize_row_iq4_xs (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 39 40// Dot product 41void ggml_vec_dot_q1_0_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 42void ggml_vec_dot_q2_0_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 43void ggml_vec_dot_q4_0_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 44void ggml_vec_dot_q4_1_q8_1 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 45void ggml_vec_dot_q5_0_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 46void ggml_vec_dot_q5_1_q8_1 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 47void ggml_vec_dot_q8_0_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 48 49void ggml_vec_dot_mxfp4_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 50void ggml_vec_dot_nvfp4_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 51 52void ggml_vec_dot_q2_K_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 53void ggml_vec_dot_q3_K_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 54void ggml_vec_dot_q4_K_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 55void ggml_vec_dot_q5_K_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 56void ggml_vec_dot_q6_K_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 57 58void ggml_vec_dot_tq1_0_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 59void ggml_vec_dot_tq2_0_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 60 61void ggml_vec_dot_iq2_xxs_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 62void ggml_vec_dot_iq2_xs_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 63void ggml_vec_dot_iq2_s_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 64void ggml_vec_dot_iq3_xxs_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 65void ggml_vec_dot_iq1_s_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 66void ggml_vec_dot_iq1_m_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 67void ggml_vec_dot_iq4_nl_q8_0 (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 68void ggml_vec_dot_iq4_xs_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 69void ggml_vec_dot_iq3_s_q8_K (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 70 71// Generic implementation 72void quantize_row_q8_0_generic (const float * GGML_RESTRICT x ,void * GGML_RESTRICT vy ,int64_t k ); 73void quantize_row_q8_1_generic (const float * GGML_RESTRICT x ,void * GGML_RESTRICT vy ,int64_t k ); 74void quantize_row_q8_K_generic (const float * GGML_RESTRICT x ,void * GGML_RESTRICT y ,int64_t k ); 75void ggml_vec_dot_q1_0_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 76void ggml_vec_dot_q2_0_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 77void ggml_vec_dot_q4_0_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 78void ggml_vec_dot_q4_1_q8_1_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 79void ggml_vec_dot_q5_0_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 80void ggml_vec_dot_q5_1_q8_1_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 81void ggml_vec_dot_q8_0_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 82 83void ggml_vec_dot_mxfp4_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 84void ggml_vec_dot_nvfp4_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 85 86void ggml_vec_dot_tq1_0_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 87void ggml_vec_dot_tq2_0_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 88 89void ggml_vec_dot_q2_K_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 90void ggml_vec_dot_q3_K_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 91void ggml_vec_dot_q4_K_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 92void ggml_vec_dot_q5_K_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 93void ggml_vec_dot_q6_K_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 94void ggml_vec_dot_iq2_xxs_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 95void ggml_vec_dot_iq2_xs_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 96void ggml_vec_dot_iq2_s_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 97void ggml_vec_dot_iq3_xxs_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 98void ggml_vec_dot_iq3_s_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 99void ggml_vec_dot_iq1_s_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 100void ggml_vec_dot_iq1_m_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 101void ggml_vec_dot_iq4_nl_q8_0_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 102void ggml_vec_dot_iq4_xs_q8_K_generic (int n ,float * GGML_RESTRICT s ,size_t bs ,const void * GGML_RESTRICT vx ,size_t bx ,const void * GGML_RESTRICT vy ,size_t by ,int nrc ); 103 104#ifdef __cplusplus 105} 106#endif