MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_quantize_q8_0

Function ggml_quantize_q8_0

ggml.c:19211–19230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19209}
19210
19211size_t ggml_quantize_q8_0(const float * src, void * dst, int n, int k, int64_t * hist) {
19212 assert(k % QK8_0 == 0);
19213 const int nb = k / QK8_0;
19214
19215 for (int b = 0; b < n; b += k) {
19216 block_q8_0 * restrict y = (block_q8_0 *)dst + b/QK8_0;
19217
19218 quantize_row_q8_0_reference(src + b, y, k);
19219
19220 for (int i = 0; i < nb; i++) {
19221 for (int j = 0; j < QK8_0; ++j) {
19222 const int8_t vi = y[i].qs[j];
19223
19224 hist[vi/16 + 8]++;
19225 }
19226 }
19227 }
19228
19229 return (n/QK8_0*sizeof(block_q8_0));
19230}
19231
19232size_t ggml_quantize_chunk(enum ggml_type type, const float * src, void * dst, int start, int n, int64_t * hist) {
19233 size_t result = 0;

Callers 2

ggml_quantize_chunkFunction · 0.85
clip_model_quantizeFunction · 0.85

Calls 1

Tested by

no test coverage detected