mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-30 21:34:36 +00:00
gguf : start implementing quantization (WIP)
This commit is contained in:
parent
0e1a3c7e7d
commit
c4f02b4f74
@ -778,8 +778,7 @@ struct gguf_file_saver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
write_tensor_info(tensor);
|
write_tensor_info(tensor);
|
||||||
// file.write_raw(new_data);
|
file.write_raw(new_data, new_size);
|
||||||
GGML_UNUSED(new_data);
|
|
||||||
size_t padded_size = GGML_PAD(new_size, GGUF_DEFAULT_ALIGNMENT); // TODO: handle custom alignment
|
size_t padded_size = GGML_PAD(new_size, GGUF_DEFAULT_ALIGNMENT); // TODO: handle custom alignment
|
||||||
size_t pad = padded_size - new_size;
|
size_t pad = padded_size - new_size;
|
||||||
file.write_zeros(pad);
|
file.write_zeros(pad);
|
||||||
|
@ -123,6 +123,10 @@ struct gguf_file {
|
|||||||
return fwrite((const char *) &val, sizeof(val), 1, fp);
|
return fwrite((const char *) &val, sizeof(val), 1, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void write_raw(const void * data, size_t size) {
|
||||||
|
fwrite(data, size, 1, fp);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void write_val(const std::string & key, enum gguf_type type, const T & val) {
|
void write_val(const std::string & key, enum gguf_type type, const T & val) {
|
||||||
write_str(key);
|
write_str(key);
|
||||||
|
Loading…
Reference in New Issue
Block a user