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

Function quantize_q2_K

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

Source from the content-addressed store, hash-verified

1032}
1033
1034size_t quantize_q2_K(const float * GGML_RESTRICT src, void * GGML_RESTRICT dst, int64_t nrow, int64_t n_per_row, const float * quant_weights) {
1035 size_t row_size = ggml_row_size(GGML_TYPE_Q2_K, n_per_row);
1036 if (!quant_weights) {
1037 quantize_row_q2_K_ref(src, dst, (int64_t)nrow*n_per_row);
1038 }
1039 else {
1040 char * qrow = (char *)dst;
1041 for (int64_t row = 0; row < nrow; ++row) {
1042 quantize_row_q2_K_impl(src, (block_q2_K*)qrow, n_per_row, quant_weights);
1043 src += n_per_row;
1044 qrow += row_size;
1045 }
1046 }
1047 return nrow * row_size;
1048}
1049
1050//========================= 3-bit (de)-quantization
1051

Callers 1

ggml_quantize_chunkFunction · 0.85

Calls 3

ggml_row_sizeFunction · 0.85
quantize_row_q2_K_refFunction · 0.85
quantize_row_q2_K_implFunction · 0.85

Tested by

no test coverage detected