Skip to content

Commit

Permalink
Merge pull request #321 from ggerganov/sl/aligned-alloc-no-abort
Browse files Browse the repository at this point in the history
Sl/aligned alloc no abort
  • Loading branch information
Nexesenex authored Nov 4, 2024
2 parents 08828a6 + 20e1211 commit fea3c91
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ggml/src/ggml-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ static ggml_backend_buffer_t ggml_backend_cpu_buffer_type_alloc_buffer(ggml_back
void * data = ggml_aligned_malloc(size);

if (data == NULL) {
GGML_LOG_ERROR("%s: failed to allocate buffer of size %zu\n", __func__, size);
GGML_LOG_ERROR("%s: failed to allocate buffer of size %.2f MiB\n", __func__, size / 1024.0 / 1024.0);
return NULL;
}

Expand Down
1 change: 0 additions & 1 deletion ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ void * ggml_aligned_malloc(size_t size) {
break;
}
GGML_LOG_ERROR("%s: %s (attempted to allocate %6.2f MB)\n", __func__, error_desc, size/(1024.0*1024.0));
GGML_ABORT("fatal error");
return NULL;
}
return aligned_memory;
Expand Down
1 change: 1 addition & 0 deletions src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19534,6 +19534,7 @@ struct llama_context * llama_new_context_with_model(

if (!llama_kv_cache_init(ctx->kv_self, ctx, type_k, type_v, kv_size, cparams.offload_kqv)) {
LLAMA_LOG_ERROR("%s: llama_kv_cache_init() failed for self-attention cache\n", __func__);
LLAMA_LOG_ERROR("%s: suggestion: try using a smaller context size (-c command line option or llama_context_params.n_ctx)\n", __func__);
llama_free(ctx);
return nullptr;
}
Expand Down

0 comments on commit fea3c91

Please sign in to comment.