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

Function quantize_q3_K

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

Source from the content-addressed store, hash-verified

1260}
1261
1262size_t quantize_q3_K(const float * GGML_RESTRICT src, void * GGML_RESTRICT dst, int64_t nrow, int64_t n_per_row, const float * quant_weights) {
1263 size_t row_size = ggml_row_size(GGML_TYPE_Q3_K, n_per_row);
1264 if (!quant_weights) {
1265 quantize_row_q3_K_ref(src, dst, (int64_t)nrow*n_per_row);
1266 }
1267 else {
1268 char * qrow = (char *)dst;
1269 for (int64_t row = 0; row < nrow; ++row) {
1270 quantize_row_q3_K_impl(src, (block_q3_K*)qrow, n_per_row, quant_weights);
1271 src += n_per_row;
1272 qrow += row_size;
1273 }
1274 }
1275 return nrow * row_size;
1276}
1277
1278// ====================== 4-bit (de)-quantization
1279

Callers 1

ggml_quantize_chunkFunction · 0.85

Calls 3

ggml_row_sizeFunction · 0.85
quantize_row_q3_K_refFunction · 0.85
quantize_row_q3_K_implFunction · 0.85

Tested by

no test coverage detected