ggml : remove ggml_cplan + rework ggml_cgraph

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-09-11 13:05:10 +03:00
parent ee154457dd
commit 119e0bc9ae
No known key found for this signature in database
GPG key ID: 449E073F9DC10735
10 changed files with 248 additions and 175 deletions

View file

@ -113,7 +113,10 @@ int main(void) {
ggml_build_forward_expand(ge, e);
ggml_graph_reset(ge);
ggml_graph_compute_with_ctx(ctx, ge, /*n_threads*/ 1);
ggml_graph_prepare(ge, 1, nullptr);
ggml_graph_work_init(ge, nullptr);
ggml_graph_compute(ge);
ggml_graph_work_free(ge);
const float fe = ggml_get_f32_1d(e, 0);
printf("%s: e = %.4f\n", __func__, fe);
@ -124,7 +127,10 @@ int main(void) {
ggml_graph_reset(ge);
ggml_graph_compute_with_ctx(ctx, ge, /*n_threads*/ 1);
ggml_graph_prepare(ge, 1, nullptr);
ggml_graph_work_init(ge, nullptr);
ggml_graph_compute(ge);
ggml_graph_work_free(ge);
const float fe_opt = ggml_get_f32_1d(e, 0);
printf("%s: original e = %.4f\n", __func__, fe);