ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
Loading...
Searching...
No Matches
weight_management.h
Go to the documentation of this file.
1#pragma once
2
3#include "gguf_structs.h"
4#include "model.h"
5
6// Dequantises a GGUF tensor of type F16, BF16, Q4_0, Q4_1, Q5_0, Q5_1, Q4_K, Q5_K or Q6_K into
7// f32 (element order unchanged); false for any other type.
8bool dequant_legacy_to_f32(const GGUFTensorInfo& info, const uint8_t* src, std::vector<float>& out);
9
10// Dequantises elements [first, first + n) of a tensor of type F16, BF16, Q8_0,
11// Q4_0, Q4_1, Q5_0, Q5_1, Q4_K, Q5_K or Q6_K stored at src (for the block types,
12// first and n are multiples of the block width: 32, or 256 for the K-quants).
13// Each value equals the one the whole-tensor dequantisers (dequant_legacy_to_f32,
14// dequantize_vector_q8_0_to_f32, dequantize_vector_q4k/q5k/q6k_to_f32) give it:
15// they share these per-block routines. False for any other type.
16bool dequant_span_to_f32(GGMLType t, const uint8_t* src, size_t first, size_t n, float* out);
GGMLType
Enumeration of GGML tensor data types.
Definition ggml_types.h:21
Data structures for GGUF (GPT-Generated Unified Format) file format.
int n
node out
size_t j
Information about a tensor stored in a GGUF file.
bool dequant_legacy_to_f32(const GGUFTensorInfo &info, const uint8_t *src, std::vector< float > &out)
bool dequant_span_to_f32(GGMLType t, const uint8_t *src, size_t first, size_t n, float *out)