mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-11-15 11:17:31 +00:00
convert : use reflinks for faster conversion
This commit is contained in:
@@ -42,8 +42,8 @@ void ggml_print_backtrace(void);
|
||||
# define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
// required for mmap as gguf only guarantees 32-byte alignment
|
||||
#define TENSOR_ALIGNMENT 32
|
||||
// required for mmap as gguf converted with reflinks from safetensors only guarantees 8-byte alignment
|
||||
#define TENSOR_ALIGNMENT 8
|
||||
|
||||
// static_assert should be a #define, but if it's not,
|
||||
// fall back to the _Static_assert C11 keyword.
|
||||
|
||||
@@ -624,6 +624,8 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par
|
||||
ctx->size = 0;
|
||||
for (size_t i = 0; i < ctx->info.size(); ++i) {
|
||||
const gguf_tensor_info & ti = ctx->info[i];
|
||||
// HACK: bypass the continuity check
|
||||
ctx->size = ti.offset;
|
||||
if (ti.offset != ctx->size) {
|
||||
GGML_LOG_ERROR("%s: tensor '%s' has offset %" PRIu64 ", expected %zu\n",
|
||||
__func__, ti.t.name, ti.offset, ctx->size);
|
||||
|
||||
Reference in New Issue
Block a user