cosmopolitan/third_party/ggml/ggjt.v1.q8_0.h
Justine Tunney 5a4cf9560f
Add support for new GGJT v2 quantizers
This change makes quantized models (e.g. q4_0) go 10% faster on Macs
however doesn't offer much improvement for Intel PC hardware.

This change syncs llama.cpp 699b1ad7fe6f7b9e41d3cb41e61a8cc3ea5fc6b5
which recently made a breaking change to nearly all its file formats
without any migration. Since that'll break hundreds upon hundreds of
models on websites like HuggingFace llama.com will support both file
formats because llama.com will never ever break the GGJT file format
2023-05-13 08:08:32 -07:00

22 lines
894 B
C

#ifndef COSMOPOLITAN_THIRD_PARTY_GGML_GGJT_V1_Q8_0_H_
#define COSMOPOLITAN_THIRD_PARTY_GGML_GGJT_V1_Q8_0_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define V1_QK8_0 32
typedef struct {
float d; // delta
int8_t qs[V1_QK8_0]; // quants
} block_v1_q8_0;
void dequantize_row_v1_q8_0(const void* restrict, float* restrict, int);
void quantize_row_v1_q8_0(const float* restrict, void* restrict, int);
size_t ggml_quantize_v1_q8_0(const float*, void*, int, int, int64_t*);
void ggml_vec_dot_v1_q8_0_q8_0(const int, float* restrict, const void* restrict,
const void* restrict);
void quantize_row_v1_q8_0_reference(const float* restrict,
block_v1_q8_0* restrict, int);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_THIRD_PARTY_GGML_GGJT_V1_Q8_0_H_ */