MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / quantize_q5_0

Function quantize_q5_0

subprojects/llama.cpp/ggml/src/ggml-quants.c:2020–2033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2018}
2019
2020size_t quantize_q5_0(const float * GGML_RESTRICT src, void * GGML_RESTRICT dst, int64_t nrow, int64_t n_per_row, const float * quant_weights) {
2021 if (!quant_weights) {
2022 quantize_row_q5_0_ref(src, dst, (int64_t)nrow*n_per_row);
2023 return nrow * ggml_row_size(GGML_TYPE_Q5_0, n_per_row);
2024 }
2025 size_t row_size = ggml_row_size(GGML_TYPE_Q5_0, n_per_row);
2026 char * qrow = (char *)dst;
2027 for (int64_t row = 0; row < nrow; ++row) {
2028 quantize_row_q5_0_impl(src, (block_q5_0*)qrow, n_per_row, quant_weights);
2029 src += n_per_row;
2030 qrow += row_size;
2031 }
2032 return nrow * row_size;
2033}
2034
2035static void quantize_row_q5_1_impl(const float * GGML_RESTRICT x, block_q5_1 * GGML_RESTRICT y, int64_t n_per_row, const float * quant_weights) {
2036 static_assert(QK5_1 == 32, "QK5_1 must be 32");

Callers 1

ggml_quantize_chunkFunction · 0.85

Calls 3

quantize_row_q5_0_refFunction · 0.85
ggml_row_sizeFunction · 0.85
quantize_row_q5_0_implFunction · 0.85

Tested by

no test coverage detected