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

Function quantize_q4_K

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

Source from the content-addressed store, hash-verified

1447}
1448
1449size_t quantize_q4_K(const float * GGML_RESTRICT src, void * GGML_RESTRICT dst, int64_t nrow, int64_t n_per_row, const float * quant_weights) {
1450 size_t row_size = ggml_row_size(GGML_TYPE_Q4_K, n_per_row);
1451 if (!quant_weights) {
1452 quantize_row_q4_K_ref(src, dst, (int64_t)nrow*n_per_row);
1453 }
1454 else {
1455 char * qrow = (char *)dst;
1456 for (int64_t row = 0; row < nrow; ++row) {
1457 quantize_row_q4_K_impl(src, (block_q4_K*)qrow, n_per_row, quant_weights);
1458 src += n_per_row;
1459 qrow += row_size;
1460 }
1461 }
1462 return nrow * row_size;
1463}
1464
1465// ====================== 5-bit (de)-quantization
1466

Callers 1

ggml_quantize_chunkFunction · 0.85

Calls 3

ggml_row_sizeFunction · 0.85
quantize_row_q4_K_refFunction · 0.85
quantize_row_q4_K_implFunction · 0.85

Tested by

no test coverage detected