Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llama: initialize f16 tables in quantize c api. #1527

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,11 @@ struct llama_context * llama_init_from_file(
return ctx;
}

void llama_init_ggml(struct ggml_init_params params) {
struct ggml_context * ctx = ggml_init(params);
ggml_free(ctx);
}

void llama_free(struct llama_context * ctx) {
delete ctx;
}
Expand Down
4 changes: 4 additions & 0 deletions llama.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ extern "C" {
const char * path_model,
struct llama_context_params params);

// Init the ggml context (it won't return a context ptr because it will free
// the ctx after initialing it).
LLAMA_API void llama_init_ggml(struct ggml_init_params params);

// Frees all allocated memory
LLAMA_API void llama_free(struct llama_context * ctx);

Expand Down